[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking question [SEC=UNCLASSIFIED]

From: Sergei Steshenko
Subject: Re: linking question [SEC=UNCLASSIFIED]
Date: Wed, 18 Jan 2017 14:25:30 +0000 (UTC)

> From: "DOHERTY, Greg" <address@hidden>
>To: "address@hidden" <address@hidden> 
>Sent: Wednesday, January 18, 2017 5:06 AM
>Subject: linking question [SEC=UNCLASSIFIED]
>I am trying to produce a version of the matlab routine GPSR_BB that octave can 
>call, eventually, on a Jetson board with an nvidia gpu. At the moment I am 
>testing on an x86_64 server.
>I have a working version of GPSR_BB.oct produced with mkoctfile from  a C++ 
>version of GPSR_BB that I translated, which runs well.
>I have edited the C++ version to include the openACC directives required to 
>use the gpu. I also want to be able to call Sgemv from cublas.
>I have a linking problem that you can see below. Any suggestions on how to fix 
>it would be very welcome.
>Greg Doherty
>$ cat Makefile
>CXX1FLAGS=-fast -ta=tesla:lineinfo -Minfo=all,ccff -fPIC -shared -acc -Mcuda
>libgdz.a: gdz.o
>        ${CXX1} ${CXX1FLAGS}  gdz.o  -lcublas_static -o libgdz.a
>        ${CXX1} ${LDFLAGS} -c  > compiler.out 2>&1
>GPSR_BB.oct: libgdz.a
>        $(MKOCT) -g -L/home/gdz/DAVID/BLAS -lgdz -Mcuda -fPIC
>        rm -Rf  GPSR_BB.oct  pgprof* core *.o *.so *.a
>$ make clean
>rm -Rf  GPSR_BB.oct  pgprof* core *.o *.so *.a
>$ make GPSR_BB.oct > ld.out 2>&1
>$ cat ld.out
>pgc++ -fast -ta=tesla:lineinfo -Minfo=all,ccff -fPIC -shared -acc -Mcuda -c 
>  > compiler.out 2>&1
>pgc++ -fast -ta=tesla:lineinfo -Minfo=all,ccff -fPIC -shared -acc -Mcuda  
>gdz.o  -lcublas_static -o libgdz.a
>/usr/bin/ld: /tmp/pgcudaregxXgfvNbp-fw.o: relocation R_X86_64_PC32 against 
>undefined symbol `__pgi_cuda_register_fat_binary' can not be used when making 
>a shared object; recompile with -fPIC
>/usr/bin/ld: final link failed: Bad value
>pgacclnk: child process exit status 1: /usr/bin/ld
>make: *** [libgdz.a] Error 2
>Help-octave mailing list


Your statement: "Any suggestions on how to fix it would be very welcome" <-> 
the linker suggestion: "recompile with -fPIC".

Is there any problem with following the linker suggestion ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]