Curand Problem (newbie)

Hi, I’m a newbie on CUDA and is my first time in this site.

I have a 9800gtx+ with capability 1.1 and I tried to compile the example in Curand_Library.pdf with Host_api and I had this problem

/tmp/tmpxft_00005941_00000000-13_curand_host.o: In function `main':

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0x7f): undefined reference to `curandCreateGenerator'

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0xca): undefined reference to `curandSetPseudoRandomGeneratorSeed'

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0x115): undefined reference to `curandGenerateUniform'

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0x1e5): undefined reference to `curandDestroyGenerator'

collect2: ld returned 1 exit status

Do you what is this problem?

Sorry for my english

Hi, I’m a newbie on CUDA and is my first time in this site.

I have a 9800gtx+ with capability 1.1 and I tried to compile the example in Curand_Library.pdf with Host_api and I had this problem

/tmp/tmpxft_00005941_00000000-13_curand_host.o: In function `main':

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0x7f): undefined reference to `curandCreateGenerator'

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0xca): undefined reference to `curandSetPseudoRandomGeneratorSeed'

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0x115): undefined reference to `curandGenerateUniform'

tmpxft_00005941_00000000-1_curand_host.cudafe1.cpp:(.text+0x1e5): undefined reference to `curandDestroyGenerator'

collect2: ld returned 1 exit status

Do you what is this problem?

Sorry for my english

It seems like a linking problem.
Could you write the compilation command that you are trying to execute?

It seems like a linking problem.
Could you write the compilation command that you are trying to execute?

nvcc -o run curand_host.cu

but this program run with out problem http://llpanorama.wordpress.com/2008/05/21/my-first-cuda-program/

nvcc -o run curand_host.cu

but this program run with out problem http://llpanorama.wordpress.com/2008/05/21/my-first-cuda-program/

You need to add the name of the library you want to link and where it is located on your system.

nvcc -o run curand_host.cu -L/usr/local/cuda/lib64 -lcurand

1 Like

You need to add the name of the library you want to link and where it is located on your system.

nvcc -o run curand_host.cu -L/usr/local/cuda/lib64 -lcurand

1 Like

Thank you very much, do you know what to do with atomic functions, which is the right library?

I compile without -L/usr/local/cuda/lib64 because I have the LD_LIBRARY_PATH environment variable

Thank you very much, do you know what to do with atomic functions, which is the right library?

I compile without -L/usr/local/cuda/lib64 because I have the LD_LIBRARY_PATH environment variable