3.2.3 : La compilation
Comme toujours, on créé un dossier build, et on va dedans :mkdir build cd build
Appellons CMake :
cmake .. -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA: /usr/local/cuda (found version "11.2") -- Found headers CUDA : /usr/local/cuda/include -- Found lib CUDA : /usr/local/cuda/lib64/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so -- Configuring done -- Generating done -- Build files have been written to: XXX/TestCudaCapabilities/build
Puis Make :
1 2 3 4 |
Scanning dependencies of target test_cuda_capabilities [ 50%] Building CXX object CMakeFiles/test_cuda_capabilities.dir/main.cpp.o [100%] Linking CXX executable test_cuda_capabilities [100%] Built target test_cuda_capabilities |
Et voilà.