CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Cannot find -lOpenFOAM in 1.7.x install (

scott July 3, 2010 02:28

Cannot find -lOpenFOAM in 1.7.x install
Hi guys,

I have tried installing this from the source download and when compiling either 1.7.0 or 1.7.x on Linux Mint, TinyMe, OpenSUSE I have had the following error after over an hour of compilation... I've tried this a few times and on different machines.

Anbody know what this means?

Thanks! Scott

make[2]: Entering directory `/home/guest/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
Making dependency list for source file mixtureAdiabaticFlameT.C
make[2]: Leaving directory `/home/guest/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
make[2]: Entering directory `/home/guest/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
SOURCE=mixtureAdiabaticFlameT.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/guest/OpenFOAM/OpenFOAM-1.7.x/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/guest/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/home/guest/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/mixtureAdiabaticFlameT.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/guest/OpenFOAM/OpenFOAM-1.7.x/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/guest/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/home/guest/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/mixtureAdiabaticFlameT.o -L/home/guest/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt \
-lspecie -lOpenFOAM -liberty -ldl -lm -o /home/guest/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/mixtureAdiabaticFlameT
/usr/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make[2]: *** [/home/guest/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/mixtureAdiabaticFlameT] Error 1
make[2]: Leaving directory `/home/guest/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
make[1]: *** [mixtureAdiabaticFlameT] Error 2
make[1]: Target `application' not remade because of errors.
make[1]: Leaving directory `/home/guest/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical'
make: *** [thermophysical] Error 2
make: Target `application' not remade because of errors.

bastil July 3, 2010 05:45


Originally Posted by scott (Post 265562)
/usr/bin/ld: cannot find -lOpenFOAM

There was something wrong when building the library OpenFOAM. There must have been errors earlier during build. Try to pipe the output into a file and look at the first error that occurs. Alternatively, you can compile each library one after another instead of running Allwmake. Then, try to solve the first error that comes up.

Regards Bastian

scott July 5, 2010 02:12

Thanks Bastian.

I started to go through it all but am on a bit of a deadline so just installed the debian/ubuntu version.

Seems to be a common problem though, and not only with OpenFOAM.

Thanks for your help.


bmikuz November 14, 2012 10:29

Hi, sorry for posting on 2 year old questions, but we have just solved the issue with compilng the OpenFOAM 2.1.1 on the SUSE Enterprise Linux 11.2 SP1 x64.
What the error means is, that the -lOpenFOAM is trying to link the, but cannot find it.
When we searched for the libOpenFOAM, we found it in some subdirectory, so we were surprised how the problem occurs.
Then we went on the page (subsection 7 Modifications for the compilation of PVFoamReader) where they nicely pointed out that the problem occured on older versions of OF because of wrong $FOAM_LIBBIN parameter.

When we compared the path of the paramater $FOAM_LIBBIN and the path of the with command

HTML Code:

find ~/OpenFOAM/OpenFOAM-2.1.1 -name "libOpenFOAM*" 2>/dev/null; echo $FOAM_LIBBIN
We saw that $FOAM_LIBBIN was pointing to wrong place. Our output:
HTML Code:


(notice the difference between the linux64GccDPOpt and the linux64Gcc45DPOpt)

When the command wmSET is executed, it defines (and override the FOAM_LIBBIN variable), so we needed to repair it.

Solution is to execute following commands:
  1. wmSET
  2. export FOAM_LIBBIN=/home/r4/user/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/
    (this ^ one needs to point out to the path of the
  3. ./Allwclean
  4. ./Allwmake
Hope it helps.

Best regards

All times are GMT -4. The time now is 06:38.