Undefined reference to cuda functions within libmagma

Open discussion for MAGMA

Undefined reference to cuda functions within libmagma

Postby Matt Phillips » Mon Sep 09, 2013 10:40 pm

When I try to run a program that uses magma, I get errors like this

/home/matt/Libraries/magma/magma-1.4.0/lib/libmagma.a(sgemm_fermi.cu_o):-1: In function `__device_stub__Z23fermiSgemm_v2_kernel_NNPfPKfS1_iiiiiiffii(float*, float const*, float const*, int, int, int, int, int, int, float, float, int, int)':
tmpxft_000063d9_00000000-6_sgemm_fermi.compute_30.cudafe1.cpp:-1: error: undefined reference to `cudaSetupArgument'


So, my test program does not call this function, it just uses magma_s[sg]etmatrix and magmablas_sgemm, but the compilation results in this error. I link to cuda libs as well as magma; my invocation of magmablas_sgemm itself doesn't produce an error. Obviously something is wrong with my environment but I can't figure out what it is. The magma test programs compile and run. I've spent a few hours working through the Makefile but I can't figure out what's going on. My compiler call is

g++ -Wl,-rpath,/home/matt/Qt5.1.1/5.1.1/gcc_64 -Wl,-rpath,/home/matt/Qt5.1.1/5.1.1/gcc_64/lib -o Test-magma main.o -L/usr/local/cuda-5.5/lib64 -lcuda -lcublas -lcudart /home/matt/Libraries/magma/libmagma.a <paths-to-other-libs>

I'm doing this within QtCreator but I get the same thing when I run it from the command line. Please help!
Matt Phillips
 
Posts: 8
Joined: Sat Feb 23, 2013 11:01 am

Re: Undefined reference to cuda functions within libmagma

Postby Matt Phillips » Mon Sep 09, 2013 11:17 pm

Figured it out, the libraries were getting called in the wrong order! For future reference--getting the gcc invocation for a specific testing function can be done using the 'touch' command, that's what I did to finally pull out how MAGMA was building the examples.
Matt Phillips
 
Posts: 8
Joined: Sat Feb 23, 2013 11:01 am


Return to User discussion

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest