I have written a cuda fortran code, and I compiled it using pgfortran after loading the module pgi/19.9. It works properly. Within the same code, I am trying to implement a random number generator using curand_device module. However, with the compilation command “pgfortran code.cuf -o code.exe” I obtain the following error message:
nvlink error : Undefined reference to ‘__pgicudalib_curandNormalDoubleXORWOW’ in ‘/tmp/pgfortran8xKg0hmN7pVX.o’
nvlink error : Undefined reference to ‘__pgicudalib_curandInitXORWOW’ in ‘/tmp/pgfortran8xKg0hmN7pVX.o’
pgacclnk: child process exit status 2: /gpfs0/sys/UserApps/PGI/pgi/linux86-64-llvm/19.9/bin/pgnvd
Using the compilation command “pgfortran code.cuf -o code.exe -Mnollvm” I get similar error. But with the command “pgfortran code.cuf -o code.exe -Mcuda=nollvm” I get the following error:
/tmp/pgacc53UgR_A3c8ar.gpu(9): error: too many initializer values
1 error detected in the compilation of “/tmp/pgnvd85Ug0VV6bjLU.ii”.
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (gpu_code.cuf: 1)
PGF90/x86-64 Linux 19.9-0: compilation aborted
Could you help me to get rid of this issue. Please be informed that if I write a separate random-number-generator-only code using curand_device, it works properly with the last command (i.e., with -Mcuda=nollvm).