error compling shared library in version 1.4.0

Open discussion for MAGMA

error compling shared library in version 1.4.0

Postby msiumn » Thu Sep 19, 2013 8:47 pm

We're encountering the following compilation error when running 'make shared' with version 1.4.0 using the make.inc.mkl-icc configuration.

make ./lib/libmagma.so
make[1]: Entering directory `/panfs/roc/itascasoft/src/magma/magma-1.4.0'
======================================== libmagma.so
icc -openmp -shared -o ./lib/libmagma.so \
src/*.o control/*.o \
interface_cuda/*.o magmablas/*.cu_o magmablas/*.o \
-L/soft/intel/x86_64/2013/composer_xe_2013/composer_xe_2013.5.192/mkl/lib/intel64 -L/usr/local/cuda-5.5/lib64 \
-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lcublas -lcudart -lstdc++ -lm
ld: src/cbulge_applyQ.o: relocation R_X86_64_32S against `__$U0' can not be used when making a shared object; recompile with -fPIC
src/cbulge_applyQ.o: could not read symbols: Bad value
make[1]: *** [lib/libmagma.so] Error 1
make[1]: Leaving directory `/panfs/roc/itascasoft/src/magma/magma-1.4.0'
make: *** [shared] Error 2
msiumn
 
Posts: 1
Joined: Thu Sep 19, 2013 8:37 pm

Re: error compling shared library in version 1.4.0

Postby mgates3 » Mon Sep 23, 2013 1:14 pm

As the error suggests, you need to add -fPIC to all the OPTS in make.inc. See differences between make.inc.mkl-icc and make.inc.mkl-shared.
-mark
mgates3
 
Posts: 330
Joined: Fri Jan 06, 2012 2:13 pm

Re: error compling shared library in version 1.4.0

Postby lejeczek » Fri Feb 21, 2014 11:43 am

hello
does this same apply to ACML build?
thanks.
lejeczek
 
Posts: 22
Joined: Tue Apr 09, 2013 2:57 am

Re: error compling shared library in version 1.4.0

Postby lejeczek » Fri Feb 21, 2014 12:11 pm

it fails for me:

======================================== libmagma.so
gcc -fPIC -fopenmp -shared -o ./lib/libmagma.so \
src/*.o control/*.o \
interface_cuda/*.o magmablas/*.cu_o magmablas/*.o \
-L/opt/acml/gfortran64_fma4_mp/lib -L/usr/lib64/atlas -L/usr/local/cuda/lib64 \
-lcblas -lcublas -lcudart -lstdc++ -lm -lacml_mp -lcblas
/usr/bin/ld: magmablas/cauxiliary.cu_o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
magmablas/cauxiliary.cu_o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [lib/libmagma.so] Error 1
make[1]: Leaving directory `/home/pe243/rpmbuild/tar.src/MAGMAlibs/magma-1.4.1/magma-1.4.1.acml'
make: *** [shared] Error 2
lejeczek
 
Posts: 22
Joined: Tue Apr 09, 2013 2:57 am

Re: error compling shared library in version 1.4.0

Postby mgates3 » Fri Feb 21, 2014 5:16 pm

Yes, it applies to any project compiled as a shared library (not just MAGMA). All the .o files must be compiled with -fPIC.
Add -fPIC to OPTS, F77OPTS, FOPTS, NVOPTS, and LDOPTS, as demonstrated in make.inc.mkl-shared.
Then "make clean" and "make shared".
-mark
mgates3
 
Posts: 330
Joined: Fri Jan 06, 2012 2:13 pm

Re: error compling shared library in version 1.4.0

Postby lejeczek » Mon Feb 24, 2014 5:19 am

thank you mgates3
can confirm I missed one -fPIC, now I have

NVOPTS = -O3 -DADD_ -Xcompiler "-fno-strict-aliasing -fPIC"

and it all builds, however, I was hoping I could use magma R package but builds fails, I should put it into a separate post
thanks
lejeczek
 
Posts: 22
Joined: Tue Apr 09, 2013 2:57 am


Return to User discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron