CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Cannot find liberty %3cIMG SRC%3d%22httpopenfoamcfdonlinecomforumcliparthappy gif%22 ALT%3d%22%22 BORDER%3d0%3e (http://www.cfd-online.com/Forums/openfoam-installation/57509-cannot-find-liberty-3cimg-src-3d-22httpopenfoamcfdonlinecomforumcliparthappygif-22-alt-3d-22-22-border-3d0-3e.html)

panara September 14, 2006 03:36

Dear all I have installed O
 
Dear all

I have installed OF 1.3 on a linux Debian AMD64 machine. Everthing works and I can run icoFoam without problems. When I try to compile my own application (icoFoam), it fails in the linking phase:

Making dependency list for source file icoFoam.C

SOURCE_DIR=.
SOURCE=icoFoam.C ; g++ -m64 -DlinuxAMD64 -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-30 -I/apps/prod/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/apps/prod/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -c $SOURCE -o Make/linuxAMD64Gcc4DPOpt/icoFoam.o
/apps/prod/OpenFOAM/OpenFOAM-1.3/wmake/bashScripts/mkObjectDir /data/home/didomax/OpenFOAM/didomax-1.3/applications/bin/linuxAMD64Gcc4DPOpt/ico Foam
g++ -m64 -DlinuxAMD64 -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-30 -I/apps/prod/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/apps/prod/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC Make/linuxAMD64Gcc4DPOpt/icoFoam.o -L/apps/prod/OpenFOAM/OpenFOAM-1.3/lib/linuxAMD64Gcc4DPOpt \
-lfiniteVolume -lOpenFOAM -liberty -o /data/home/didomax/OpenFOAM/didomax-1.3/applications/bin/linuxAMD64Gcc4DPOpt/ico Foam
/usr/bin/ld: cannot find -liberty
collect2: ld returned 1 exit status
make: *** [/data/home/didomax/OpenFOAM/didomax-1.3/applications/bin/linuxAMD64Gcc4DPOpt/ic oFoam] Error 1

When I change in /apps/prod/OpenFOAM/OpenFOAM-1.3/wmake/rules/linuxAMD64Gcc4/general
the following line

GLIBS = -liberty

in

GLIBS = /apps/prod/OpenFOAM/linuxAMD64/gcc-4.1.0/lib/libiberty.a

the compilation has no problem at all.

Any idea?

mattijs September 14, 2006 04:24

That is fine. The supplied gcc
 
That is fine. The supplied gcc installation contains that library.
You can make it a bit more general by specifying $(WM_COMPILER_DIR)/lib/libiberty.a

panara September 14, 2006 04:35

Ok, but gcc-4.1.0 has been i
 
Ok,
but gcc-4.1.0 has been installed and also the correct path has been setted correctly..
why it doesn't work with the old setting?

is that a bug?

I mean, in order to compile OF applications the option must be changed in

GLIBS = $(WM_COMPILER_DIR)/lib/libiberty.a

or there is something wrong just in my installation?

Daniele

lr103476 October 31, 2006 05:05

Hi, On a different machine
 
Hi,

On a different machine than my working one, I ran into the same problem.

Did you solve this liberty problem, and ifso how?

Thanks and regards, Frank

pascalhaeussler November 2, 2006 05:18

Hi, I do not know if this t
 
Hi,

I do not know if this topic is still of interest. I just want to post here how I fixed this problem:

The libiberty is part of the gnu binutils. I just had to install the binutils development files package in addition to the binutils and then everything worked fine.

Regards
Pascal

msrinath80 August 10, 2007 14:39

Thank you Pascal. I faced the
 
Thank you Pascal. I faced the same problem:

/usr/bin/ld: cannot find -liberty
collect2: ld returned 1 exit status

I solved it by installing binutils-devel. My system runs 64 bit Scientific Linux 5.x (RHEL clone).

Once again, thanks very much!


All times are GMT -4. The time now is 09:54.