CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Please help: Installing OpenFOAM-1.5-dev on Ubuntu 9.04 (

aat November 27, 2009 20:47

Please help: Installing OpenFOAM-1.5-dev on Ubuntu 9.04
Hello everyone:

Would you be able to help me install OpenFOAM-1.5-dev on my machine? This machine runs Ubuntu 9.04 (64 bit) and is a quad-core machine.

Background: I am very new to using OpenFOAM, but I have compiled and used OpenFOAM 1.6.x using the installation script by MadsR (Thank you MadS!!). I want to install the 1.5 dev version in order to use GGI and also the alternateChemistry package. I am hoping that alternateChemistry module is more robust than the OpenFOAM-1.6.x version, also GGI is a HUGE plus)

Steps taken:
1. I downloaded the ThirdParty package from and untarred it in ~/OpenFOAM
2. In the directory ~/OpenFOAM/ThirdParty/openmpi-1.2.6, I ran:
make all
sudo make install

(Note: As first attempt, I had tried to run ./Allwmake in ~/OpenFOAM/OpenFOAM-1.5-dev, but got repeated mpi related errors, one of them stating the system was not able to find mpi.h. After running make install in openmpi-1.2.6, I do not get this error)

3. uses the System compiler (gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3) and "which gcc" reports /usr/bin/gcc

4. sourced ~/OpenFOAM/OpenFOAM-1.5-dev/etc/bashrc
5 sourced ~/.bashrc

6. Ran the Allwmake script in OpenFOAM-1.5-dev directory (via ./Allwmake)

The compilation runs and then while creating executables in the .../OpenFOAM-1.5-dev/applications/bin directory, it reports errors for all. I have pasted the tail of the compiler messages here:
Making dependency list for source file equilibriumCO.C
SOURCE=equilibriumCO.C ; g++ -m64 -Dlinux64 -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/equilibriumCO.o
g++ -m64 -Dlinux64 -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC Make/linux64GccDPOpt/equilibriumCO.o -L/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt \
-lspecie -lOpenFOAM -liberty -ldl -lm -o /home/amish/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/equilibriumCO
/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt/openmpi-1.2.6/ undefined reference to `ompi_mpi_op_sum'
/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt/openmpi-1.2.6/ undefined reference to `ompi_mpi_byte'
/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt/openmpi-1.2.6/ undefined reference to `ompi_mpi_packed'
/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt/openmpi-1.2.6/ undefined reference to `ompi_mpi_comm_world'
/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt/openmpi-1.2.6/ undefined reference to `ompi_mpi_double'
collect2: ld returned 1 exit status
make[2]: *** [/home/amish/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/equilibriumCO] Error 1
make[1]: *** [equilibriumCO] Error 2
make[1]: Target `application' not remade because of errors.
make: *** [thermophysical] Error 2
g++ -m64 -Dlinux64 -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/decompositionAgglomeration/decompositionMethods/lnInclude -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/meshTools/lnInclude -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/dynamicMesh/lnInclude -IlnInclude -I. -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/amish/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC Make/linux64GccDPOpt/redistributeMeshPar.o -L/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt \
-lfiniteVolume -ldecompositionMethods -lmeshTools -ldynamicMesh -L/home/amish/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt/openmpi-1.2.6 -lparMetisDecompositionMethod -lOpenFOAM -liberty -ldl -lm -o /home/amish/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/redistributeMeshPar
/usr/bin/ld: cannot find -ldecompositionMethods
collect2: ld returned 1 exit status
make[2]: *** [/home/amish/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/redistributeMeshPar] Error 1
make[1]: *** [redistributeMeshPar] Error 2
make[1]: Target `application' not remade because of errors.
make: *** [parallelProcessing] Error 2
make: Target `application' not remade because of errors.
+ '[' '' = doc ']'


From the error messages, it appears that the libPstream.o file is not built correctly, or perhaps I am missing some important step in this process. I have looked at previous posts, notably by Hy Yu on installing the dev version on Ubuntu 9.04, where he was asked to compile Metis, but the error messages looked different at first glance.

