CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

Error installing OpenFOAM 2.2.0 on CentOS 6.4

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 9, 2013, 16:30
Default Error installing OpenFOAM 2.2.0 on CentOS 6.4
  #1
New Member
 
Caio Maioli
Join Date: Jun 2013
Posts: 1
Rep Power: 0
CGMaioli is on a distinguished road
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
CGMaioli is offline   Reply With Quote

Old   August 10, 2013, 05:57
Default
  #2
Member
 
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 53
Rep Power: 17
r08n is on a distinguished road
Quote:
Originally Posted by CGMaioli View Post

checking compiler icc ... no
configure: error: could not find a working compiler, see config.log for details
The installer tries to find the Intel compiler (icc) which is obviously not there. I would suggest to install a new gcc compiler (i.e., a newer version than that provided by CentOS) separately:
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.
r08n is offline   Reply With Quote

Old   August 21, 2013, 13:58
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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'
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   September 6, 2013, 07:44
Default 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
borrbyper is on a distinguished road
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
borrbyper is offline   Reply With Quote

Old   September 7, 2013, 04:39
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   September 7, 2013, 05:04
Default
  #6
New Member
 
Per Nilsson
Join Date: Mar 2009
Location: Lund, Sweden
Posts: 21
Rep Power: 17
borrbyper is on a distinguished road
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
wyldckat likes this.
borrbyper is offline   Reply With Quote

Old   September 7, 2013, 05:40
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Per,

Thanks, I've added this information to the wiki page!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 4, 2013, 08:00
Default
  #8
Senior Member
 
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16
Aurelien Thinat is on a distinguished road
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
2nd error :
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
Does anybody have any idea ?

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...
Aurelien Thinat is offline   Reply With Quote

Old   November 4, 2013, 18:02
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   January 10, 2014, 16:46
Default Comments on installing OpenFOAM-2.2.2 with Centos 6
  #10
Member
 
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13
tladd is on a distinguished road
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.
tladd is offline   Reply With Quote

Old   January 10, 2014, 19:08
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Tony and many thanks for the feedback!

Let me see if I'm able to answer your comments and questions:
Quote:
Originally Posted by tladd View Post
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.
Well, without a system compiler, you're not able to build the custom GCC As I've written on the wiki page (I've emboldened the crucial sentence in the quote):
Quote:
Note: You probably will see a message similar to this one and it's meant to do so until we've built the custom Gcc version:
Quote:
Originally Posted by tladd View Post
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.
When in doubt, look at the source code : https://github.com/wyldckat/scripts4.../master/getGcc - this is what the script has defined by default:
Quote:
Code:
gmpPACKAGE=gmp-5.0.1
mpfrPACKAGE=mpfr-2.4.2
mpcPACKAGE=mpc-0.8.1
gccPACKAGE=gcc-4.5.1
Unfortunately, the "ThirdParty-2.2.x" folder doesn't have a git repository, so I can't post directly a link to it, but the settings I see on my installation for "ThirdParty-2.2.x/makeGcc" are these:
Code:
gmpPACKAGE=gmp-5.0.4
mpfrPACKAGE=mpfr-3.1.0
mpcPACKAGE=mpc-0.9
gccPACKAGE=gcc-4.6.2
If you look at the source code at "OpenFOAM-2.2.2/etc/config/settings.sh", for the "Gcc46" option: https://github.com/OpenFOAM/OpenFOAM...ttings.sh#L243
Quote:
Code:
gcc_version=gcc-4.6.1
gmp_version=gmp-5.0.4
mpfr_version=mpfr-3.1.0
mpc_version=mpc-0.9
Not very consistent, is it?
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:
Originally Posted by tladd View Post
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.
I suspect that you didn't understand the "\" at the end of the first line here:
Code:
source $HOME/OpenFOAM/OpenFOAM-2.2.2/etc/bashrc WM_NCOMPPROCS=4 foamCompiler=ThirdParty \
WM_COMPILER=Gcc45 WM_MPLIB=SYSTEMOPENMPI
It's a line break, indicating that the code continues on the next line. This is because the wiki doesn't have a horizontal scroll for code, therefore I had to use the standard shell line break.
If you copy-paste the two lines in a single go and then run:
Code:
echo $WM_COMPILER
It should give you "Gcc45".

Quote:
Originally Posted by tladd View Post
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.
Mmm... that's strange. It worked well for me!? OK, not much of an excuse, but I would have liked to have seen the content of the "make.log" file, for when that happened.

Quote:
Originally Posted by tladd View Post
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)
Well... I always think that "Error 1 (ignored)" pretty much states that although it's an error, it has been ignored.
Any other errors that do not state "(ignored)", can be understood as not being ignored!

Quote:
Originally Posted by tladd View Post
6) Can someone explain what FOAM_SETTINGS is. Whenever I check it seems to be empty.
That's not good. It shouldn't be empty!? At least not if you followed the instructions to the letter.
Anyway, "FOAM_SETTINGS" is thoroughly explained here: http://openfoamwiki.net/index.php/In...iable_settings

-------------------------
Quote:
Originally Posted by tladd View Post
A summary of my comments:

1) Package versions are defined in the scripts - check for consistency
The original OpenFOAM scripts themselves aren't consistent

Quote:
Originally Posted by tladd View Post
2) Use the default OpenFoam settings while making gcc and binutils
It will use the system's default GCC, while the custom GCC version isn't built yet.

