From 959f9f2f972027f71b06fbc1945d55334e3dca90 Mon Sep 17 00:00:00 2001 From: kerautret Date: Fri, 21 Feb 2025 00:04:56 +0100 Subject: [PATCH 1/6] add CPP17 min required --- CMakeLists.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37cf267..072810f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,11 +18,24 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) message(STATUS "DGtal found.") + # ----------------------------------------------------------------------------- - # CPP11 + # CPP17 # ----------------------------------------------------------------------------- - set (CMAKE_CXX_STANDARD 11) - set (CMAKE_CXX_STANDARD_REQUIRED TRUE) +set(CDCVAM_MIN_REQUIRED 17) + if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD ${CDCVAM_MIN_REQUIRED}) + else() + # Throw if CMAKE_CXX_STANDARD is 98 + if(${CMAKE_CXX_STANDARD} EQUAL 98) + message(FATAL_ERROR "CMAKE_CXX_STANDARD is set to ${CMAKE_CXX_STANDARD}, " + "but DGtalTools requires at least ${CDCVAM_MIN_REQUIRED}.") + endif() +endif() +if(NOT CMAKE_CXX_STANDARD_REQUIRED) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + From 1ee71f5a7864f7cf18a825fd0348aa6ac2b1102f Mon Sep 17 00:00:00 2001 From: kerautret Date: Fri, 21 Feb 2025 14:38:35 +0100 Subject: [PATCH 2/6] changelog --- Changelog.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 8ea9d4a..511cf41 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ + + # Version 1.2 + - Fix comilation issue adding requirement of CPP17. + (Bertrand Kerautret [#28](https://github.com/kerautret/CDCVAM/pull/28)) - Add windows compilation in github action (Bertrand Kerautret [#33](https://github.com/kerautret/CDCVAM/pull/33)) - Add confidence score extraction from origins. @@ -8,10 +12,11 @@ (Bertrand Kerautret [#30](https://github.com/kerautret/CDCVAM/pull/30)) - Fix comilation issue of displayAccuMesh. (Bertrand Kerautret [#28](https://github.com/kerautret/CDCVAM/pull/28)) - - Remove travis and add github actions. (Bertrand Kerautret [#29](https://github.com/kerautret/CDCVAM/pull/29)) + + # Version 1.1 - Fix cmake issue with boost From e97bf186b67287380973a784d1f321ccea91a60d Mon Sep 17 00:00:00 2001 From: kerautret Date: Fri, 21 Feb 2025 14:46:57 +0100 Subject: [PATCH 3/6] CI compile fix --- .github/workflows/build.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5457792..56f4f08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ env: BUILD_TYPE: Release CONFIG_GLOBAL: CONFIG_LINUX: - CONFIG_WINDOWS: -DWITH_OPENMP=true -DENABLE_CONAN=true + CONFIG_WINDOWS: -DWITH_OPENMP=true jobs: @@ -38,24 +38,22 @@ jobs: - name: Install macOS deps if: matrix.os == 'macOS-latest' run: brew install boost ninja eigen gmp - - name: Install conan if: matrix.os == 'windows-latest' id: conan uses: turtlebrowser/get-conan@main with: - version: 1.57.0 - - - name: Create conan default profile - if: matrix.os == 'windows-latest' - run: conan profile new default --detect - - - uses: actions/cache@v3 + version: 2.4.0 + - name: Create conan default profile if: matrix.os == 'windows-latest' - with: - path: ~/.conan - key: ${{ runner.os }}-conan-Release + run: | + conan profile detect --force + - uses: actions/cache@v4 + if: matrix.os == 'windows-latest' + with: + path: ~/.conan2 + key: ${{ runner.os }}-conan2-Release - name: Create Build Environment @@ -95,17 +93,18 @@ jobs: cd DGtal mkdir buildDGtal cd buildDGtal - echo cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CONFIG_WINDOWS -DBUILD_EXAMPLES=false -DBUILD_TESTING=false - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CONFIG_WINDOWS -DBUILD_EXAMPLES=false -DBUILD_TESTING=false + echo cmake .. -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CONFIG_WINDOWS -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DBUILD_EXAMPLES=false -DBUILD_TESTING=false + cmake .. -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CONFIG_WINDOWS -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DBUILD_EXAMPLES=false -DBUILD_TESTING=false cmake --build . --config Release --parallel 3 - + - name: Configure CMake (windows) if: matrix.os == 'windows-latest' shell: bash working-directory: "${{runner.workspace}}/build" run: | - ls -la D:/a/CDCVAM/build/DGtal/buildDGtal - cmake $GITHUB_WORKSPACE -DCMAKE_MODULE_PATH="D:/a/CDCVAM/build/DGtal/buildDGtal" -DDGtal_DIR="D:/a/CDCVAM/build/DGtal/buildDGtal" -DCMAKE_BUILD_TYPE=$BUILD_TYPE + conan install $GITHUB_WORKSPACE --build=missing + cmake $GITHUB_WORKSPACE -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MODULE_PATH="D:/a/CDCVAM/build/DGtal/buildDGtal" -DDGtal_DIR="D:/a/CDCVAM/build/DGtal/buildDGtal" -DCMAKE_BUILD_TYPE=$BUILD_TYPE + From d6a1ad64b2f340acdbae311729a4cce4d7b32eb8 Mon Sep 17 00:00:00 2001 From: kerautret Date: Fri, 21 Feb 2025 14:54:00 +0100 Subject: [PATCH 4/6] CI compile fix --- .github/workflows/build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56f4f08..61d3a9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,6 @@ jobs: os: [ubuntu-latest, macOS-latest,windows-latest] steps: - - uses: actions/checkout@v2 with: fetch-depth: 10 @@ -44,16 +43,16 @@ jobs: uses: turtlebrowser/get-conan@main with: version: 2.4.0 - - name: Create conan default profile + - name: Create conan default profile if: matrix.os == 'windows-latest' run: | conan profile detect --force - - uses: actions/cache@v4 - if: matrix.os == 'windows-latest' - with: - path: ~/.conan2 - key: ${{ runner.os }}-conan2-Release + - uses: actions/cache@v4 + if: matrix.os == 'windows-latest' + with: + path: ~/.conan2 + key: ${{ runner.os }}-conan2-Release - name: Create Build Environment From e37ffed8727f0ed7a18e03593374d723fc35a414 Mon Sep 17 00:00:00 2001 From: kerautret Date: Fri, 21 Feb 2025 14:58:08 +0100 Subject: [PATCH 5/6] add conan file --- conanfile.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 conanfile.txt diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..7a96e48 --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,14 @@ +[requires] +fmt/9.1.0 +zlib/1.2.13 +boost/1.81.0 +gmp/6.3.0 +fftw/3.3.9 + +[generators] +CMakeDeps +CMakeToolchain + +[options] +boost*:header_only=True +gmp*:enable_cxx=True From 4c8f4d6a3a8ad7e4bc8a9c0a80fddff1821e14ba Mon Sep 17 00:00:00 2001 From: kerautret Date: Fri, 21 Feb 2025 15:06:12 +0100 Subject: [PATCH 6/6] CI: fix DGtal conan conf compile --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61d3a9e..598d2f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,9 +90,10 @@ jobs: run: | git clone --depth 1 https://github.com/DGtal-team/DGtal.git cd DGtal + conan install . --build=missing mkdir buildDGtal cd buildDGtal - echo cmake .. -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CONFIG_WINDOWS -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DBUILD_EXAMPLES=false -DBUILD_TESTING=false + echo cmake .. -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CONFIG_WINDOWS -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DBUILD_EXAMPLES=false -DBUILD_TESTING=false cmake .. -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CONFIG_WINDOWS -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DBUILD_EXAMPLES=false -DBUILD_TESTING=false cmake --build . --config Release --parallel 3