Hello, I am trying to link the Cublas to another library using CMake however I can’t seem to get it to work. I am consistently getting an error that there is undefined reference to the cublas functions. You can see the code I am using at the base of this post.
Relevant info:
CMAKE --version = 3.10
CUDA --version = 10.2
System =Jetson Nano Developer Kit with the default image
Thanks in advance for any help, have been struggling with this for a few days, if this post would be more suited to another nvidia forum please feel free to move it.
CODE
cmake_minimum_required(VERSION 3.10)
project(CLDL LANGUAGES CUDA CXX )
Thanks for your reply, I have tried this solution previously.
When adding:
${CUDA_CUBLAS_LIBRARIES}
I get an error saying:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_device_LIBRARY (ADVANCED)
linked by target “CLDL” in directory /home/luca/Documents/CLDL-CUDA
I assume this is because it cannot find the cublas library. Just to confirm I am 100% cublas is installed as I have linked it to a project previously in order to test some of the functions, I did this in cmake using the following code (this is one of the subdirectories of the previous cmakelists I posted). I have made the section which links it bold. While this works to link to executables I am required to link Cublas to the library created in the Cmake file (CLDL in this case):