CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   /usr/bin/ld: cannot find -llagrangianTurbulence /usr/bin/ld: cannot find -lfluidTherm (https://www.cfd-online.com/Forums/openfoam-programming-development/162594-usr-bin-ld-cannot-find-llagrangianturbulence-usr-bin-ld-cannot-find-lfluidtherm.html)

Luiggito November 13, 2015 17:22

/usr/bin/ld: cannot find -llagrangianTurbulence /usr/bin/ld: cannot find -lfluidTherm
 
Hi,

When I try to compile my solver with wmake the next error appears:

/usr/bin/ld: cannot find -llagrangianTurbulence
/usr/bin/ld: cannot find -lfluidThermophysicalModels

Do somebody knows where can these libraries be found?

Thank you.

alexeym November 14, 2015 10:06

Hi,

They should be in $FOAM_LIBBIN (the value depends on where OpenFOAM is installed, what compiler/OS you are using) folder.

Democritus March 30, 2016 08:48

Hi~

Would you please tell me how to add this path to the system's default compile search path? I have a prompted error:
Quote:

/usr/bin/ld: cannot find -lfiniteVolume
/usr/bin/ld: cannot find -lmeshTools
It seems that the wmake do not search these libs in $FOAM_LIBBIN, so how to indicate the wmake to search libs in $FOAM_LIBBIN path?

Thank you!

floquation March 30, 2016 09:18

Quote:

Originally Posted by Democritus (Post 592405)
Would you please tell me how to add this path to the system's default compile search path?

(On Unix systems) The system variable "$LD_LIBRARY_PATH" is used for that.

Code:

LD_LIBRARY_PATH=$FOAM_LIBBIN:$LD_LIBRARY_PATH
This should however be done automatically if you source OpenFOAM's bashrc file, through the config/settings.sh script.

Democritus March 30, 2016 09:38

Thank you very much for your response!:)

I have checked the my ~/.bashrc , the last line was
Quote:

. /opt/openfoam30/etc/bashrc
Then I changed it to
Quote:

source /opt/openfoam30/etc/bashrc
But I have the same error. I will try to restart my PC then recheck this problem.
I will also update the situation.

Thank you very much for your help!

Democritus March 30, 2016 09:49

Quick Update~

I still have these prompted error
Quote:

/usr/bin/ld: cannot find -lfiniteVolume
/usr/bin/ld: cannot find -lmeshTools
collect2: error: ld returned 1 exit status
/opt/openfoam30/wmake/Makefile:147: recipe for target 'a.out' failed
make: *** [a.out] Error 1

floquation March 30, 2016 10:12

Firstly, what operating system are you using? As I must mention that my knowledge resides within Linux.

---
Can you post the output of the following command:
Code:

echo -e ${LD_LIBRARY_PATH//:/\\n} && echo "" && echo "$FOAM_LIBBIN"
This will print two environmental variables (in a nice format) to the terminal.
If correct, the very last line shown (i.e. $FOAM_LIBBIN) should be contained within the printed list (i.e. $LD_LIBRARY_PATH).

---
Also make sure that $FOAM_LIBBIN actually has the libraries you need. You can test this using:
Code:

find $FOAM_LIBBIN -iname "*finitevolume*"
find $FOAM_LIBBIN -iname "*meshtools*"

Does this give a result that looks something like?:
Quote:

/opt/.../lib/libfiniteVolume.so
(And similar for meshTools.)

Democritus March 30, 2016 21:28

Thank you very much! As a starter of Linux, your advice and thoughts about the problem shed light on the knowledge that I should learn~:)

The OS I am using is ubuntu 15.10; Basing on your suggestion, the first thing I check is the real path of my $FOAM_LIBBIN, I check it as following
Quote:

hxq@hxq-All-Series:~$ cd $FOAM_LIBBIN
hxq@hxq-All-Series:/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib$

meaning: $FOAM_LIBBIN = /opt/openfoam30/platforms/linux64GccDPInt32Opt/lib
then I typed the first command and get following results:
Quote:

hxq@hxq-All-Series:~$ echo -e ${LD_LIBRARY_PATH//:/\\n} && echo "" && echo "$FOAM_LIBBIN"
/opt/ThirdParty-3.0.1/platforms/linux64Gcc/gperftools-svn/lib
/opt/paraviewopenfoam44/lib/paraview-4.4
/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib/openmpi-system
/opt/ThirdParty-3.0.1/platforms/linux64GccDPInt32Opt/lib/openmpi-system
/usr/lib/openmpi/lib
/home/hxq/OpenFOAM/hxq-3.0.1/platforms/linux64GccDPInt32Opt/lib
/opt/site/3.0.1/platforms/linux64GccDPInt32Opt/lib
/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib
/opt/ThirdParty-3.0.1/platforms/linux64GccDPInt32Opt/lib
/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib/dummy

/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib


I think that means the path is properly set.

Then I try to search the finiteVolume and meshTools lib in this path, I get:
Quote:

hxq@hxq-All-Series:~$ find $FOAM_LIBBIN -iname "*finitevolume*"
/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
hxq@hxq-All-Series:~$ find $FOAM_LIBBIN -iname "*meshTools*"
/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so
The lib files are in the right path and the path is properly set!:confused:
I am really confused. Should I reinstall the OpenFOAM as the tricks of Windows?
Thank you!

Democritus March 30, 2016 21:56

Quick Update!

The problem is solved! I have made a very very stupid mistake!
In my project's Make/files, once it was like these:eek::(
Quote:

helmholtzFoam_Hxq.C

EXE = .
Then I change it to
Quote:

helmholtzFoam_Hxq.C

EXE = ~/myCode/helmholtzFoam_Hxq/helmholtzFoam_Hxq
Then the compile process goes well!
Thank you floquation, for your precious time and advice on my problem!

Zhiheng Wang May 2, 2016 00:54

/usr/bin/ld:
 
Quote:

Originally Posted by Democritus (Post 592424)
Quick Update~

I still have these prompted error

Hi,
You can also modify your make file LIB as -I($LSRC)/finiteVolume/lnInclude \
some time LD_LIBRARY_PATH needs to be fixed every time.


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