I recently upgraded my machine to Ubuntu 10.04 64bit and ran into a problem during the installation process of ROOT. While compiling / linking the MathMore library, I get the following error:
/usr/bin/ld: /usr/lib64/libgslcblas.a(sgemm.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/libgslcblas.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [lib/libMathMore.so] Error 1
I saw some related issues on this board, however the only solution seemed to be to recompile the dependency library with -fPIC (as noted in the error message). Since this is a system library, I guess this would mean to get the source package and build it from scratch.
Is there an easier way around this besides disabling MathMore? Or will this even be “fixed” in a future patch?
Hi,
this is what we see on our Ubuntu 10.04 machine:
Checking for gsl/gsl_version.h … /usr/include
Checking for GSL version >= 1.8 … ok
Checking for libgsl, gslML, or gsl … /usr/lib64
Checking for libgslcblas, gslcblasML, gslcblas, or cblas … /usr/lib64
Checking whether /usr/lib64/libgsl.a is compiled with -fPIC … yes
Checking whether /usr/lib64/libgslcblas.a is compiled with -fPIC … no
Checking for shared library versions using gsl-config … yes
Checking whether to build libMathMore … yes
and the library libMathMore.so gets created correctly. See this page for the pre-requisites:
Checking for gsl/gsl_version.h … /usr/include
Checking for GSL version >= 1.8 … ok
Checking for libgsl, gslML, or gsl … /usr/lib64
Checking for libgslcblas, gslcblasML, gslcblas, or cblas … /usr/lib64
Checking whether /usr/lib64/libgsl.a is compiled with -fPIC … yes
Checking whether /usr/lib64/libgslcblas.a is compiled with -fPIC … yes
Checking whether to build libMathMore … yes
However building of library fails:
/usr/bin/ld: /usr/lib64/libgslcblas.a(sgemm.o): relocation R_X86_64_32 against
`.rodata.str1.1’ can not be used when making a shared object; recompile with -f
PIC
/usr/lib64/libgslcblas.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
The libgsl0-dev version is:
dpkg -s libgsl0-dev
…
Version: 1.13+dfsg-1
The exact version of Ubuntu is:
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION=“Ubuntu 10.04.1 LTS”
The library builds ok with root v5.27/06b; I updated configure in v5.26/00e according to that in v5.27/06b and the library linked ok also in v5.26/00e. I attach a file with my modifications.
sorry for the delay in investigating this. The issue in 5.26.00e is due to incorrect PIC testing code in configure which has in the meanwhile been fixed in 5.27. The latest version works fine. Please try the trunk.
As I wrote in my previous post, the library built ok with root v5.27/06b; so I managed to update the configure script in v5.26/00e and to build the library also with this Root version. I did not want to move to the Root trunk as this Root installation will be provided on all Linux machines at IPN and so we need to stay with the tagged versions only.