Error installing OpenFOAM 2.2.0 on CentOS 6.4
Hi everyone,
I have tried to install OpenFOAM 2.2.0 on CentOS 6.4 following the tutorial in this link: http://openfoamwiki.net/index.php/In...CentOS_SL_RHEL But when I get to step #6 to build the Gcc 4.5.2, I still get the error: Warning in /home/lftc/OpenFOAM/OpenFOAM-2.2.0/etc/config/settings.sh: Cannot find /home/lftc/OpenFOAM/ThirdParty-2.2.0/platforms/linux64/gcc-4.5.2 installation. Please install this compiler version or if you wish to use the system compiler, change the 'foamCompiler' setting to 'system' Looking into the mkgcc.log file, it seems that it "could not find a working compiler". The mkgcc.log file is shown below: --------------- Starting build: gmp-5.0.1 + /home/lftc/OpenFOAM/ThirdParty-2.2.0/gmp-5.0.1/configure ABI=64 --prefix=/home/lftc/OpenFOAM/ThirdParty-2.2.0/platforms/linux64/gmp-5.0.1 --enable-cxx checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking ABI=64 checking compiler icc ... no configure: error: could not find a working compiler, see config.log for details Error building: gmp-5.0.1 Can somebody help solve this problem? Thanks, Caio |
Quote:
1) Check that you have a working gcc compiler: 'gcc --version', 'g++ --version'; if not, install it from repo: 'yum install gcc gcc-c++' 2) Download and compile a new version of gcc: see http://gcc.gnu.org; you'll also need mpc (www.multiprecision.org), mpfr (http://www.mpfr.org/), gmp (http://gmplib.org/). 3) After installing, make sure new versions of gcc/g++ are used: you may set aliases (e.g., 'alias gcc=/usr/bin/gcc-4.8.1') or smth; 4) Make sure 'OpenFOAM-2.2.0/etc/bashrc' says 'foamCompiler=system'; 5) 'source OpenFOAM-2.2.0/etc/bashrc' and compile. |
Greetings to all, and Caio welcome to the forum!
In the defence of the wiki page: http://openfoamwiki.net/index.php/In...HEL#CentOS_6.4 - the reason for the error message is because something went very wrong when following the instructions for step #1, more specifically the execution of the command: Code:
yum groupinstall 'Development Tools' Bruno |
OF 2.2.x on RHEL 6.4 x86_64
Many thanks wyldckat for the excellent wiki page!
It worked fine for me with OpenFOAM 2.2.x on RHEL 6.4 x86_64. Obviously I changed the directory names to 2.2.x. I also had to Code:
export PATH=$PATH:/usr/lib64/openmpi/bin before loading the openmpi module. Best regards, Per |
Greetings Per and many thanks for the feedback!
But I have one question: do you need to run that export command even after logging out? Because these module-like systems usually only manage to do a refresh of the environment after a new terminal has been started or after the user has logged out and logged back in. Best regards, Bruno |
Hi!
Frankly, I don't know, so I will try to describe what I did. :o First I followed the instructions and thus loaded the module without adding the path to the systems openmpi. Then I got problems; mpicc was not found and apparently it was looked for down the ThirdParty directory. I did not manage to redirect the search to the systems openmpi location, not even by starting a new terminal. I also thought about "ejecting" and reloading the module again (because I thought that the path was included in the loaded module), but I did not now how to "eject" a module. Therefore I exported the path to the systems openmpi as described. (I also added this in my .bashrc.) Then I followed the instructions through again - and it worked! Best regards, Per |
Hi Per,
Thanks, I've added this information to the wiki page! Best regards, Bruno |
Hello everyone,
I had some problems with ParaFoam and centOS. So I re-installed a clean version of centOS 6.4 and I followed the wiki. Everything was good. I successfully installed OpenFoam, paraview and Parafoam. I launched a tutorial (motorbike). And then I have restart the computer : no more solveurs available. So I'm running again the Allwmake command in OpenFoam-2.2.2 folder and I get some error outputs : 1st error : Code:
primitives/triad/triad.C:36: error: expected initializer before '<'token Code:
/usr/bin/ld: cannot find -lOpenFOAM EDIT : When I source OpenFoam I got this message : "bash: mpicc: command not found" I switch to openmpi in the 3rdParty to avoid this last problem. EDIT 2 : After a reboot and a new compilation, everything is good... |
Hi Aurelien,
I'm glad you've finally managed to get it working properly! My guess is that on step #4, the last 2 commands didn't work very well. As for the "triad" problem, it was because the wrong Gcc version was being picked up, since CentOS 6.4 only provides Gcc 4.4 and OpenFOAM 2.2 needs at least Gcc 4.5. Best regards, Bruno |
Comments on installing OpenFOAM-2.2.2 with Centos 6
The website http://openfoamwiki.net/index.php/In...CentOS_SL_RHEL and Bruno's scripts have been very helpful to me in trying to install OpenFOAM-2.2.2 on my CentOS 6.5 platform.
I would like to add some comments to the instructions on the webpage and ask one or two questions 1) I think the sequence is a bit out of order. If you set the compiler to ThirdParty you cannot compile gcc since there is no working compiler at that point (I guess). So you need to source the bashrc to set the OF environment but leave the default foamCompiler setting (system) until after you gcc installed. At least this is what worked for me. 2) I think arguments to Bruno's scripts (getGcc, getBinutils, makeBinutils) are unnecessary - the packages are defined within each script. So just getGcc followed by makeGcc works; this is not a bug but I found it confusing. It is important to check the consistency of the package versions between the get and make scripts and also the gcc version in makeBinutils. OpenFOAM-2.2.2 seems to expect gcc-4.5.2 by default so its easiest to install that one. 3) I found it difficult to get OpenFOAM to use the right compiler. The instructions did not work for me. I found that after running Allwmake the key system variables had been reset to their default values: i.e. foamCompiler= WM_COMPILER=Gcc WM_MPLIB=OPENMPI So the compilation of triad.C still breaks. I fixed this by editing the bashrc to set the correct values (perhaps I should have used prefs.sh) and I could then compile triad.C OK. 4) I followed the directions and used SYSTEMOPENMPI but the compilation of ptscotch was then broken. When trying to compile ptscotchDecomp.C it was apparently looking for the header file ptscotch.h in /usr/include/scotch which does not exist on my system. I recompiled with OPENMPI and this time everything worked. 5) I have one error remaining: cp: cannot stat `../bin/[agm]*': No such file or directory make: [install] Error 1 (ignored) Am I correct in thinking this can be ignored (foamInstallationTest is good) 6) Can someone explain what FOAM_SETTINGS is. Whenever I check it seems to be empty. A summary of my comments: 1) Package versions are defined in the scripts - check for consistency 2) Use the default OpenFoam settings while making gcc and binutils 3) Set the compiler options foamCompiler and WM_Compiler in prefs.sh (it needs to go in the etc directory) or in bashrc 3) Use the openmpi from ThirdParty tree The web page and Bruno's scripts were enormously helpful. I don't think I could have got it working without. Thanks to everyone involved. |
Greetings Tony and many thanks for the feedback!
Let me see if I'm able to answer your comments and questions: Quote:
Quote:
Quote:
Quote:
Code:
gmpPACKAGE=gmp-5.0.4 Quote:
That is why I indicated explicitly the versions in the arguments for each script. As to why I wrote the instructions to use GCC 4.5? Well, it's inherited from old instructions and I decided to go along with what's known to always work. Nonetheless, the makeBinutils script does need some serious revision :( At this point, it's probably completely unecessary to use it at all. I gotta find some time to double-check that. Quote:
Code:
source $HOME/OpenFOAM/OpenFOAM-2.2.2/etc/bashrc WM_NCOMPPROCS=4 foamCompiler=ThirdParty \ If you copy-paste the two lines in a single go and then run: Code:
echo $WM_COMPILER Quote:
Quote:
Any other errors that do not state "(ignored)", can be understood as not being ignored! ;) Quote:
Anyway, "FOAM_SETTINGS" is thoroughly explained here: http://openfoamwiki.net/index.php/In...iable_settings :) ------------------------- Quote:
Quote:
Quote:
Quote:
Beyond this, the instructions are not yet bulletproof. They should be, but not necessarily, since it might depend on the installation each user has got. For example, recently instructions were added to the Ubuntu Deb packages page: http://www.openfoam.org/download/ubuntu.php - regarding the need to specify the system MPI to be Open-MPI, because for some reason, some systems had by default MPICH2. Another detail is that you might have caught the small period of time of when I was readjusting the installation instructions to be more generic and able to contemplate the installation of several OpenFOAM versions, which was done on the 1st of January. Check the history link on the top right of the wiki page ;) Best regards, Bruno |
Compiling OpenFOAM
1 Attachment(s)
Bruno
There is a lot here I don't understand - I do appreciate you taking the time to help. One basic difficulty is that I still don't see how FOAM_SETTINGS is obtained. It seems as if you are using it as input to the bashrc (wmSET $FOAM_SETTINGS) but of course it has to have something in it first. It says in bashrc that it stores the previous values of the environment variables in FOAM_SETTINGS but I never see that behavior. So if I source etc/bashrc (from the OpenFOAM directory) then all the expected aliases and environment variables seem to be set. Now if I set WM_MPLIB=SYSTEMOPENMPI (for example) and then source bashrc it gets reset to OPENMPI (what I would expect) but FOAM_SETTINGS is still null. Is that correct? I also tried WM_MPLIB=SYSTEMOPENMPI followed by wmSET $FOAM_SETTINGS but again FOAM_SETTINGS was null afterwards. So I am obviously missing something. I did read the link you suggested but it did not find an answer there. Does Allwmake (in $WM_PROJECT_DIR) source bashrc. I say this because if I override a system default e.g. WM_MPLIB=SYSTEMOPENMPI then Allwmake runs with WM_MPLIB=OPENMPI regardless. If I check afterwards, I find WM_MPLIB is again OPENMPI. This is why I was editing bashrc rather than using the inline variables as you suggested (I do understand line breaks). Perhaps this is also why I had the problems compiling gcc with the edited bashrc -its behaving differently from the inline version I could not find where your scripts (getGcc etc.) parsed input arguments. I thought they just took the hard wired settings. I am a beginner with bash (just switched from csh) so I am obviously overlooking how you do that. I think MPI was loading correctly - the error in the log file was an include: 413 wmake libso ptscotchDecomp 414 SOURCE=ptscotchDecomp.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/include/openmpi-x86_64 -pthread -I/include -I/global/usr/apps/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/scotch_6.0.0/include/openmpi-system -I/usr/include/scotch -I../decompositionMethods/lnInclude -IlnInclude -I. -I/global/usr/apps/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude -I/global/usr/apps/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc45DPOptSYSTEMOPENMPI/ptscotchDecomp.o 415 ptscotchDecomp.C:126:22: fatal error: ptscotch.h: No such file or directory 416 compilation terminated. 417 make: *** [Make/linux64Gcc45DPOptSYSTEMOPENMPI/ptscotchDecomp.o] Error 1 A log file from the second try (shorter) is attached Tony |
Hi Tony,
Quote:
Quote:
Nonetheless, it is possible that your shell environment is not working as expected. Perhaps the dash, ash or bash shell you are using is older than the ones more common nowadays. A quick test is to start a new terminal, in which the OpenFOAM environment is not active. Then run these commands (the first line might be different for your installation!): Code:
cd ~/OpenFOAM/OpenFOAM-2.2.2 Code:
MPICH Quote:
It's meant to work as exemplified before the quote above. In other words, the correct steps for your example should be: Code:
cd ~/OpenFOAM/OpenFOAM-2.2.2 Code:
alias wmSET Quote:
Code:
#!/bin/sh Code:
ls -l /bin/sh Code:
lrwxrwxrwx 1 root root 4 Mar 29 2012 /bin/sh -> dash Code:
ls -l /bin/*sh* Quote:
Code:
# parse options Nonetheless, OpenFOAM is also able to use csh; the wiki instructions don't mention it, because ... well, I wrote most of the latest wiki instructions on how to install OpenFOAM and I only extremely rarely use csh. If you scroll down to the section "Setting environment variables for alternative locations" on the official instructions: http://www.openfoam.org/download/source.php - you'll find information about how to use csh/tcsh. Quote:
Code:
/global/usr/apps/OpenFOAM/ThirdParty-2.2.2/platforms/linux64/gcc-4.5.2/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lmpi The same issue a few lines lower: Code:
wmake libso mpi To check what exact MPI definitions are in place, run: Code:
echo $MPI_ARCH_PATH Best regards, Bruno |
Bruno
I see my mistake now. I had not realized the WM_xxx definitions were inputs to bashrc - stupid of me. I have a hard time with instructions I don't understand. Sorry to take your time on something trivial, but I have learnt a lot about how the OpenFOAM environment works. Thanks again Tony |
Install scripts for Centos 6
1 Attachment(s)
Bruno
Thanks again for your help over the weekend. I can now compile smoothly, at least with Gcc45. I tried with Gcc47 but the cmake compilation seemed to crash. I might take another look at that if I have some spare time. I made some scripts which are wrappers around your scripts; it just implements your webpage. But it makes it a bit easier to update versions and so on. They may be useful to someone. It assumes a SCRIPTS directory where the install scripts and your scripts live and a downloads directory where the OpenFOAM tarballs live. I made it go in stages so there can be some manual intervention (makes debugging easier too) but I can make a clean install (under centos 6.5) by running install with yes 1 2 3 4. Tony |
Hi Tony,
Thanks for sharing! I've added a link to your post on the wiki page: http://openfoamwiki.net/index.php/In...HEL#CentOS_6.4 Personally I did work on scripts that automated the installation of OpenFOAM on Ubuntu and then also began adding more Linux Distributions, but it became counter-productive, since the scripts had to be tested countless times... the project was this one: http://code.google.com/p/nucleation/ The conclusion I got from it is that it made a whole lot more sense to simply write the instructions on the wiki and do the adjustments only a few of times on-a-need-basis. And on top of that, it trains people a bit to look more closely how things are actually done and how to follow instructions... for a very picky development environment ;) By the way, on the topic of scripts for CentOS/RHEL, there is also CentFOAM: http://sourceforge.net/apps/mediawik...itle=Main_Page Best regards, Bruno |
Bruno
I agree with you. I think someone new to this should definitely work through your web page first. As you say it is a sophisticated and difficult environment, which I am only just beginning to understand. I have been blown away by the structure and coding of OpenFOAM; I think its an amazing intellectual effort. I learnt programming about 40 years ago and it was nothing like this. Best Tony |
Compiling OpenFOAM - update with gcc 4.7
1 Attachment(s)
I have tried compiling OpenFOAM using gcc 4.7.2; I thought that there may be a performance improvement over 4.5.2. However gcc 4.7.2 fails to compile cmake no matter what version (of cmake) I try.
The other packages were: gmp-5.0.4, mpc-0.9, mpfr-3.1.0 (from settings.sh), binutils-2.23.2 and the latest cmake-2.8.12.1 (2.8.3 fails to build as well) The error log has: /global/usr/apps/OpenFOAM47/ThirdParty-2.2.2/platforms/linux64/gcc-4.7.2/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../x86_64-unknown-linux-gnu/bin/ld: CMakeFiles/ccmake.dir/CursesDialog/cmCursesMainForm.cxx.o: undefined reference to symbol 'keypad' /global/usr/apps/OpenFOAM47/ThirdParty-2.2.2/platforms/linux64/gcc-4.7.2/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../x86_64-unknown-linux-gnu/bin/ld: note: 'keypad' is defined in DSO /lib64/libtinfo.so.5 so try adding it to the linker command line /lib64/libtinfo.so.5: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status This is a known issue with cmake and gcc 4.7 (for example http://nerdanswer.com/answer.php?q=222739) but there does not seem to be a solution. I tried adding /lib64 to LD_LIBRARY_PATH but it did not help (neither before or after the OpenFOAM libraries). It also seems to be OS dependent. The compatibility wiki (http://openfoamwiki.net/index.php/In...ibility_Matrix) suggests that it should work. Tony PS: here is an update to getCmake which allows you to input the version number (as in Bruno's other scripts). Its a copy of getBinutils modified for the cmake source tree. |
Hi Tony,
Quote:
Quote:
But I'll have a quick look into this later today. Best regards, Bruno |
Hi Tony,
What I've done differently from you was to use gcc 4.7.3 and binutils 2.23 on CentOS 6.5, and CMake 2.8.3 built without any problems. Then I tried switching only to gcc 4.7.2... and it also built CMake 2.8.3 without any problems. Honestly, I suggest that you try another "binutils" version and package. From my experience, the "binutils" packages can have a somewhat unstable nature... bz2 files are usually the most unstable ones. I don't know why it is, all I know is that when I switch versions or packages, I can build things with one version, but not the other. And don't forget to use: Code:
wmSET $FOAM_SETTINGS Best regards, Bruno |
Yes - it works for me too
Bruno
I found the combination of gcc-4.7.3, binutils-2.23 and cmake-2.8.3 compiled just fine. I agree that it is most likely the binutils - perhaps something broken in the loader with RHEL; but I would not have guessed it. Thanks Again Tony |
Follow up to gcc 4.7.2
Bruno
I made some more tests of the build of cmake. Here is what I found with gmp-5.0.4 mpc-0.9 mpfr-3.1.0 in each case gcc cmake binutils Build? 4.7.2 2.8.12.1 2.23 No 4.7.2 2.8.3 2.23 No 4.7.2 2.8.3 2.22 No 4.7.3 2.8.3 2.23 Yes 4.7.3 2.8.4 2.23.2 Yes 4.7.3 2.8.12.1 2.23 Yes 4.7.3 2.8.12.1 2.23.2 Yes So for me everything I tried with 4.7.3 worked while everything with 4.7.2 failed. So I do not understand your magic touch that enabled a build with 4.7.2 - unless the build you thought was 4.7.2 was in fact 4.7.3. In any case I am OK at this point - I have built a number of working versions of OpenFOAM - I just need to edit settings.sh to change 4.7.2 to 4.7.3. |
Error in executing ./Allwmake during OpenFOAM 2.2.2 installation
Dear all,
I am new to OpenFOAM and Linux. Currently I am trying to install OpenFOAM in CentOS 6.5 for i686 machine. I followed the instructions from http://openfoamwiki.net/index.php/In...CentOS_SL_RHEL but encountered some problem at no 13 instruction which is ./Allwmake. Please advise. sorry for the inconvenience because it is quite long. the error as below: Code:
[CFD@azraf PV3Readers]$ ./Allwmake |
I am not an expert in this, but the first complaint is that it cannot find libblockMesh.so. It should be in OpenFOAM-2.2.2/platforms/linux64Gcc45DPOpt/lib or similar. If not you need to check for errors in the build of OpenFOAM itself perhaps.
Tony |
Greetings to all!
@Azraf: Tony is correct. There seems to have been bigger problems while building OpenFOAM itself. Please follow the instructions in step #11. Best regards, Bruno |
CMake build error
1 Attachment(s)
Hello,
I was installing OpenFOAM 2.2.2 and paraview on Centos6.4 by followng the instruction of-http://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-2.2.2/CentOS_SL_RHEL#CentOS_6.4 . OpenFoam installation was successful and it runs cases with parallel, but I got error when I was building CMake 2.8.3. I look into the log files and didn't see any error until step no. 12. I attached the error in log file. Would anyone please help me out. Thanks |
The log file seemed empty when I tried to read it. I think it should be larger than 183 bytes.
Tony |
1 Attachment(s)
Sorry about empty file. here I updated the log file.
|
Manjura
I had a similar error but not with gcc-4.5.2. I found that gcc-4.7.2 crashed on building cmake in the same way as in your log files with the "keypad" error. I found that switching to 4.7.3 worked fine. In post 22 I report builds that worked and those that did not. However Bruno Santos, who is much more experienced than me, got a 4.7.2 build to work so I am not sure exactly what is wrong. I would suggest 1) You go over the instructions for the build of cmake and make sure you are following them exactly. 2) Are you using binutils-2.20.1 as the instructions recommend. Bruno says this can make a difference. 3) Try with different version of gcc - e.g. 4.7.3. (see post 22) 4) I compared your log file with my successful build of cmake-2.8.3 with gcc-4.5.2. The first difference was on line 192 193,195c193,195 < -- Looking for idna_to_ascii_lz in idn;dl - not found < -- Looking for dlopen in dl < -- Looking for dlopen in dl - found --- > -- Looking for idna_to_ascii_lz in idn;dl - found > -- Looking for dlopen in dl;idn > -- Looking for dlopen in dl;idn - found There is this thing "idna_to_ascii_lz in idn;dl" which my log reports as found and yours says not found. No idea why, but this may give you a place to start. Good luck Tony |
Thanks Tony for your reply.
The binutils version is 2.23. Is that may cause any problem? Thanks |
Possibly - do try 2.20.1 and post the result.
Tony |
oh...yes....it is binutils version that gives me the error.
binutils 2.20.1 is good to build cmake 2.8.3. Thanks a lot for helping me out. Now I will build paraview. Manjura |
Maybe late to the party, but I found this page while searching for that particular error in building cmake. I was running gcc-4.7.2 and binutils-2.22. After compiling binutils-2.24 and rebuilding cmake, I still had the same error.
In the end, editing $CMAKE_BUILD/Source/CMakeFiles/ccmake.dir/link.txt and adding "-ltinfo" to the end of the line fixed the issue. Went back and tested with binutils-2.22 using a fresh build directory, and I was able to complete the build using that, as well. All this might not be necessary on RH5-based distributions. I believe (but could be wrong) that they modified DSO linking between majors so you have to be a little more explicit now. [edit]: Someone on the kbuild mailing list arrived at the same conclusion/solution for that project: https://groups.google.com/forum/#!to...el/0AMWriDGc8g |
Greetings Jonathan and welcome to the forum!
And many thanks for sharing this information about building CMake! I just have a couple of questions, just to confirm the situation, so that I can try and reproduce the same issue:
Bruno |
|
All times are GMT -4. The time now is 16:28. |