While trying to use the Nvmex script. I can get most of my CUDA code compiled fine. However I think that for some reason the NVMEX script cannot see the libcutil.a which is located in the $SDK/lib/ Due to this I cannot use cutCreateTimer() and the associated timer functions.
This is only restricted to the createTimer functions and at run time when I get the message undefined symbol: cutCreateTimer.
I modified the make file to add a path to libcutil.a as seen below and the Makefile already has the fPIC switch present. I noticed that the libraries located in $CUDAHOME like libcufft and so on are in a form like *.so.1 and so on. Are they linked by a different method?
I get a error as below when I make the Makefile point at the libcutil file (as shown below)
usr/bin/ld: /home/pmistry/NVIDIA_CUDA_SDK/lib/libcutil.a(cutil.cpp_o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/pmistry/NVIDIA_CUDA_SDK/lib/libcutil.a: could not read symbols: Bad value
I have also tried copying libcutil.a to the location where cufft and the other libraries are.
I have pasted the relevant part of the Makefile as well
# Define installation location for CUDA and compilation flags compatible # with the CUDA include files. CUDAHOME = /usr/local/cuda INCLUDEDIR = -I$(CUDAHOME)/include INCLUDELIB = -L$(CUDAHOME)/lib -lcuda -lcufft -lcublas -lcudart -Wl,-rpath,$(CUDAHOME)/lib,/home/pmistry/NVIDIA_CUDA_SDK/lib/libcutil.a CFLAGS = -fPIC -D_GNU_SOURCE -pthread -fexceptions -Wall COPTIMFLAGS = -O3 -funroll-loops -msse2 # Define installation location for MATLAB. export MATLAB = /usr/local/matlab #export MATLAB = /Applications/MATLAB_R2007b MEX = $(MATLAB)/bin/mex MEXEXT = .$(shell $(MATLAB)/bin/mexext) # nvmex is a modified mex script that knows how to handle CUDA .cu files. NVMEX = .././nvmex
I would appreciate it if some one tells me what to do to libcutil.a so that I can add cutil.h and get it to work with NVMex