|
[Sponsors] |
Error installing OpenFOAM 2.2.0 on CentOS 6.4 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 9, 2013, 16:30 |
Error installing OpenFOAM 2.2.0 on CentOS 6.4
|
#1 |
New Member
Caio Maioli
Join Date: Jun 2013
Posts: 1
Rep Power: 0 |
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 |
|
August 10, 2013, 05:57 |
|
#2 | |
Member
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 53
Rep Power: 17 |
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. |
||
August 21, 2013, 13:58 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
September 6, 2013, 07:44 |
OF 2.2.x on RHEL 6.4 x86_64
|
#4 |
New Member
Per Nilsson
Join Date: Mar 2009
Location: Lund, Sweden
Posts: 21
Rep Power: 17 |
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 |
|
September 7, 2013, 04:39 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
September 7, 2013, 05:04 |
|
#6 |
New Member
Per Nilsson
Join Date: Mar 2009
Location: Lund, Sweden
Posts: 21
Rep Power: 17 |
Hi!
Frankly, I don't know, so I will try to describe what I did. 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 |
|
September 7, 2013, 05:40 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Per,
Thanks, I've added this information to the wiki page! Best regards, Bruno
__________________
|
|
November 4, 2013, 08:00 |
|
#8 |
Senior Member
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16 |
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 primitives/triad/triad.C:39: error: expected initializer before '<'token make: *** [Make/linux64GccDPOpt/triad.o] Error 1 Code:
/usr/bin/ld: cannot find -lOpenFOAM collect2: ld returned 1 exit status make: *** [/home/trap/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64GccDPOpt/lib/libfiniteVolume.so] Error 1 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... |
|
November 4, 2013, 18:02 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
January 10, 2014, 16:46 |
Comments on installing OpenFOAM-2.2.2 with Centos 6
|
#10 |
Member
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13 |
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. |
|
January 10, 2014, 19:08 |
|
#11 | ||||||||||||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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 mpfrPACKAGE=mpfr-3.1.0 mpcPACKAGE=mpc-0.9 gccPACKAGE=gcc-4.6.2 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 \ WM_COMPILER=Gcc45 WM_MPLIB=SYSTEMOPENMPI 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:
YMMV - did you check:
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
__________________
|
|||||||||||||
January 10, 2014, 22:15 |
Compiling OpenFOAM
|
#12 |
Member
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13 |
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 |
|
January 11, 2014, 16:43 |
|
#13 | ||||||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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 source etc/bashrc WM_MPLIB=MPICH echo $WM_MPLIB echo $FOAM_SETTINGS Code:
MPICH WM_MPLIB=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 source etc/bashrc WM_MPLIB=SYSTEMOPENMPI echo $WM_MPLIB echo $FOAM_SETTINGS 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 collect2: ld returned 1 exit status make[2]: *** [ptdummysizes] Error 1 The same issue a few lines lower: Code:
wmake libso mpi /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 collect2: ld returned 1 exit status make: *** [/global/usr/apps/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64Gcc45DPOpt/lib/openmpi-system/libPstream.so] Error 1 To check what exact MPI definitions are in place, run: Code:
echo $MPI_ARCH_PATH ls -l $MPI_ARCH_PATH/lib/lib*mpi* Best regards, Bruno
__________________
|
|||||||
January 11, 2014, 17:27 |
|
#14 |
Member
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13 |
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 |
|
January 13, 2014, 13:45 |
Install scripts for Centos 6
|
#15 |
Member
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13 |
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 |
|
January 13, 2014, 17:28 |
|
#16 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
January 13, 2014, 18:43 |
|
#17 |
Member
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13 |
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 |
|
January 17, 2014, 18:25 |
Compiling OpenFOAM - update with gcc 4.7
|
#18 |
Member
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13 |
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. |
|
January 18, 2014, 12:20 |
|
#19 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Tony,
Quote:
Quote:
But I'll have a quick look into this later today. Best regards, Bruno
__________________
|
|||
January 18, 2014, 14:58 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenSuse 12.3 x64 with OpenFoam 2.2.0 | aylalisa | OpenFOAM Installation | 2 | May 5, 2013 12:29 |
OpenFOAM 2.2.0 installation on ICC (Intel C++ Compiler) | vishal3 | OpenFOAM Installation | 3 | April 26, 2013 21:00 |
InterPhaseChangeFoam problem with OpenFOAM 2.2.0 | Mashiro5 | OpenFOAM Running, Solving & CFD | 5 | April 18, 2013 10:47 |
Installing OpenFOAM 2.1.1 on CentOS 5.x | phuchuynh | OpenFOAM Installation | 1 | October 10, 2012 17:58 |
The OpenFOAM extensions project | mbeaudoin | OpenFOAM | 16 | October 9, 2007 10:33 |