Sorry for the long post! Any help is most appreciated!


bigphil November 27, 2009 21:34


I'm not an expert at OpenFOAM but I have compiled a few different versions and experienced many errors but it's usually something small (or many small things).

When you run the Allwmake script in OpenFOAM-1.5-dev directory, you need to find the first error (the first error will cause other errors and it propagates).

I usually do it bit by bit:

Starting in the 'OpenFOAM-1.5-dev' directory, do this:
(cd wmake/src && make)
And then make sure it reports no errors.

(cd $WM_THIRD_PARTY_DIR && ./Allwmake)
And check again to make sure there are no errors.

(cd src && ./Allwmake)
...check again for errors (it seems decompositionMethods hadn't compiled before for you)

Then assuming no errors up to now the apps can be compiled with:
(cd applications && ./Allwmake)

The first error you get, you can post here.
Hope this helps,
Philip C

aat November 27, 2009 23:29

1 Attachment(s)
Hello Philip:

Many thanks!

I started with fresh copies of OpenFOAM-1.5-dev and ThirdParty (untarred the OpenFOAM-1.5-dev.tar.gz and ThirdParty-1.6.General.gtgz) and followed your suggestions after sourcing etc/bashrc and $HOME/.bashrc

1. (cd wmake/src && make)
make: Nothing to be done for `all'.

2. (cd $WM_THIRD_PARTY_DIR && ./Allwmake) >log.allmake1 2>&1

Looking over the log, I saw this error:

In file included from hoard-371/src/libhoard.cpp:164:
lnInclude/wrapper.cpp: In function ‘void* memalign(size_t, size_t)’:
lnInclude/wrapper.cpp:137: error: declaration of ‘void* memalign(size_t, size_t)’ throws different exceptions
lnInclude/wrapper.cpp:116: error: from previous declaration ‘void* memalign(size_t, size_t) throw ()’
make: *** [Make/linux64GccDPOpt/libhoard.o] Error 1

and a bit further along, I see:

++ case "$WM_MPLIB" in
++ '[' -r /home/amish/OpenFOAM/ThirdParty/openmpi-1.2.6/platforms/linux64GccDPOpt/lib/ ']'
++ '[' -r /home/amish/OpenFOAM/ThirdParty/openmpi-1.2.6/platforms/linux64GccDPOpt/lib/libmpi.a ']'
++ cd /home/amish/OpenFOAM/ThirdParty/openmpi-1.2.6
./Allwmake: line 58: cd: /home/amish/OpenFOAM/ThirdParty/openmpi-1.2.6: No such file or directory

I am guessing this means my ThirdParty libraries *may* be broken, so I have not run steps 3 and 4. I have attached the entire log file, in case it helps.

Re. error#1: I have no clue what this means!!

Re. error 2: I cannot understand: why is Allwmake in $WM_THIRD_PARTY_DIR looking for openmpi-1.2.6? This directory seems to have a newer openmpi version, v1.3.3 now.


aat November 27, 2009 23:40

Sorry to be answering my own post.

Per this cfd-online exchange:

it seems that the error in compiling the hoard library in $WM_THIRD_PARTY_DIR/malloc has been reported before but it is not a show-stopping error. Philip, I will try steps 3 and 4 next.


bigphil November 28, 2009 13:39


hmmnn... not sure about the first error.

But for the second, check in the 'OpenFOAM-1.5-dev/etc/' file on line 161, that:

I think yours is set to 1.2.6, so change it and re-source the bash and try compile THIRD_PARTY again.


BTW where did you download your OpenFOAM-1.5-dev from?
I use
I use OpenSUSE so possibly the first error is Ubuntu related.

juliuslein November 30, 2009 08:37

Hello together,

I had the same problem with the openmpi version on a 64bit Ubuntu 9.10 and 8.04 but my error looked more like this:

... undefined reference to `Foam::Pstream ...

I finally downloaded the ThirdParty files from OpenFOAM-1.6 and copied the openmpi-1.3.3 folder into my ThirdParty folder. It was not necessary to compile ThirdParty again. Besides the newer openmpi version I'm using the ThirdParty binaries from the "normal" OpenFOAM-1.5 release. Until now I did not experienced any problems.

Good Luck

aat December 2, 2009 01:03

Thank you Julius and Philip!


I was able to install OpenFOAM-1.5-dev finally, thanks to the suggestions you had provided.

Philip, I started with the dev and thirdparty tar archives from the powerlab website as you pointed to, and Julius, I just copied over the openmpi-1.3.3 version. I had to play with the env variables to locate paraview after I had compiled it, and now it works fine. I ran some serial and parallel tutorials to confirm.

After doing this, I was also able to compile the alternateChemistry models; this took a lot more work to install cantera (along with sundials) correctly. I still have not been able to compile groovyBC, that's next...

Thank you once again for your help!


bigphil December 2, 2009 06:37



juliuslein December 2, 2009 12:02

Hello aat,

nice to hear that the installation finally worked.

About the paraview topic: There is just another small "bug" in the bashrc of paraview ($WM_PROJECT_DIR/etc/apps/paraview3/bashrc) which leads to a wrong folder. In my version I had to delete a "-" in the reference to the paraFoam folder. In line 45 you find:

export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION

deleting the "-" between Paraview and $ParaView_VERSION leads to

export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView$ParaView_VERSION

what finally works. I hope this helped a bit.

flowris June 4, 2010 10:35


I am also trying to install OpenFOAM-1.5-dev and experiencing problems that are partly the same as yours.

I changed line 161 in as suggested.
I copied the openmpi-1.3.3 folder form version 1.6 and recompiled ThirdParty succesfully.

Then I followed the steps in post nr. 2. The first two went well, but at the third one, namely (cd src && ./Allwmake), errors occurred. For clarity, I am in
and I command

The last lines of the output in the terminal are:

/home/jmatthei/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux64/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/x86_64-unknown-linux-gnu/bits/c++locale.h:77: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
/home/jmatthei/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux64/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/x86_64-unknown-linux-gnu/bits/c++locale.h:102: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
make: *** [Make/linux64GccDPOpt/autoLayerDriverShrink.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Make/linux64GccDPOpt/autoLayerDriver.o] Error 1
+ wmake libso errorEstimation
/usr/bin/ld: cannot find -lfiniteVolume
collect2: ld returned 1 exit status
make: *** [/home/jmatthei/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt/] Error 1

The part about "uselocale" occurs very often in the output. I think the error is in here, but I do not understand it.

Do I use the wrong version of gcc?

bigphil June 4, 2010 11:14


You need to find the first error that occurs when you ./Allwmake in the src directory,
I notice that the errors you posted contain "cannot find -lfiniteVolume" which suggests that the finiteVolume library was not compiled.

So I would suggest compiling the src bit-by-bit to see where the error is, so if you open the Allwmake script in the src directory (using a text editor of your choice eg emacs), and then copy the first compilation line of the script (it should be "(cd OpenFOAM && wmakeLnInclude . )" ) then paste this line into the terminal and hit return.

If there are no errors then repeat this process with the next line of the script, and so on... until you find where the first error is, then you can post it here and see if I/someone can help.

Hopefully, my explaination wasn't too confusing but basically whilst in the src directory, execute this:
( cd OpenFOAM && wmakeLnInclude . )

then check for errors, then if none execute this:
( cd Pstream && ./Allwmake )

then check for errors, then if none execute this:
wmake libso OSspecific/$WM_OS

and continue this through all the lines of the Allwmake script until you find the error.

Let me know how you get on,
Philip C

flowris June 8, 2010 02:56

1 Attachment(s)
Thank you Phil,

Now I understand how to locate errors better. I ran the lines of src/Allwmake one by one. The first one caused no problems.

When executing the second one ( cd Pstream && ./Allwmake ), I got a long list of output. Then I entered the src/Pstream folder and executed the first line of the src/Pstream/Allwmake file (wmake libso dummy). The output can be found in the attached log.txt file. I do not really understand what it means, but I have the impression that my gcc compiler is the wrong one, though I set it to compilerInstall=openFOAM in the ect/ and etc/settings.csh files.

bigphil June 8, 2010 05:42


I am not sure what the error means or what is causing it, so if anybody else would like to jump in with some suggestions please feel free.

In the meantime flowris, you could check there was definitely no previous errors earlier on in the compilation. Compile line-by-line from the Allwmake script in the 'OpenFOAM-1.5-dev' directory. This will direct you to the ThirdParty directory too, so in the same way as before you should check for any errors as you compile each line.
The reason for your error may be an earlier error, but as I said I am unsure.

Another thing you could try is to set your compiler to the system compiler instead of the OpenFOAM compiler, it might help. This involves commenting/uncommenting the relevant lines in the 'OpenFOAM-1.5-dev/etc/' file, should be about line 113.

Philip C

gwierink June 9, 2010 02:37

Hi Flowris,

It could be that there are some headers missing. What distribution are you using? In Ubuntu, do you have build-essential (and all the dev stuff), or in OpenSUSE, do you have the C/C++ pattern (also the whole dev stuff) installed? Also, you may have to compile gcc, that can help. But of course, depending on whether this is the first error, as Phillip mentioned above ...

flowris June 9, 2010 08:33


Thank for your replies. I am using Ubuntu-10.04 and have build essentail installed. I tried to compile the 1.5-dev that I downloaded from

Now I downloaded a more recent version from http://openfoam-extend.svn.sourcefor...nFOAM-1.5-dev/

I did the same as before, namely cd to src/Pstream and execute
wmake libso dummy

The output was now very short:
+ wmake libso dummy
make: *** No rule to make target `/home/jmatthei/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/error.H', needed by `OPwrite.dep'. Stop.

gwierink June 10, 2010 04:26

Hi Flowris,

Did you clean before running Allwmake again? I.e.


And then open the Allwmake script and follow step by step what is done there, then you usually find the first error.

namCFD February 3, 2011 14:04


I am trying to install OpenFOAM-1.5-dev and I get this error message:

make: Target `application' not remade because of errors.

This error seems to be associated with this message: /usr/bin/ld: cannot find -liberty

I am using Scientific Linux Version 5.4. Can anyone help resolving this error? Thank you for your time.


wyldckat February 3, 2011 17:56

Greetings Nam,

This is one of those really old questions and common issues... "" is a library needed for building OpenFOAM. The package you're looking for that has this library is named "binutils-devel", so use the package manager that comes with your Linux distribution to install it ;)

Or you can try running as root:

yum install binutils-devel
Best regards,

namCFD February 4, 2011 13:11

Thank you, Bruno. I am just about to update my post. Indeed, the mising binutils-dev is the issues.

jko June 6, 2011 08:55

Hey guys,

I had installed OF 1.7 on ubuntu 11.04. It worked fine. Finally I realized that openfoam 1.5-dev is the version I need. I than removed the previous version and tried to install openfoam 1.5-dev following the suggestions in this thread.

This means I already replaced the openmpi 1.2.6 by openmpi 1.3.3.

As soon as I execute the second step phil suggested:

(cd $WM_THIRD_PARTY_DIR && ./Allwmake)

I get the following error message:

lnInclude/wrapper.cpp:137:27: error: declaration of ‘void* memalign(size_t, size_t)’ throws different exceptions
lnInclude/wrapper.cpp:116:27: error: from previous declaration ‘void* memalign(size_t, size_t) throw ()’
make: *** [Make/linuxGccDPOpt/libhoard.o] Fehler 1

Thank you for your help in advance.


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