Installation problem with MathMore on Ubuntu 10.04

Hi there,

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?

Kindest regards,
Michael

I am afraid that there is nothing to fix on our side. On 64 bit machines archive libraries must be compiled with -fPIC.

Rene

Alright…since this library was installed via the package manager, I guess one should hope for fix from their end.

Thank you very much!
Michael

Just for your information, if anyone else should have problems with this. I found a conversation on a Debian bug tracker about this:

bugs.debian.org/cgi-bin/bugreport.cgi?bug=579404

I thought, this might be of some help.

Kindest regards,
Michael

Hi,

Was the problem solved? I am getting exactly the same error on Ubuntu 10.04 with Root v5.26/00e.

Thank you,

Ivana

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:

root.cern.ch/drupal/content/build-prerequisites

Cheers, Fons.

Hi Fons,

I see exactly the same when running configure:

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”

Have you tested the same versions of Ubuntu/gsl ?

Thanks,

Hi Ivana,

it is not completely the same, see:

Checking whether /usr/lib64/libgslcblas.a is compiled with -fPIC … yes

while in my case it is “no” in which case configure falls back trying to link with the gslcblas.so by calling gls-config:

Checking for shared library versions using gsl-config … yes

I’ve exactly the same version of Ubuntu 10.04.1 LTS and libgsl0-dev.

So why does:

check_libpic $gslalib

return true on your system and not on mine? Can you see what is says in config.log and otherwise put

set -x

as first statement in check_libpic and

set +x

as last statement. Mail me the result.

Cheers, Fons.

Hi Fons,

Indeed, I’ve overlooked that difference.
Find attached the output from configure with added set -x and config.log.

Thanks,
logs.tgz (21.2 KB)

Hi again,

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.

Cheers,
patch.txt.gz (593 Bytes)

Hi Ivana,

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.

Cheers, Fons.

Hi Fons,

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.

Thank you,