Cholmod.a error

View: New views
3 Messages — Rating Filter:   Alert me  

Cholmod.a error

by Yan Wu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.
  I am compiling Octave 3.0 on Opteron. I have included Suitesparse in the compilation with the following flags:
  --enable-shared CPPFLAGS='-I/scratch/octave/include -I/scratch/octave/include/suitesparse' LDFLAGS='-L/scratch/octave/lib' --with-blas='-L/scratch/octave/lib -lgoto -lpthread'
  However, the following error was generated during make:
/usr/bin/ld: /scratch/octave/lib/libcholmod.a(cholmod_common.o): relocation R_X86_64_32S against `malloc' can not be used when making a shared object; recompile with -fPIC
/scratch/octave/lib/libcholmod.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [liboctave.so] Error 1
make[2]: Leaving directory `/HOME01/WORK/work01/octave/octave-3.0.0/liboctave'
  Does anyone know why?

Thank you,
Yan

Re: Cholmod.a error

by dbateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yan Wu wrote:
Hi.
  I am compiling Octave 3.0 on Opteron. I have included Suitesparse in the compilation with the following flags:
  --enable-shared CPPFLAGS='-I/scratch/octave/include -I/scratch/octave/include/suitesparse' LDFLAGS='-L/scratch/octave/lib' --with-blas='-L/scratch/octave/lib -lgoto -lpthread'
  However, the following error was generated during make:
/usr/bin/ld: /scratch/octave/lib/libcholmod.a(cholmod_common.o): relocation R_X86_64_32S against `malloc' can not be used when making a shared object; recompile with -fPIC
/scratch/octave/lib/libcholmod.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [liboctave.so] Error 1
make[2]: Leaving directory `/HOME01/WORK/work01/octave/octave-3.0.0/liboctave'
  Does anyone know why?

Thank you,
Yan

Perhaps recompile with the -fPIC flag as suggested in the error message.... A static library compile without this can not be linked to a shared object. Or you could go the whole hog and compile suitesparse as a set of shared libraries.

What OS are you building on? There are a number of RPM and DEB releases of suitesparse out there that you might use to get this working. Even if your OS doesn't have suitesparse itself you could still take the source package from another distribution and rebuild it as suitesparse's only dependency is on LAPACK/BLAS that is available basically everywhere.

D.

Re: Cholmod.a error

by Yan Wu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the advice. I just realised that my compiler is gcc 3.4 which is too old to take care of the -fPIC flag when compiling the SuiteSparse. Adding the flag globally in the SuiteSparse made it work.

-Yan