You are not logged in.
I'm trying to compile a massive hunk of software, one small piece of which is libgraphics.so. The build system, based on cmake, is trying to link a static library from lapack to make the libgraphics.so but failing with this:
...
Linking CXX shared library libgraphics.so
/usr/bin/ld: /usr/local/lib/liblapack.a(dgetrf.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/liblapack.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [graphics/libgraphics.so.3.1.0] Error 1
...
Thinking lapack.a somehow wasn't built right, after some fussing I ended up removing the blas, lapack, and atlas libraries and reinstalling them from the AUR atlas-lapack (ver 3.8.3) package. This is where they had come from originally just a few months ago, when I first tried to compile this massive app. Maybe now something in atlas-lapack got fixed? No. Apparently it builds static libraries without -fPIC, or something else is going on to result in this error. I didn't see anything obvious in the PKGBUILD file to change.
Now I'm stuck, out of further ideas to try...
Last edited by darenw (2010-10-06 20:48:40)
Artist/Physicist, Herder of Pixels, Photons and Electrons
Offline
It looks like we need to add:
CFLAGS="$CFLAGS -fPIC"
to the lapack PKGBUILD. File a bug report requesting that.
Offline
I was going to mention in the post that I had set CFLAGS to include -fPIC, but wasn't sure if I really had. Turns out not; I had set CFLAGS, but in a different xterm.
Now it _is_ set, and I'm recompiling...
Artist/Physicist, Herder of Pixels, Photons and Electrons
Offline
Problem solved. CMake was finding a stray old .a file (w/o any .so files with it) in /usr/local/lib while the good new .a and .so files were in /usr/lib. Deleted the old .a, reran cmake. Now make runs fine. -fPIC had nothing to do with the solution.
Artist/Physicist, Herder of Pixels, Photons and Electrons
Offline