compile error

Hi Mat,
I’ve just finished installing a Geforce GTX Titan on my Win7 workstation and installed PVF compiler. However, I got errors when I tried to compile the sample from Openacc Manual: Fortran vector addition

I got the following:

Error 1 unresolved external symbol _cudaRegisterFatBinary referenced in function vecaddmod_vecaddgpu vecAdd.obj Error 4 unresolved external symbol cudaConfigureCall referenced in function __pgi_uacc_cuda_launchk libaccnc.lib

I know I must miss something in the project setting, could you please kindly help me out?

Thanks,

J.M.

Hi J.M.

Did you remember to add the OpenACC flag (-acc) to your link so the CUDA libraries are used?

  • Mat

Hi Mat,
I think I did so since the following was done:
Configuration Properties --> Fortran --> Language:
Enable OpenACC Directives: Yes (-acc)

Are you referring to something else?

Thanks,
J.M.[/img]

As long as this is set for the project, not just the file, then yes this is correct.


Are there any other errors besides these two? If it can’t find the CUDA run time library, then I’d double check that you selected “yes” during installation when asked to install the CUDA Toolkit.

  • Mat

Mat, yes, I did select “yes” during the installation.
All output info. is below:

------ Build started: Project: 2ndOpenACC, Configuration: Debug x64 ------
Compiling Project …
Linking…
vecAdd.obj : error LNK2019: unresolved external symbol _cudaRegisterFatBinary referenced in function vecaddmod_vecaddgpu
vecAdd.obj : error LNK2019: unresolved external symbol _cudaRegisterFunction referenced in function vecaddmod_vecaddgpu
vecAdd.obj : error LNK2019: unresolved external symbol _cudaUnregisterFatBinary referenced in function vecaddmod_vecaddgpu
libaccnc.lib(cuda_launchk.obj) : error LNK2019: unresolved external symbol cudaConfigureCall referenced in function __pgi_uacc_cuda_launchk
libaccnc.lib(cuda_launchk.obj) : error LNK2019: unresolved external symbol cudaSetupArgument referenced in function __pgi_uacc_cuda_launchk
libaccnc.lib(cuda_launchk.obj) : error LNK2019: unresolved external symbol cudaLaunch referenced in function __pgi_uacc_cuda_launchk
libaccnc.lib(cuda_init_c.obj) : error LNK2019: unresolved external symbol cudaFree referenced in function __pgi_uacc_cuda_initdev
libaccnc.lib(cuda_init_c.obj) : error LNK2019: unresolved external symbol cudaGetDevice referenced in function __pgi_uacc_cuda_initdev
libcudafor4.lib(pgierror.obj) : error LNK2019: unresolved external symbol cudaGetErrorString referenced in function __pgi_cuda_error_handler
C:\Users\jingsen\Desktop\openACC_VecAdd\x64\Debug\2ndOpenACC.exe : fatal error LNK1120: 9 unresolved externals
2ndOpenACC build failed.
Build log was saved at “file://C:\Users\jingsen\Desktop\openACC_VecAdd\x64\Debug\BuildLog.htm”

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hi JMa,

This error does look like that the CUDA libraries aren’t getting added to the link which occurs when the “-acc” isn’t added to the link. Can you please double check that you added this option to your Project’s properties page not just the source file’s properties page?

Thanks,
Mat