Chapter 8.2 : La compilation

Comme toujours, on créer un dossier build, dans notre projet, puis on va dedans :

1
2
mkdir build
cd build


On appelle cmake :

cmake ..
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Use nvc++ compiler at /opt/nvidia/hpc_sdk/Linux_x86_64/22.11/compilers/bin/nvc++
-- Configuring done
-- Generating done
-- Build files have been written to: XXX/CURANDReduce/build


Note : si vous n'avez pas d'autre compilateurs que nvc++, vous pouver appeler directement cmake .. -DCMAKE_CXX_COMPILER=${NVCPP}


On appelle make :

1
2
3
[ 50%] Building CXX object CMakeFiles/test_curand_reduce.dir/main.cpp.o
[100%] Linking CXX executable test_curand_reduce
[100%] Built target test_curand_reduce