7.1.1.3 : Le CMakeLists.txt
1 2 |
cmake_minimum_required(VERSION 3.0) project(FullCalibrationBench) |
Pour l'exemple en C++20, le compilateur va appeler TBB (Threading Bounding Block, la bibliothèque de parallélisation d'Intel) pour gérer les exécutions std::execution::par_unseq et std::execution::par si vous n'appelez pas -stdpar=gpu avec nvc++. Si vous l'oubliez, vous aurez une erreur de linkage :
1 2 3 4 5 6 7 8 9 |
if(NOT DEFINED ENV{NVCPP}) find_package(TBB COMPONENTS tbb REQUIRED) endif() add_subdirectory(cmake) phoenix_base_project("FullCalibrationBench" "1.0.0" "Set of calibration performance tests" "") |
On utilise une bibliothèque de benchmark pour faire nos tests plus proprement :
1 2 3 4 5 6 7 |
pull_extra_module("MicroBenchmark" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS/MicroBenchmark.git") include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) add_subdirectory(src) set(PHOENIX_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src;${PHOENIX_INCLUDE_DIRS}" CACHE INTERNAL "list of Phoenix include dirs") |
Le fichier CMakeLists.txt complet :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
cmake_minimum_required(VERSION 3.0) project(FullCalibrationBench) if(NOT DEFINED ENV{NVCPP}) find_package(TBB COMPONENTS tbb REQUIRED) endif() add_subdirectory(cmake) phoenix_base_project("FullCalibrationBench" "1.0.0" "Set of calibration performance tests" "") pull_extra_module("MicroBenchmark" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS/MicroBenchmark.git") include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) add_subdirectory(src) set(PHOENIX_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src;${PHOENIX_INCLUDE_DIRS}" CACHE INTERNAL "list of Phoenix include dirs") |