CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Cmake cannot recognize gcc to compile ParaView (http://www.cfd-online.com/Forums/openfoam/78485-cmake-cannot-recognize-gcc-compile-paraview.html)

CAVT July 22, 2010 19:03

Cmake cannot recognize gcc to compile ParaView [SOLVED]
 
Well, firstly my apologies for another thread on compiling ParaView, but this is a new one. I'm using Unity Linux, 32bit, it's based on Mandriva, and I'm trying to finish installing OF1.7. Well, OpenFoam itself compiled perfectly, and now I'm trying to compile ParaView with the automated script makeParaView provided in the 3rd Party App folder. However, despite my environment is well set, and despite I have gcc, cmake and all that stuff, I get this in the terminal:

cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/unc/OpenFOAM/ThirdParty-1.7.0/platforms/linuxGcc/paraview-3.8.0 -DVTK_USE_TK:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=ON -DVTK_USE_RPATH:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DPARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON -DPARAVIEW_GENERATE_PROXY_DOCUMENTATION:BOOL=ON -DPARAVIEW_GENERATE_PROXY_DOCUMENTATION=OFF -DPARAVIEW_BUILD_QT_GUI=ON /home/unc/OpenFOAM/ThirdParty-1.7.0/paraview-3.8.0

----

-- The C compiler identification is unknown
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/usr/bin/gcc" is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/unc/OpenFOAM/ThirdParty-1.7.0/platforms/build-linuxGcc/paraview-3.8.0/CMakeFiles/CMakeTmp


And then it continues with some other errors which are simply the offshoots of this one. Apparently cmake cannot detect properly the compiler gcc, located at /user/bin/gcc, and I cannot figure out how to hardcode it. I've tried tweaking the cmakelists files unfructuously. I have followed to the letter the instructions in OF official website but I get stuck here. I now I can try with a precompiled ParaView, but I want to do the way OpenCFD indicates before trying something else.
Also, after installing everything, how do I know which files I can erase? The resulting folders are somewhat big and I want to create a live-dvd including OF, besides some other apps, and I'm constrained to 4 maximum of 4GB iso image.
Thanks in advance,

CÚsar

wyldckat July 23, 2010 15:21

Greetings CÚsar and welcome to the forum!

OK, as for the gcc issue, you can try running the following two commands:
Code:

export CC=`which gcc`
export CXX=`which g++`

And then run makeParaView. This should tell cmake and make which gcc and g++ should they really use.


As for packing OpenFOAM, it depends on how much of OpenFOAM do you want to make available in the DVD!?
If you only want to be able to run solvers, utilities and scripts, and not provide the source code, then the relevant folders are as follows:
Code:

OpenFOAM-1.7.0/applications/bin
OpenFOAM-1.7.0/etc
OpenFOAM-1.7.0/bin
OpenFOAM-1.7.0/lib
OpenFOAM-1.7.0/tutorials
OpenFOAM-1.7.0/doc (except the Doxygen folder in it)
ThirdParty-1.7.0/platforms
$USER-1.7.0/applications/bin

And you should be set to go! And if by any chance you also want to provide the executables that some tutorials specifically needed, run this from the OpenFOAM-1.7.0 folder:
Code:

wmake all tutorials
Those applications that some tutorials need will be compiled into the folder $USER-1.7.0/applications/bin.


Best regards,
Bruno

CAVT July 27, 2010 19:09

Cmake cannot recognize gcc to compile ParaView [SOLVED]
 
Thanks for the valuable advice, Bruno. I'm now building Paraview, let's see how it goes in the end, but so far this is what I did:

First I tried with your suggestion, but it didn't work. I found it pretty weird since when I compiled other softs those flags work well. So I checked if gcc was installed properly in my /usr/bin directory. Everything was fine, gcc is a symlink to the actual gcc-4.4.3 file. So I thought that maybe cmake is not reading well the symlink, and then I changed the export flag as "export CC=gcc-4.4.3" and now the error was pointing solely to g++. The actual g++ file is g++-4.4.3. So the final solution was:

export CC=gcc-4.4.3
export CXX=g++-4.4.3
./makeparaview

Naturally the version numbers wil depend on the installed gcc/g++, but it's evidently an issue of my cmake, since trying to build Paraview from an outer source using ccmake (as stated in Paraview's website) has the same errors. My cmake is 2.8, I noticed in one thread here someone reccomends using 2.6.4 instead of 2.8, but the solution sems to be specifying the full gcc/g++ name. Ha, I'm going 39% ready and advancing...

EDIT: to the mods, would you mind adding SOLVED to the thread title please? I don't have the option to change the title when editing the first post. Thanks.

wyldckat July 27, 2010 20:38

Greetings CÚsar,

At least I pointed you in the right direction :D
CMake is known to have it's ups and downs, one of which was a problem with a hard coded work around for a mount folder for some OS (Solaris I think)... which clashed with a normal enterprise Linux setup, with multi user mounts... and thus a pseudo-bug-fix was a bug in itself :p

Quote:

Originally Posted by CAVT (Post 269084)
EDIT: to the mods, would you mind adding SOLVED to the thread title please? I don't have the option to change the title when editing the first post.

You can change the title if, while in edit mode of the post, click on "Go Advanced"! Then it will open the advanced editing mode and provide you with all of technological buttonary that we can get on this forum :D

Best regards,
Bruno


All times are GMT -4. The time now is 01:12.