I am attempting to compile a test matlab mex file that calls magma_sgetrf_gpu and magma_sgetrs_gpu. Alas, the compile fails with:
Code: Select all
#$ gcc -D__CUDA_ARCH__=130 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS "-I/usr/local/cuda/bin/../include" "-I/usr/local/cuda/bin/../include/cudart" -I. -fPIC -D_GNU_SOURCE -pthread -fexceptions -m64 -O3 -funroll-loops -msse2 -DNDEBUG -O3 -I"/usr/local/cuda/include" -I"/usr/local/magma_0.2/include" -I"/usr/local/matlab/extern/include" -m64 -o "/tmp/tmpxft_0000449c_00000000-10_gpu_sgesv_magma.ii" "/tmp/tmpxft_0000449c_00000000-1_gpu_sgesv_magma.cudafe1.cpp"
#$ gcc -c -x c++ "-I/usr/local/cuda/bin/../include" "-I/usr/local/cuda/bin/../include/cudart" -I. -fPIC -D_GNU_SOURCE -pthread -fexceptions -m64 -O3 -funroll-loops -msse2 -DNDEBUG -O3 -I"/usr/local/cuda/include" -I"/usr/local/magma_0.2/include" -I"/usr/local/matlab/extern/include" -m64 -o "gpu_sgesv_magma.o" "/tmp/tmpxft_0000449c_00000000-10_gpu_sgesv_magma.ii"
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: /usr/local/magma_0.2/lib/libmagma.a(sgetrf_gpu.o): relocation R_X86_64_32 against `__gxx_personality_v0' can not be used when making a shared object; recompile with -fPIC
/usr/local/magma_0.2/lib/libmagma.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
mex: link of 'gpu_sgesv_magma.mexa64' failed.
I'm using OpenSUSE 11.1
Code: Select all
gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.3 --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)