CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OF 2.3.x libconformalVoronoiMesh Compilation Error (https://www.cfd-online.com/Forums/openfoam-installation/137436-2-3-x-libconformalvoronoimesh-compilation-error.html)

GRAUPS June 16, 2014 17:58

OF 2.3.x libconformalVoronoiMesh Compilation Error
 
Foamers,

I'm attempting to compile OF 2.3.x (ddafa9836ad9) on RHEL 5.7 using GCC 4.9.0. Everything compiles fine except for a small portion of foamyHexMesh (the app that I wanted to test). I receive the following error...

Code:

/home/brock/my_apps/binutils-2.24/bin/ld: /usr/lib/../lib64/libmpfr.a(clear.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/lib/../lib64/libmpfr.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
/apps/OpenFOAM/OpenFOAM-2.3.x/wmake/Makefile:172: recipe for target '/apps/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libconformalVoronoiMesh.so' failed
make[2]: *** [/apps/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libconformalVoronoiMesh.so] Error 1
make[2]: Target 'libso' not remade because of errors.

...which ultimately causes foamyHexMesh to fail to compile.

The error notes to add -fPIC and recompile, however I have been unable to correctly identify where that needs to be added. Can anyone help me diagnose and fix this error?

Thanks!

Brock

GRAUPS June 18, 2014 11:41

Figured it out
 
Foamers,

I figured it out. I compiled CGAL with mpfr and gmp libraries that I placed in...

Code:

ThirdParty-2.3.x/platforms/linux64
...this is where CGAL looks for them during compile time. However, the OF compiler apparently isn't smart enough to look there when linking CGAL with foamyHexMesh.

I ended up having to put the mpfr and gmp libraries I used to compile CGAL into $FOAM_SITE_LIBBIN so that they would get used instead of the system versions of mpfr and gmp.

Cheers,

Brock

andyru July 15, 2014 06:02

alternatevly give wmake libso correct path
 
Hi,

I encountered the same problem:

Code:

...
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libCGAL.so.10, needed by
/mnt/fs2/home/bla/OpenFOAM23_susi12_3/OpenFOAM-2.3.x/platforms/linux64GccDPDebug/lib/libconformalVoronoiMesh.so,
not found (try using -rpath or -rpath-link)
...

so just edit in $WM_PROJECT_DIR/applications/utilities/mesh/generation/foamyHexMesh/Make/options

Code:

...
-lsampling \
-L$(WM_THIRD_PARTY_DIR)/platforms/linux64Gcc/CGAL-4.3/lib \
-lCGAL

Then, wmake libso should do the job.


All times are GMT -4. The time now is 15:41.