PLAESE help me!!
That’s a minimal situation but I actually have to merge a BIG program written in C
with a tiny extension of CUDA program calling a single Cuda function from the C source.
[codebox]$ ll
total 148K
-rw-r–r–. 1 **** **** 81 2010-06-08 22:00 func.cu
-rw-r–r–. 1 **** **** 18 2010-06-08 21:58 func.h
-rw-r–r–. 1 **** **** 130K 2010-06-08 22:00 func.o <<<compiled with NVCC
-rw-r–r–. 1 **** **** 91 2010-06-08 21:58 main.c
-rw-r–r–. 1 **** **** 1.4K 2010-06-08 22:01 main.o <<< compiled with GCC
[/codebox]
[codebox]$ gcc -o prog *.o -lcuda -L/usr/local/cuda/lib -L/home/binde/NVIDIA_CUDA_SDK/lib
func.o: In function `__cudaUnregisterBinaryUtil()':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0xf): undefined reference to `__cudaUnregisterFatBinary’
func.o: In function `__threadfence()':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4458): undefined reference to `__cudaSynchronizeThreads’
func.o: In function `__threadfence_block()':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4486): undefined reference to `__cudaSynchronizeThreads’
func.o: In function `__iAtomicAdd(int*, int)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4b1b): undefined reference to `__cudaMutexOperation’
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4b3c): undefined reference to `__cudaMutexOperation’
func.o: In function `__uAtomicAdd(unsigned int*, unsigned int)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4b5a): undefined reference to `__cudaMutexOperation’
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4b7b): undefined reference to `__cudaMutexOperation’
func.o: In function `__iAtomicExch(int*, int)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4b99): undefined reference to `__cudaMutexOperation’
func.o:tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x4bb5): more undefined references to `__cudaMutexOperation’ follow
func.o: In function `__threadfence_system()':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x72f1): undefined reference to `__cudaSynchronizeThreads’
func.o: In function `__itexfetchi(void const*, int4)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x8048): undefined reference to `__cudaTextureFetch’
func.o: In function `__utexfetchi(void const*, int4)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x80a1): undefined reference to `__cudaTextureFetch’
func.o: In function `__ftexfetchi(void const*, int4)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x80fa): undefined reference to `__cudaTextureFetch’
func.o: In function `__itexfetch(void const*, float4, int)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x816c): undefined reference to `__cudaTextureFetch’
func.o: In function `__utexfetch(void const*, float4, int)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x81cc): undefined reference to `__cudaTextureFetch’
func.o:tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0x822c): more undefined references to `__cudaTextureFetch’ follow
func.o: In function `__sti____cudaRegisterAll_39_tmpxft_0000080c_00000000_4_f
unc_cpp1_ii_b81a68a1()':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0xfb05): undefined reference to `__cudaRegisterFatBinary’
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text+0xfb66): undefined reference to `__cudaRegisterFunction’
func.o: In function `cudaError cudaLaunch(char*)':
tmpxft_0000080c_00000000-1_func.cudafe1.cpp:(.text.Z10cudaLaunchIcE9cudaErrorPT[cud
aError cudaLaunch(char*)]+0x14): undefined reference to `cudaLaunch’
func.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0’
main.o: In function `main’:
main.c:(.text+0x5): undefined reference to `func’
collect2: ld returned 1 exit status
[/codebox]
Thank’s