← Back to team overview

yade-dev team mailing list archive

compilation with ENABLE_LINSOLV ON

 

Hi devs,

I want to get yade compiled with ENABLE_LINSOLV ON. After some trouble (see attachment) I do not know how to fix this one:

Linking CXX shared library lib/libsupport.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libopenblas.a(dgemm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libopenblas.a: could not read symbols: Bad value

google the problem gave me a hint, that it has to do with static vs. shared libraries. solution should be to add -fPIC to CXX_FLAGS, but if i look into CMakeLists.txt it is already there:

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DYADE_PTR_CAST=static_pointer_cast -DYADE_CAST=static_cast -fPIC")

and

SET(CMAKE_CXX_FLAGS "-DYADE_PTR_CAST=static_pointer_cast -DYADE_CAST=static_cast -Wall -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -s")

So, do you know a workaround for this problem?

christian
#### first try:

compile with ENABLE_LINSOLV ON in CMakeLists.txt:

/home/me/YADE/z-PFV-test1/build/yade/lib/triangulation/FlowBoundingSphere.hpp:169:41: error: FlowBoundingSphereLinSolv.hpp: No such file or directory
/home/me/YADE/z-PFV-test1/trunk/lib/triangulation/PeriodicFlow.hpp:42:35: error: PeriodicFlowLinSolv.hpp: No such file or directory
/home/me/YADE/z-PFV-test1/trunk/lib/triangulation/PeriodicFlow.cpp:650:35: error: PeriodicFlowLinSolv.ipp: No such file or directory


#### second try:

download FlowBoundingSphereLinSolv.*pp and PeriodicFlowLinSolv.*pp from

http://code.google.com/p/waterspheres/source/browse/trunk/trunk/yade/lib/triangulation/?r=173

(latest changes: 11.7.2012)

compile again:

/usr/include/eigen3/Eigen/CholmodSupport:9:23:error:  error: cholmod.h: No such file or directory


#### third try:

me@debian ~/YADE/z-PFV-test1/build >aptitude search suitesparse
p   libsuitesparse-dbg
p   libsuitesparse-dev
p   libsuitesparse-doc
i A libsuitesparse-metis-3.1.0
i   libsuitesparse-metis-dev

libsuitesparse-metis must be installed!

root@debian /home/me/ >find / -name cholmod.h
/usr/include/suitesparse/cholmod.h

aaah, there it is!

editing line 9 in /usr/include/eigen3/Eigen/CholmodSupport:
extern "C" {
-  #include <cholmod.h>
+  #include <suitesparse/cholmod.h>
}

compile again:

/usr/bin/ld: cannot find -lopenblas


#### fourth try:

me@debian ~/YADE/z-PFV-test1/build >aptitude search libblas
v   libblas-3gf.so
i A libblas-dev
p   libblas-doc
p   libblas-test
v   libblas.so.3gf
i A libblas3gf

root@debian /home/me >find / -name libblas*      
/etc/alternatives/libblas.so
/etc/alternatives/libblas.a
/etc/alternatives/libblas.so.3gf
/var/lib/dpkg/alternatives/libblas.so
/var/lib/dpkg/alternatives/libblas.so.3gf
...
/usr/lib/libblas.so
/usr/lib/atlas-base/atlas/libblas.so.3gf.0
/usr/lib/atlas-base/atlas/libblas.so.3gf
/usr/lib/libblas
/usr/lib/libblas/libblas.so
/usr/lib/libblas/libblas.so.3gf.0
/usr/lib/libblas/libblas.a
/usr/lib/libblas/libblas.so.3gf
/usr/lib/libblas.a
/usr/lib/libblas.so.3gf

solution:

root@debian /usr/lib >ln -s libblas/libblas.a libopenblas.a

compile again:

Linking CXX shared library lib/libsupport.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libopenblas.a(dgemm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC                  
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libopenblas.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/libsupport.so] Error 1

*damn*


#### fifth try:

export CC=”gcc -fPIC”
export CXX=”g++ -fPIC”
make clean
make

-> not working ...

Follow ups