Quote:
Originally Posted by tladd View Post
3) Set the compiler options foamCompiler and WM_Compiler in prefs.sh (it needs to go in the etc directory) or in bashrc
Well... the in-line instructions don't require the usage of the "prefs.sh" file, but that would explain why your "FOAM_SETTINGS" is always empty.

Quote:
Originally Posted by tladd View Post
4) Use the openmpi from ThirdParty tree
YMMV - did you check:
  1. What version was given by mpirun and mpicc, when the "SYSTEMOPENMPI" options were defined:
    Code:
    mpirun --version
    mpicc --version
  2. Are you certain that the development files for the system Open-MPI are installed properly?
  3. Did you run the following line with success:
    Code:
    module load openmpi-x86_64 || export PATH=$PATH:/usr/lib64/openmpi/bin


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
__________________
wyldckat is offline   Reply With Quote

Old   January 10, 2014, 22:15
Default Compiling OpenFOAM
  #12
Member
 
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13
tladd is on a distinguished road
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
Attached Files
File Type: txt make.log2.txt (89.4 KB, 8 views)
tladd is offline   Reply With Quote

Old   January 11, 2014, 16:43
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tony,

Quote:
Originally Posted by tladd View Post
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?
Line 186: https://github.com/OpenFOAM/OpenFOAM...tc/bashrc#L184
Quote:
Code:
# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify alternative pref files
export FOAM_SETTINGS="$@"
_foamEval $@
That's how it's done in OpenFOAM's "bashrc" file
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
If the last two commands do not give you:
Code:
MPICH
WM_MPLIB=MPICH
then I'd say that there is a problem with the command line shell you are using. Check the instructions on this StackOverflow post: http://stackoverflow.com/a/3327022 - to find more information about the shell you are working with.


Quote:
Originally Posted by tladd View Post
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.
If that had worked, then there was something very fishy going on in your shell
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
By the way, regarding the wmSET command, it's an alias command, which means that if you run this:
Code:
alias wmSET
you'll see what it stands for.

Quote:
Originally Posted by tladd View Post
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
No, the Allwmake script uses the current shell environment. Although, you better check if the shell being used by the script is identical or similar to the shell you are using. Have a look into the first line of the script and you'll see this:
Code:
#!/bin/sh
Run this command to see what exactly that binary actually is:
Code:
ls -l /bin/sh
It might give you an indication that it's a link to the real shell, for example:
Code:
lrwxrwxrwx 1 root root 4 Mar 29  2012 /bin/sh -> dash
But it could also be a copy of the real shell binary; to check this, run:
Code:
ls -l /bin/*sh*
The ones with the same file size should be the same binary (if not a symbolic link).

Quote:
Originally Posted by tladd View Post
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.
The scripts use the same parsing mechanism as from the ones they originated from, namely from OpenFOAM's makeGcc. The code in specific starts with this comment:
Code:
# parse options
As for being new to bash: have a look into the whole wiki page and the links given there: http://openfoamwiki.net/index.php/In...with_the_Shell - the most important regarding bash is this one: http://linuxcommand.org/learning_the_shell.php

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:
Originally Posted by tladd View Post
I think MPI was loading correctly - the error in the log file was an include:

Code:
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
The log file tells a whole other story:
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
It says it cannot find the library file "libmpi.so" (it's what "-lmpi" stands for).

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
Only a bit lower than that does it give the error you've given above.

To check what exact MPI definitions are in place, run:
Code:
echo $MPI_ARCH_PATH
ls -l $MPI_ARCH_PATH/lib/lib*mpi*
The first command indicates the path defined by the file "etc/config/settings.sh" and the second line lists the known files that are named "lib*mpi*".

Best regards,
Bruno
tladd likes this.
__________________
wyldckat is offline   Reply With Quote

Old   January 11, 2014, 17:27
Default
  #14
Member
 
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13
tladd is on a distinguished road
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
wyldckat likes this.
tladd is offline   Reply With Quote

Old   January 13, 2014, 13:45
Default Install scripts for Centos 6
  #15
Member
 
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13
tladd is on a distinguished road
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
Attached Files
File Type: zip scripts.zip (8.2 KB, 23 views)
wyldckat likes this.
tladd is offline   Reply With Quote

Old   January 13, 2014, 17:28
Default
  #16
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   January 13, 2014, 18:43
Default
  #17
Member
 
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13
tladd is on a distinguished road
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
wyldckat likes this.
tladd is offline   Reply With Quote

Old   January 17, 2014, 18:25
Default Compiling OpenFOAM - update with gcc 4.7
  #18
Member
 
Tony Ladd
Join Date: Aug 2013
Posts: 48
Rep Power: 13
tladd is on a distinguished road
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.
Attached Files
File Type: zip getCmake.zip (1.3 KB, 15 views)
tladd is offline   Reply With Quote

Old   January 18, 2014, 12:20
Default
  #19
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tony,

Quote:
Originally Posted by tladd View Post
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.
One simple trick is to copy-paste the build of CMake from the other installation, by copying from the folder "ThirdParty-2.2.2/platforms/linux64Gcc45/cmake-2.8.3" to "ThirdParty-2.2.2/platforms/linux64Gcc47/cmake-2.8.3".

Quote:
Originally Posted by tladd View Post
The compatibility wiki (http://openfoamwiki.net/index.php/In...ibility_Matrix) suggests that it should work.
The "Compatibility Matrix" page only refers to OpenFOAM itself .

But I'll have a quick look into this later today.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 18, 2014, 14:58
Default
  #20
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
to refresh the shell environment, after gcc or binutils have been built.

Best regards,
Bruno
tladd likes this.
__________________
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 07:20.