2

I am searching on how to force CMake to find OpenCL

My CMakeLists.txt looks like this:

find_package(OpenCL REQUIRED)
add_executable(test main.c)
target_link_libraries (test OpenCL::OpenCL)

and before CMake is able to find OpenCL I have to execute

module load CUDA

The server is using https://modules.readthedocs.io/en/latest/module.html

If I run cmake using SSH its all fine, but when I want to do that in CLion its not able to find OpenCL, like CLion would completly ignore module load command.

I also placed this command in ~/.bash_profile which caused ssh connection to always find OpenCL (no need to execute module load CUDA command everytime I log in).

Also looked here: Clion linux environment modules

But no use, CLion is still not able to find OpenCL, so not sure what to do now, can I somehow in CmakeLists.txt manually specify path to OpenCL Libs and include that instead, because I have them in /ceph/grid/home/ss264hg/CUDA/cuda-11.0

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
Alojzehar
  • 21
  • 1

0 Answers0