0x0024 - Clion | Cuda | Cmake Bootstrapping

Clion | Cuda | Cmake Bootstrapping

0x0024 - Clion | Cuda | Cmake Bootstrapping

We are trying to get CUDA compilation in the CLion environment. Not being able to find much except multiple guides that inform us to make a new project we build a template project.

Looking for nvcc..

cd /
sudo find . -type f -name "nvcc"

We find it at /usr/local/cuda-11.8/bin/nvcc

We set both the C compiler and the C++ compiler to access the Nvidia nvcc compiler:

Jetbrain products are really good - in this instance it has attempted to compile a simple example program  - and also informs that it is unable to get ABI Info.

Next we check https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html for information on the toolchain.

We can see when we made the new project CMakeLists.txt was built with the following setup:

Next we attempt a command-line compilation, but we notice that nvcc bin directory is not in our path, so we put it in. Once we reboot we are able to at least get a small program to compile with nvcc from the command-line:

Next we go back and double-check the toolchains we install llvm and others:

Now we have this setting:

Next we have to update the CMake to 3.24?

Going over to https://cmake.org/download/ we download 3.25

After that it's pretty guiding - run make

Finally we have cmake 3.25 located inside /usr/local/bin/ but CLion does not find it.

After this we manually modified until we were able to get a working standard as above - but it still was not compiling cuda files.

Linux Rocks Every Day