From ac2a14e885fce5a6d3e1144f8d45137bf84e8383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Wed, 25 Jun 2025 15:31:54 -0700 Subject: [PATCH 01/33] Update runner images --- .github/workflows/continuous.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 435d0fe9..7c1653e1 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-13, macos-14] + os: [ubuntu-24.04, macos-13, macos-15] config: [RelwithDebInfo, Debug] compiler: [gcc, apple, llvm] sanitizer: ["Address", "Thread"] # TODO: Add Memory+Undefined Sanitizer @@ -35,9 +35,9 @@ jobs: sanitizer: Thread - os: macos-13 config: Debug - - os: macos-14 + - os: macos-15 compiler: gcc - - os: ubuntu-22.04 + - os: ubuntu-24.04 compiler: apple steps: - name: Free Disk Space @@ -140,8 +140,8 @@ jobs: #################### Windows: - name: windows-2022 (${{ matrix.config }}) - runs-on: windows-2022 + name: windows-2025 (${{ matrix.config }}) + runs-on: windows-2025 strategy: fail-fast: false matrix: From b79cc2111fe7d96e51a9821a994f771e4cfb9fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Wed, 25 Jun 2025 15:47:20 -0700 Subject: [PATCH 02/33] Update runner images --- .github/workflows/continuous.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 7c1653e1..2ed10f58 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -91,11 +91,17 @@ jobs: fi - name: Setup Xcode version - if: runner.os == 'macOS' + if: matrix.os == 'macos-13' uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: '15.2' + - name: Setup Xcode version + if: matrix.os == 'macos-15' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.4' + - name: Get number of CPU cores uses: SimenB/github-actions-cpu-cores@v1 id: cpu-cores From 456453eb9c49edd0f7fdc2f4cd0c0927ed82f484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Wed, 25 Jun 2025 15:59:13 -0700 Subject: [PATCH 03/33] Update runner images --- .github/workflows/wheel.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 5302ee97..e44be880 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-13, macos-14, windows-2022] + os: [ubuntu-24.04, macos-13, macos-15, windows-2025] name: ${{matrix.os}} runs-on: ${{matrix.os}} @@ -23,11 +23,17 @@ jobs: uses: actions/checkout@v4 - name: Setup Xcode version - if: runner.os == 'macOS' + if: matrix.os == 'macos-13' uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: '15.2' + - name: Setup Xcode version + if: matrix.os == 'macos-15' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.4' + - name: Setup MSVC if: runner.os == 'windows' uses: ilammy/msvc-dev-cmd@v1 From afe5925b0cc1adff564083e4a2874bb7b9042dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 07:49:35 -0800 Subject: [PATCH 04/33] Silence gcc warning. --- modules/core/src/compute_area.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/src/compute_area.cpp b/modules/core/src/compute_area.cpp index 9c77ffff..0ba79d8b 100644 --- a/modules/core/src/compute_area.cpp +++ b/modules/core/src/compute_area.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include // clang-format off @@ -348,8 +349,10 @@ AttributeId compute_facet_vector_area( auto f = mesh.get_facet_vertices(fid); for (Index lv = 0; lv < f_size; lv++) { Index lv_next = (lv + 1) % f_size; + LA_IGNORE_ARRAY_BOUNDS_BEGIN vector_area.row(fid) += vertices.row(f[lv]).template head<3>().cross( vertices.row(f[lv_next]).template head<3>()); + LA_IGNORE_ARRAY_BOUNDS_END } }); vector_area /= 2; From 4c69226f8ea89a3e7613392f4c1b3a560a6db5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dumas?= Date: Thu, 13 Nov 2025 08:29:46 -0800 Subject: [PATCH 05/33] Sync with 96afce5 (#76) --- cmake/lagrange/lagrange_cpm_cache.cmake | 3 ++- cmake/lagrange/lagrange_tbb_sanitizers.cmake | 7 ++++-- cmake/recipes/external/assimp.cmake | 4 ++- cmake/recipes/external/assimp.patch | 25 +++++++++++++++---- .../testing/include/lagrange/testing/common.h | 4 ++- 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/cmake/lagrange/lagrange_cpm_cache.cmake b/cmake/lagrange/lagrange_cpm_cache.cmake index 6c34f303..4b2953dd 100644 --- a/cmake/lagrange/lagrange_cpm_cache.cmake +++ b/cmake/lagrange/lagrange_cpm_cache.cmake @@ -14,7 +14,8 @@ if(DEFINED ENV{CPM_SOURCE_CACHE}) set(CPM_SOURCE_CACHE_DEFAULT $ENV{CPM_SOURCE_CACHE}) else() # Set CPM cache folder if unset - file(REAL_PATH "~/.cache/CPM" CPM_SOURCE_CACHE_DEFAULT EXPAND_TILDE) + file(REAL_PATH "~" HOME_DIR EXPAND_TILDE) + cmake_path(APPEND HOME_DIR ".cache/CPM" OUTPUT_VARIABLE CPM_SOURCE_CACHE_DEFAULT) endif() set(CPM_SOURCE_CACHE diff --git a/cmake/lagrange/lagrange_tbb_sanitizers.cmake b/cmake/lagrange/lagrange_tbb_sanitizers.cmake index 66a23381..1ee91815 100644 --- a/cmake/lagrange/lagrange_tbb_sanitizers.cmake +++ b/cmake/lagrange/lagrange_tbb_sanitizers.cmake @@ -10,7 +10,11 @@ # governing permissions and limitations under the License. # -# Set TBB_SANITIZE based on the USE_SANITIZER option +# Set TBB_SANITIZE based on the USE_SANITIZER option. Even though global options are already enabled +# by our sanitizers.cmake script, setting the TBB_SANITIZE option will let OneTBB disable elements +# incompatible with TSan, such as ITT notifications and LTO: +# https://github.com/uxlfoundation/oneTBB/blob/0cd32ab10a84eabf780bb699b17430deb028c0a4/src/tbbmalloc/CMakeLists.txt#L42 +# https://github.com/uxlfoundation/oneTBB/blob/0cd32ab10a84eabf780bb699b17430deb028c0a4/CMakeLists.txt#L254 set(TBB_SANITIZE "") if(USE_SANITIZER) if(UNIX) @@ -29,7 +33,6 @@ if(USE_SANITIZER) elseif(MSVC) if(USE_SANITIZER MATCHES "([Aa]ddress)") set(TBB_SANITIZE "address -fno-omit-frame-pointer") - else() endif() endif() endif() diff --git a/cmake/recipes/external/assimp.cmake b/cmake/recipes/external/assimp.cmake index a453ea97..74214b2c 100644 --- a/cmake/recipes/external/assimp.cmake +++ b/cmake/recipes/external/assimp.cmake @@ -43,12 +43,14 @@ include(CPM) CPMAddPackage( NAME assimp GITHUB_REPOSITORY assimp/assimp - GIT_TAG 2f3e72413f25897c1903e883a94fa5cf4293e26b + GIT_TAG v6.0.2 PATCHES # Prevent Assimp from meddling with compiler flags in debug mode. # See internal lagrange-lib/#1303 for more details. # Remember to update this patch when updating Assimp. + # This patch also fixes the compilation issue related to contrib/zlib. + # See https://github.com/assimp/assimp/issues/6118 assimp.patch ) diff --git a/cmake/recipes/external/assimp.patch b/cmake/recipes/external/assimp.patch index cf73bd92..4ece804b 100644 --- a/cmake/recipes/external/assimp.patch +++ b/cmake/recipes/external/assimp.patch @@ -1,8 +1,8 @@ -diff --git i/CMakeLists.txt w/CMakeLists.txt -index 517a957f4..0f8594369 100644 ---- i/CMakeLists.txt -+++ w/CMakeLists.txt -@@ -339,7 +339,6 @@ ELSEIF(MSVC) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cd8f515..90b782a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -343,7 +343,6 @@ ELSEIF(MSVC) ENDIF() # supress warning for double to float conversion if Double precision is activated ADD_COMPILE_OPTIONS(/wd4244) @@ -10,3 +10,18 @@ index 517a957f4..0f8594369 100644 # Allow user to disable PDBs if(ASSIMP_INSTALL_PDB) SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") +diff --git a/contrib/zlib/zutil.h b/contrib/zlib/zutil.h +index 0bc7f4e..e93e4bf 100644 +--- a/contrib/zlib/zutil.h ++++ b/contrib/zlib/zutil.h +@@ -142,10 +142,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ + # ifndef Z_SOLO + # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os + # include /* for fdopen */ +-# else +-# ifndef fdopen +-# define fdopen(fd,mode) NULL /* No fdopen() */ +-# endif + # endif + # endif + #endif diff --git a/modules/testing/include/lagrange/testing/common.h b/modules/testing/include/lagrange/testing/common.h index ee494bd5..238ab632 100644 --- a/modules/testing/include/lagrange/testing/common.h +++ b/modules/testing/include/lagrange/testing/common.h @@ -164,7 +164,9 @@ SurfaceMesh load_surface_mesh(const fs::path& relative_path) { auto full_path = get_data_path(relative_path); REQUIRE(lagrange::fs::exists(full_path)); - return lagrange::io::load_mesh>(full_path); + io::LoadOptions options; + options.quiet = true; + return lagrange::io::load_mesh>(full_path, options); } /// From 5828f000f6b0cc6aab2b05c2998c8066a28442c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 09:13:36 -0800 Subject: [PATCH 06/33] Update Eigen to patch release. --- cmake/recipes/external/Eigen3.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/recipes/external/Eigen3.cmake b/cmake/recipes/external/Eigen3.cmake index cdbcca7b..bc86f2ae 100644 --- a/cmake/recipes/external/Eigen3.cmake +++ b/cmake/recipes/external/Eigen3.cmake @@ -26,7 +26,7 @@ else() CPMAddPackage( NAME eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git - GIT_TAG 3.4.0 + GIT_TAG 3.4.1 DOWNLOAD_ONLY ON ) set(EIGEN_INCLUDE_DIRS ${eigen_SOURCE_DIR}) From 1629c366ab91080ee1793e606b6ceb569d6d6477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 10:59:17 -0800 Subject: [PATCH 07/33] Try to use /Zi with sccache... --- .github/workflows/continuous.yaml | 1 + CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index eb0ea024..114b9e24 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -202,6 +202,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ -DLAGRANGE_JENKINS=ON ^ -DLAGRANGE_ALL=ON ^ + -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=$<$:ProgramDatabase> ^ -B "C:/build" ^ -S . cmake --build "C:/build" -j ${{ steps.cpu-cores.outputs.count }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 9729fde7..a433ffd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,9 @@ set_property(CACHE LAGRANGE_CCACHE_PROGRAM PROPERTY STRINGS ${LAGRANGE_CCACHE_PR # Enable sscache if available if((LAGRANGE_CCACHE_PROGRAM STREQUAL "sccache") AND SCCACHE_PROGRAM) message(STATUS "Using sccache: ${SCCACHE_PROGRAM}") - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") + if(NOT DEFINED CMAKE_MSVC_DEBUG_INFORMATION_FORMAT) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") + endif() foreach(lang IN ITEMS C CXX) set(CMAKE_${lang}_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env ${ccacheEnv} ${SCCACHE_PROGRAM} @@ -79,6 +81,8 @@ if((LAGRANGE_CCACHE_PROGRAM STREQUAL "ccache") AND CCACHE_PROGRAM) CCACHE_SLOPPINESS=clang_index_store,include_file_ctime,include_file_mtime,locale,pch_defines,time_macros ) message(STATUS "Using ccache: ${CCACHE_PROGRAM}") + # ccache does not yet support /Zi on Windows: + # https://github.com/ccache/ccache/issues/1040 set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") foreach(lang IN ITEMS C CXX) set(CMAKE_${lang}_COMPILER_LAUNCHER From bd96fdd2d0be07ebc2694f52c32b05d854b2d7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 11:39:17 -0800 Subject: [PATCH 08/33] Fix syntax. --- .github/workflows/continuous.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 114b9e24..ac8cb6e9 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -193,6 +193,9 @@ jobs: # We run configure + build in the same step, since they both need to call VsDevCmd # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) + # windows-2025 images have less disk space, so we need to use /Zi instead of /Z7 + # https://github.com/actions/runner-images/issues/12609 + # https://github.com/actions/runner-images/issues/12199 - name: Configure and build shell: cmd run: | @@ -202,7 +205,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ -DLAGRANGE_JENKINS=ON ^ -DLAGRANGE_ALL=ON ^ - -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=$<$:ProgramDatabase> ^ + -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT='$<$:ProgramDatabase>' ^ -B "C:/build" ^ -S . cmake --build "C:/build" -j ${{ steps.cpu-cores.outputs.count }} From 79a5175cc6dd6626bd8d8206b85eee62bf06c1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 11:51:00 -0800 Subject: [PATCH 09/33] Fix syntax again. --- .github/workflows/continuous.yaml | 4 ---- CMakeLists.txt | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index ac8cb6e9..eb0ea024 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -193,9 +193,6 @@ jobs: # We run configure + build in the same step, since they both need to call VsDevCmd # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) - # windows-2025 images have less disk space, so we need to use /Zi instead of /Z7 - # https://github.com/actions/runner-images/issues/12609 - # https://github.com/actions/runner-images/issues/12199 - name: Configure and build shell: cmd run: | @@ -205,7 +202,6 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ -DLAGRANGE_JENKINS=ON ^ -DLAGRANGE_ALL=ON ^ - -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT='$<$:ProgramDatabase>' ^ -B "C:/build" ^ -S . cmake --build "C:/build" -j ${{ steps.cpu-cores.outputs.count }} diff --git a/CMakeLists.txt b/CMakeLists.txt index a433ffd5..55e7e82c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,14 @@ endif() set(LAGRANGE_CCACHE_PROGRAMS none ccache sccache) set_property(CACHE LAGRANGE_CCACHE_PROGRAM PROPERTY STRINGS ${LAGRANGE_CCACHE_PROGRAMS}) +# windows-2025 images have less disk space, so we need to use /Zi instead of /Z7 +# https://github.com/actions/runner-images/issues/12609 +# https://github.com/actions/runner-images/issues/12199 +if($ENV{GITHUB_ACTIONS}) + message(STATUS "GitHub Runner detected: setting /Zi on Windows to save disk space") + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") +endif() + # Enable sscache if available if((LAGRANGE_CCACHE_PROGRAM STREQUAL "sccache") AND SCCACHE_PROGRAM) message(STATUS "Using sccache: ${SCCACHE_PROGRAM}") From fe6f41c623118c641c7dc0485ff02b6acd464657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 11:53:58 -0800 Subject: [PATCH 10/33] Update OneTBB version. --- cmake/recipes/external/onetbb.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/recipes/external/onetbb.cmake b/cmake/recipes/external/onetbb.cmake index f7a3911b..9bb4ddf4 100644 --- a/cmake/recipes/external/onetbb.cmake +++ b/cmake/recipes/external/onetbb.cmake @@ -72,7 +72,7 @@ function(onetbb_import_target) CPMAddPackage( NAME tbb GITHUB_REPOSITORY oneapi-src/oneTBB - GIT_TAG v2021.13.0 + GIT_TAG v2022.3.0 ) # TODO: This might break with future versions of onetbb. Onetbb should eventually add a proper cmake option to turn wasm threads on/off. From fc3e6f89d434d7d3d13f2672e6f8a95caf307b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 14:05:43 -0800 Subject: [PATCH 11/33] Run ncdu after build --- .github/workflows/continuous.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index eb0ea024..9d730271 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -206,5 +206,20 @@ jobs: -S . cmake --build "C:/build" -j ${{ steps.cpu-cores.outputs.count }} + - name: Run ncdu + shell: msys2 {0} + if: always() + run: | + ncdu -0 -o ${{ matrix.config }}-C.json /C + ncdu -0 -o ${{ matrix.config }}-D.json /D + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.config }} + path: | + ${{ matrix.config }}-C.json + ${{ matrix.config }}-D.json + - name: Tests run: cd "C:/build"; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} From f2e40ab17710474ba1e31cab1dd81c658ac985d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 14:11:13 -0800 Subject: [PATCH 12/33] Print disk usage. --- .github/workflows/continuous.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 9d730271..58e9fcc9 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -191,6 +191,11 @@ jobs: # Scoop modifies the PATH so we make it available for the next steps of the job echo "${env:PATH}" >> ${env:GITHUB_PATH} + - name: Print disk usage + run: | + echo "disk usage:" + df -h + # We run configure + build in the same step, since they both need to call VsDevCmd # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) - name: Configure and build @@ -206,6 +211,12 @@ jobs: -S . cmake --build "C:/build" -j ${{ steps.cpu-cores.outputs.count }} + - name: Print disk usage + if: always() + run: | + echo "disk usage:" + df -h + - name: Run ncdu shell: msys2 {0} if: always() From 86db1de98895ab1e9170d7d07d586c7414b20d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 15:00:42 -0800 Subject: [PATCH 13/33] Move build folder to D:/ on Windows. --- .github/workflows/continuous.yaml | 43 ++++++++++++------------------- CMakeLists.txt | 12 +-------- 2 files changed, 17 insertions(+), 38 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 58e9fcc9..e910bf7e 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -57,6 +57,11 @@ jobs: docker-images: true swap-storage: true + - name: Show disk space + run: | + echo "disk usage:" + df -h + - name: Checkout repository uses: actions/checkout@v4 with: @@ -138,6 +143,12 @@ jobs: cmake --build build -j ${{ steps.cpu-cores.outputs.count }} ccache --show-stats + - name: Show disk space + if: always() + run: | + echo "disk usage:" + df -h + - name: Tests run: cd build; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} @@ -191,11 +202,6 @@ jobs: # Scoop modifies the PATH so we make it available for the next steps of the job echo "${env:PATH}" >> ${env:GITHUB_PATH} - - name: Print disk usage - run: | - echo "disk usage:" - df -h - # We run configure + build in the same step, since they both need to call VsDevCmd # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) - name: Configure and build @@ -207,30 +213,13 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ -DLAGRANGE_JENKINS=ON ^ -DLAGRANGE_ALL=ON ^ - -B "C:/build" ^ + -B "D:/build" ^ -S . - cmake --build "C:/build" -j ${{ steps.cpu-cores.outputs.count }} - - - name: Print disk usage - if: always() - run: | - echo "disk usage:" - df -h + cmake --build "D:/build" -j ${{ steps.cpu-cores.outputs.count }} - - name: Run ncdu - shell: msys2 {0} + - name: Show disk space if: always() - run: | - ncdu -0 -o ${{ matrix.config }}-C.json /C - ncdu -0 -o ${{ matrix.config }}-D.json /D - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.config }} - path: | - ${{ matrix.config }}-C.json - ${{ matrix.config }}-D.json + run: Get-PSDrive - name: Tests - run: cd "C:/build"; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} + run: cd "D:/build"; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 55e7e82c..a89f00d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,20 +61,10 @@ endif() set(LAGRANGE_CCACHE_PROGRAMS none ccache sccache) set_property(CACHE LAGRANGE_CCACHE_PROGRAM PROPERTY STRINGS ${LAGRANGE_CCACHE_PROGRAMS}) -# windows-2025 images have less disk space, so we need to use /Zi instead of /Z7 -# https://github.com/actions/runner-images/issues/12609 -# https://github.com/actions/runner-images/issues/12199 -if($ENV{GITHUB_ACTIONS}) - message(STATUS "GitHub Runner detected: setting /Zi on Windows to save disk space") - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") -endif() - # Enable sscache if available if((LAGRANGE_CCACHE_PROGRAM STREQUAL "sccache") AND SCCACHE_PROGRAM) message(STATUS "Using sccache: ${SCCACHE_PROGRAM}") - if(NOT DEFINED CMAKE_MSVC_DEBUG_INFORMATION_FORMAT) - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") - endif() + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") foreach(lang IN ITEMS C CXX) set(CMAKE_${lang}_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env ${ccacheEnv} ${SCCACHE_PROGRAM} From bbff5152c30c1bccfa63fa8cd2cde4ed1e98d1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Thu, 13 Nov 2025 16:04:35 -0800 Subject: [PATCH 14/33] Hide eigen warnings. --- cmake/recipes/external/Eigen3.cmake | 2 +- modules/core/include/lagrange/utils/warning.h | 7 +++++++ modules/polyddg/src/DifferentialOperators.cpp | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/recipes/external/Eigen3.cmake b/cmake/recipes/external/Eigen3.cmake index bc86f2ae..cdbcca7b 100644 --- a/cmake/recipes/external/Eigen3.cmake +++ b/cmake/recipes/external/Eigen3.cmake @@ -26,7 +26,7 @@ else() CPMAddPackage( NAME eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git - GIT_TAG 3.4.1 + GIT_TAG 3.4.0 DOWNLOAD_ONLY ON ) set(EIGEN_INCLUDE_DIRS ${eigen_SOURCE_DIR}) diff --git a/modules/core/include/lagrange/utils/warning.h b/modules/core/include/lagrange/utils/warning.h index de45d4c4..482affc3 100644 --- a/modules/core/include/lagrange/utils/warning.h +++ b/modules/core/include/lagrange/utils/warning.h @@ -160,6 +160,13 @@ /// @hideinitializer #define LA_IGNORE_ARRAY_BOUNDS_END LA_DISABLE_WARNING_END +/// Ignore maybe uninitialized warnings (e.g. when instancing third-party code) +/// @hideinitializer +#define LA_IGNORE_MAYBE_UNINITIALIZED_START LA_DISABLE_WARNING_BEGIN \ + LA_DISABLE_WARNING_CLANG(-Wmaybe-uninitialized) +/// @hideinitializer +#define LA_IGNORE_MAYBE_UNINITIALIZED_END LA_DISABLE_WARNING_END + // clang-format on /// @} diff --git a/modules/polyddg/src/DifferentialOperators.cpp b/modules/polyddg/src/DifferentialOperators.cpp index 726b1e8e..27a67681 100644 --- a/modules/polyddg/src/DifferentialOperators.cpp +++ b/modules/polyddg/src/DifferentialOperators.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1024,7 +1025,9 @@ DifferentialOperators::levi_civita_nrosy(Index fid, Index lv, Ind Vector nf = vec_area.row(fid); // No need to normalize Vector nv = vertex_normal.row(vid); + LA_IGNORE_MAYBE_UNINITIALIZED_START auto Q = Eigen::Quaternion::FromTwoVectors(nv, nf).matrix(); + LA_IGNORE_MAYBE_UNINITIALIZED_END if (n != 1) { la_debug_assert(n > 1, "n should be positive."); From 63d511ba2cdec5588abfb21ef2a4f689c3eee82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 01:35:03 +0000 Subject: [PATCH 15/33] Update macro. --- modules/core/include/lagrange/utils/warning.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/include/lagrange/utils/warning.h b/modules/core/include/lagrange/utils/warning.h index 482affc3..54b97b17 100644 --- a/modules/core/include/lagrange/utils/warning.h +++ b/modules/core/include/lagrange/utils/warning.h @@ -163,7 +163,7 @@ /// Ignore maybe uninitialized warnings (e.g. when instancing third-party code) /// @hideinitializer #define LA_IGNORE_MAYBE_UNINITIALIZED_START LA_DISABLE_WARNING_BEGIN \ - LA_DISABLE_WARNING_CLANG(-Wmaybe-uninitialized) + LA_DISABLE_WARNING_GCC(-Wmaybe-uninitialized) /// @hideinitializer #define LA_IGNORE_MAYBE_UNINITIALIZED_END LA_DISABLE_WARNING_END From 51d2c111e6ae512e6df1dcce26ca731410e81112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 01:46:06 +0000 Subject: [PATCH 16/33] Update Eigen warnings. --- modules/polyddg/src/DifferentialOperators.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/polyddg/src/DifferentialOperators.cpp b/modules/polyddg/src/DifferentialOperators.cpp index 27a67681..9e40eecf 100644 --- a/modules/polyddg/src/DifferentialOperators.cpp +++ b/modules/polyddg/src/DifferentialOperators.cpp @@ -9,20 +9,26 @@ * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ +#include + +#include + +// Include early so we can explicitly silence warnings from Eigen. +// Note: This warning only shows up with GCC 13, even though we include Eigen headers via -isystem. +// It seems that with GCC 14+ -isystem also silences -Wmaybe-uninitialized. +LA_IGNORE_MAYBE_UNINITIALIZED_START +#include +LA_IGNORE_MAYBE_UNINITIALIZED_END #include #include #include #include -#include #include #include #include -#include #include -#include - #include #include @@ -1025,9 +1031,7 @@ DifferentialOperators::levi_civita_nrosy(Index fid, Index lv, Ind Vector nf = vec_area.row(fid); // No need to normalize Vector nv = vertex_normal.row(vid); - LA_IGNORE_MAYBE_UNINITIALIZED_START auto Q = Eigen::Quaternion::FromTwoVectors(nv, nf).matrix(); - LA_IGNORE_MAYBE_UNINITIALIZED_END if (n != 1) { la_debug_assert(n > 1, "n should be positive."); From bf621e76d3cd174557970566367b1689ad5c1940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 17:14:08 +0000 Subject: [PATCH 17/33] Update Eigen warnings. --- modules/core/tests/test_mesh_convert.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/core/tests/test_mesh_convert.cpp b/modules/core/tests/test_mesh_convert.cpp index 94ad5c3e..f9ea96dd 100644 --- a/modules/core/tests/test_mesh_convert.cpp +++ b/modules/core/tests/test_mesh_convert.cpp @@ -9,11 +9,19 @@ * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ +#include + +// Include early so we can explicitly silence warnings from Eigen. +// Note: This warning only shows up with GCC 13 when ASan is enabled, even though we include Eigen +// headers via -isystem. It seems that with GCC 14+ -isystem also silences -Wmaybe-uninitialized. +LA_IGNORE_MAYBE_UNINITIALIZED_START +#include +LA_IGNORE_MAYBE_UNINITIALIZED_END + #include #include #include - // clang-format off #include #include From 604f0a77ca6a928bf04e0533c80072aa7b443cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 17:21:07 +0000 Subject: [PATCH 18/33] Update macOS images and Xcode versions. --- .github/workflows/continuous.yaml | 14 +++++++------- .github/workflows/wheel.yaml | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index e910bf7e..b161d57c 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -24,16 +24,16 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, macos-13, macos-15] + os: [ubuntu-24.04, macos-15-intel, macos-15] config: [RelwithDebInfo, Debug] compiler: [gcc, apple, llvm] sanitizer: ["Address", "Thread"] # TODO: Add Memory+Undefined Sanitizer exclude: - - os: macos-13 + - os: macos-15-intel compiler: gcc - - os: macos-13 + - os: macos-15-intel sanitizer: Thread - - os: macos-13 + - os: macos-15-intel config: Debug - os: macos-15 compiler: gcc @@ -96,16 +96,16 @@ jobs: fi - name: Setup Xcode version - if: matrix.os == 'macos-13' + if: matrix.os == 'macos-15-intel' uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.2' + xcode-version: '16.4' - name: Setup Xcode version if: matrix.os == 'macos-15' uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.4' + xcode-version: '26.0.1' - name: Get number of CPU cores uses: SimenB/github-actions-cpu-cores@v1 diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index e44be880..47da0999 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, macos-13, macos-15, windows-2025] + os: [ubuntu-24.04, macos-15-intel, macos-15, windows-2025] name: ${{matrix.os}} runs-on: ${{matrix.os}} @@ -23,16 +23,16 @@ jobs: uses: actions/checkout@v4 - name: Setup Xcode version - if: matrix.os == 'macos-13' + if: matrix.os == 'macos-15-intel' uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.2' + xcode-version: '16.4' - name: Setup Xcode version if: matrix.os == 'macos-15' uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.4' + xcode-version: '26.0.1' - name: Setup MSVC if: runner.os == 'windows' From b561bcfc95aba7d5d4083e50cb1f7600cc7d2411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 15:15:04 -0800 Subject: [PATCH 19/33] Switch to Embree4 by default and add WinArm GH runner. --- .github/workflows/continuous.yaml | 1 + cmake/lagrange/lagrange_find_package.cmake | 26 + .../external/{embree.cmake => embree3.cmake} | 8 +- .../external/{embree.patch => embree3.patch} | 0 cmake/recipes/external/embree4.cmake | 157 ++++++ cmake/recipes/external/embree4.patch | 491 ++++++++++++++++++ modules/raycasting/CMakeLists.txt | 12 +- .../lagrange/raycasting/EmbreeHelper.h | 8 +- .../lagrange/raycasting/EmbreeRayCaster.h | 63 ++- .../raycasting/embree_closest_point.h | 15 +- modules/raycasting/src/EmbreeHelper.cpp | 8 +- 11 files changed, 756 insertions(+), 33 deletions(-) rename cmake/recipes/external/{embree.cmake => embree3.cmake} (97%) rename cmake/recipes/external/{embree.patch => embree3.patch} (100%) create mode 100644 cmake/recipes/external/embree4.cmake create mode 100644 cmake/recipes/external/embree4.patch diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index b161d57c..e7dd456e 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -162,6 +162,7 @@ jobs: strategy: fail-fast: false matrix: + os: [windows-2025, windows-11-arm] config: [Release, Debug] steps: - name: Show disk space diff --git a/cmake/lagrange/lagrange_find_package.cmake b/cmake/lagrange/lagrange_find_package.cmake index 185d6b37..000b893e 100644 --- a/cmake/lagrange/lagrange_find_package.cmake +++ b/cmake/lagrange/lagrange_find_package.cmake @@ -50,6 +50,19 @@ function(lagrange_find_package name) elseif(${name} STREQUAL algcmake) find_package(${name} ${ARGN}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE) + elseif(${name} STREQUAL embree) + if(${ARGC} LESS 2) + message(FATAL_ERROR "lagrange_find_package(embree ...) requires at least 1 argument for the version number, ${ARGC} given") + endif() + if(${ARGV1} EQUAL 3) + # Defer to vcpkg port + find_package(${name} ${ARGN}) + elseif(${ARGV1} EQUAL 4) + # Use internal embree4.cmake recipe + include(embree4) + else() + message(FATAL_ERROR "Unsupported embree version number: ${ARGV1}") + endif() else() find_package(${name} ${ARGN}) endif() @@ -74,6 +87,19 @@ function(lagrange_find_package name) ${algcmake_SOURCE_DIR}/modules ) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE) + elseif(${name} STREQUAL embree) + if(${ARGC} LESS 2) + message(FATAL_ERROR "lagrange_find_package(embree ...) requires at least 1 argument for the version number, ${ARGC} given") + endif() + if(${ARGV1} EQUAL 3) + # Redirect to embree3.cmake + include(embree3) + elseif(${ARGV1} EQUAL 4) + # Redirect to embree4.cmake + include(embree4) + else() + message(FATAL_ERROR "Unsupported embree version number: ${ARGV1}") + endif() else() include(${name}) endif() diff --git a/cmake/recipes/external/embree.cmake b/cmake/recipes/external/embree3.cmake similarity index 97% rename from cmake/recipes/external/embree.cmake rename to cmake/recipes/external/embree3.cmake index 3c6cf57b..5e2d862a 100644 --- a/cmake/recipes/external/embree.cmake +++ b/cmake/recipes/external/embree3.cmake @@ -89,8 +89,10 @@ function(embree_import_target) lagrange_find_package(TBB CONFIG REQUIRED) ignore_package(TBB) get_target_property(TBB_INCLUDE_DIRS TBB::tbb INTERFACE_INCLUDE_DIRECTORIES) - add_library(TBB INTERFACE) - target_link_libraries(TBB INTERFACE TBB::tbb) + if(NOT TARGET TBB) + add_library(TBB INTERFACE) + target_link_libraries(TBB INTERFACE TBB::tbb) + endif() set(TBB_LIBRARIES TBB) # Ready to include embree's atrocious CMake @@ -105,7 +107,7 @@ function(embree_import_target) # Patch for emscripten compatibility. Fix available upstream in Embree 4+. # https://github.com/RenderKit/embree/pull/365 # https://github.com/RenderKit/embree/issues/486 - embree.patch + embree3.patch ) unignore_package(TBB) diff --git a/cmake/recipes/external/embree.patch b/cmake/recipes/external/embree3.patch similarity index 100% rename from cmake/recipes/external/embree.patch rename to cmake/recipes/external/embree3.patch diff --git a/cmake/recipes/external/embree4.cmake b/cmake/recipes/external/embree4.cmake new file mode 100644 index 00000000..8ff3c553 --- /dev/null +++ b/cmake/recipes/external/embree4.cmake @@ -0,0 +1,157 @@ +# +# Copyright 2019 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# +if(TARGET embree::embree4) + return() +endif() + +message(STATUS "Third-party (external): creating target 'embree::embree4'") + +# Set Embree's default options +option(EMBREE_ISPC_SUPPORT "Build Embree with support for ISPC applications." OFF) +option(EMBREE_TUTORIALS "Enable to build Embree tutorials" OFF) +option(EMBREE_STATIC_LIB "Build Embree as a static library." ON) +set(EMBREE_TESTING_INTENSITY 0 CACHE STRING "Intensity of testing (0 = no testing, 1 = verify and tutorials, 2 = light testing, 3 = intensive testing.") +set(EMBREE_TASKING_SYSTEM "TBB" CACHE STRING "Selects tasking system") +option(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." OFF) + +# Set C++ namespace to avoid symbol collisions when compiling with embree3 side-by-side +set(EMBREE_API_NAMESPACE "embree4" CACHE STRING "C++ namespace to put API symbols into.") + +# The following options are necessary to ensure packed-ray support +option(EMBREE_RAY_MASK "Enable the usage of mask for packed ray." ON) +option(EMBREE_RAY_PACKETS "Enable the usage packed ray." ON) + +if(APPLE) + set(EMBREE_MAX_ISA "NEON" CACHE STRING "Selects highest ISA to support.") +elseif(EMSCRIPTEN) + set(EMBREE_MAX_ISA "SSE2" CACHE STRING "Selects highest ISA to support.") + set(FLAGS_SSE2 "-msse -msse2 -msimd128") # set to non-empty to prevent embree from using incorrect flags +else() + set(EMBREE_MAX_ISA "DEFAULT" CACHE STRING "Selects highest ISA to support.") +endif() + +# We want to compile Embree with TBB support, so we need to overwrite Embree's +# `find_package()` and provide variables. The following discussion provide some +# context on how to achieve this: +# - https://gitlab.kitware.com/cmake/cmake/issues/17735 +# - https://crascit.com/2018/09/14/do-not-redefine-cmake-commands/ +function(embree4_import_target) + macro(push_variable var value) + if(DEFINED CACHE{${var}}) + set(LAGRANGE_OLD_${var}_VALUE "${${var}}") + set(LAGRANGE_OLD_${var}_TYPE CACHE_TYPE) + elseif(DEFINED ${var}) + set(LAGRANGE_OLD_${var}_VALUE "${${var}}") + set(LAGRANGE_OLD_${var}_TYPE NORMAL_TYPE) + else() + set(LAGRANGE_OLD_${var}_TYPE NONE_TYPE) + endif() + set(${var} "${value}") + endmacro() + + macro(pop_variable var) + if(LAGRANGE_OLD_${var}_TYPE STREQUAL CACHE_TYPE) + set(${var} "${LAGRANGE_OLD_${var}_VALUE}" CACHE PATH "" FORCE) + elseif(LAGRANGE_OLD_${var}_TYPE STREQUAL NORMAL_TYPE) + unset(${var} CACHE) + set(${var} "${LAGRANGE_OLD_${var}_VALUE}") + elseif(LAGRANGE_OLD_${var}_TYPE STREQUAL NONE_TYPE) + unset(${var} CACHE) + else() + message(FATAL_ERROR "Trying to pop a variable that has not been pushed: ${var}") + endif() + endmacro() + + macro(ignore_package NAME) + set(LAGRANGE_DUMMY_DIR "${CMAKE_CURRENT_BINARY_DIR}/embree_cmake/${NAME}") + file(WRITE ${LAGRANGE_DUMMY_DIR}/${NAME}Config.cmake "") + push_variable(${NAME}_DIR ${LAGRANGE_DUMMY_DIR}) + push_variable(${NAME}_ROOT ${LAGRANGE_DUMMY_DIR}) + endmacro() + + macro(unignore_package NAME) + pop_variable(${NAME}_DIR) + pop_variable(${NAME}_ROOT) + endmacro() + + # Prefer Config mode before Module mode to prevent embree from loading its own FindTBB.cmake + set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) + + # Embree wants to be able to export() its target, and expects a target named `TBB` to exist. + # Somehow we stil need to define `TBB_INCLUDE_DIRS`, and linking against `TBB` isn't sufficient + # to compile embree targets properly. + lagrange_find_package(TBB CONFIG REQUIRED) + ignore_package(TBB) + get_target_property(TBB_INCLUDE_DIRS TBB::tbb INTERFACE_INCLUDE_DIRECTORIES) + if(NOT TARGET TBB) + add_library(TBB INTERFACE) + target_link_libraries(TBB INTERFACE TBB::tbb) + endif() + set(TBB_LIBRARIES TBB) + + # Ready to include embree's atrocious CMake + include(CPM) + CPMAddPackage( + NAME embree4 + GITHUB_REPOSITORY RenderKit/embree + GIT_TAG v4.4.0 + + # Maybe one day we'll have https://gitlab.kitware.com/cmake/cmake/-/issues/22687 + # Until then, if we want to compile both Embree3 and Embree4 side by side, we need patching + ) + + unignore_package(TBB) + + # Disable warnings + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # Embree's subgrid.h is known for causing array subscript out of bound + # warning. Embree dev claim the code is correct and it is a GCC bug + # for misfiring warnings. See https://github.com/embree/embree/issues/271 + # + # The issue should be fixed for gcc 9.2.1 and later. + target_compile_options(embree4_embree PRIVATE "-Wno-array-bounds") + endif() + + # Warning setting + set(unix_compilers "AppleClang;Clang;GNU") + if(CMAKE_CXX_COMPILER_ID IN_LIST unix_compilers) # IN_LIST wants the second arg to be a var + target_compile_options(embree4_embree PRIVATE "-Wno-unused-private-field") + target_compile_options(embree4_embree PRIVATE "-Wno-unused-but-set-variable") + endif() + + # Now we need to do some juggling to propagate the include directory properties + # along with the `embree` target + add_library(embree::embree4 INTERFACE IMPORTED GLOBAL) + target_include_directories(embree::embree4 SYSTEM INTERFACE ${embree4_SOURCE_DIR}/include) + target_link_libraries(embree::embree4 INTERFACE embree4_embree) + + # Generate a dummy .cpp for embree's math library, to workaround a weird link issue with + # LLVM-Clang on macOS + # Generate implementation file + file(WRITE "${embree4_BINARY_DIR}/embree_math_dummy.cpp.in" [[ + namespace embree { + void math_dummy() {} + } + ]]) + configure_file(${embree4_BINARY_DIR}/embree_math_dummy.cpp.in ${embree4_BINARY_DIR}/embree_math_dummy.cpp COPYONLY) + target_sources(embree4_math PRIVATE ${embree4_BINARY_DIR}/embree_math_dummy.cpp) +endfunction() + +# Call via a proper function in order to scope variables such as CMAKE_FIND_PACKAGE_PREFER_CONFIG and TBB_DIR +embree4_import_target() + +# Cleanup for IDEs +foreach(name IN ITEMS embree algorithms lexers math simd sys tasking uninstall) + if(TARGET ${name}) + set_target_properties(embree4_${name} PROPERTIES FOLDER "third_party//embree4") + endif() +endforeach() diff --git a/cmake/recipes/external/embree4.patch b/cmake/recipes/external/embree4.patch new file mode 100644 index 00000000..75c28184 --- /dev/null +++ b/cmake/recipes/external/embree4.patch @@ -0,0 +1,491 @@ +diff --git i/CMakeLists.txt w/CMakeLists.txt +index 1292e265..f386ecb5 100644 +--- i/CMakeLists.txt ++++ w/CMakeLists.txt +@@ -691,16 +691,16 @@ ENDIF() + # Uninstall + ############################################################## + +-IF (NOT TARGET uninstall) ++IF (NOT TARGET embree4_uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/common/cmake/uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake" + IMMEDIATE @ONLY) + +- add_custom_target(uninstall ++ add_custom_target(embree4_uninstall + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake") + +- SET_PROPERTY(TARGET uninstall PROPERTY FOLDER CMakePredefinedTargets) ++ SET_PROPERTY(TARGET embree4_uninstall PROPERTY FOLDER CMakePredefinedTargets) + ENDIF() + + ############################################################## +diff --git i/common/lexers/CMakeLists.txt w/common/lexers/CMakeLists.txt +index 1e2452cd..5d060c7a 100644 +--- i/common/lexers/CMakeLists.txt ++++ w/common/lexers/CMakeLists.txt +@@ -1,16 +1,16 @@ + ## Copyright 2009-2021 Intel Corporation + ## SPDX-License-Identifier: Apache-2.0 + +-ADD_LIBRARY(lexers STATIC ++ADD_LIBRARY(embree4_lexers STATIC + stringstream.cpp + tokenstream.cpp + ) +-TARGET_LINK_LIBRARIES(lexers sys math) +-SET_PROPERTY(TARGET lexers PROPERTY FOLDER common) +-SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") ++TARGET_LINK_LIBRARIES(embree4_lexers embree4_sys embree4_math) ++SET_PROPERTY(TARGET embree4_lexers PROPERTY FOLDER common) ++SET_PROPERTY(TARGET embree4_lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS lexers EXPORT lexers-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_lexers EXPORT lexers-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT lexers-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() + +diff --git i/common/math/CMakeLists.txt w/common/math/CMakeLists.txt +index fcfa4559..6cfed20e 100644 +--- i/common/math/CMakeLists.txt ++++ w/common/math/CMakeLists.txt +@@ -1,12 +1,12 @@ + ## Copyright 2009-2021 Intel Corporation + ## SPDX-License-Identifier: Apache-2.0 + +-ADD_LIBRARY(math STATIC constants.cpp) +-SET_PROPERTY(TARGET math PROPERTY FOLDER common) +-SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") ++ADD_LIBRARY(embree4_math STATIC constants.cpp) ++SET_PROPERTY(TARGET embree4_math PROPERTY FOLDER common) ++SET_PROPERTY(TARGET embree4_math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS math EXPORT math-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_math EXPORT math-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT math-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() + +diff --git i/common/simd/CMakeLists.txt w/common/simd/CMakeLists.txt +index 989a00d6..742b885d 100644 +--- i/common/simd/CMakeLists.txt ++++ w/common/simd/CMakeLists.txt +@@ -1,11 +1,11 @@ + ## Copyright 2009-2021 Intel Corporation + ## SPDX-License-Identifier: Apache-2.0 + +-ADD_LIBRARY(simd STATIC sse.cpp) +-SET_PROPERTY(TARGET simd PROPERTY FOLDER common) +-SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") ++ADD_LIBRARY(embree4_simd STATIC sse.cpp) ++SET_PROPERTY(TARGET embree4_simd PROPERTY FOLDER common) ++SET_PROPERTY(TARGET embree4_simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS simd EXPORT simd-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_simd EXPORT simd-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT simd-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() +diff --git i/common/sys/CMakeLists.txt w/common/sys/CMakeLists.txt +index 66fc7083..d0e16cde 100644 +--- i/common/sys/CMakeLists.txt ++++ w/common/sys/CMakeLists.txt +@@ -4,7 +4,7 @@ + SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) + FIND_PACKAGE(Threads REQUIRED) + +-ADD_LIBRARY(sys STATIC ++ADD_LIBRARY(embree4_sys STATIC + sysinfo.cpp + alloc.cpp + filename.cpp +@@ -17,16 +17,16 @@ ADD_LIBRARY(sys STATIC + barrier.cpp + ) + +-SET_PROPERTY(TARGET sys PROPERTY FOLDER common) +-SET_PROPERTY(TARGET sys APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") ++SET_PROPERTY(TARGET embree4_sys PROPERTY FOLDER common) ++SET_PROPERTY(TARGET embree4_sys APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + +-TARGET_LINK_LIBRARIES(sys ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) ++TARGET_LINK_LIBRARIES(embree4_sys ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) + IF (EMBREE_SYCL_SUPPORT) +- TARGET_LINK_LIBRARIES(sys ${SYCL_LIB_NAME}) ++ TARGET_LINK_LIBRARIES(embree4_sys ${SYCL_LIB_NAME}) + ENDIF() + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS sys EXPORT sys-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_sys EXPORT sys-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT sys-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() + +diff --git i/common/tasking/CMakeLists.txt w/common/tasking/CMakeLists.txt +index bf790ef6..e2768e98 100644 +--- i/common/tasking/CMakeLists.txt ++++ w/common/tasking/CMakeLists.txt +@@ -2,7 +2,7 @@ + ## SPDX-License-Identifier: Apache-2.0 + + IF (TASKING_INTERNAL) +- ADD_LIBRARY(tasking STATIC taskschedulerinternal.cpp) ++ ADD_LIBRARY(embree4_tasking STATIC taskschedulerinternal.cpp) + ELSEIF (TASKING_TBB) + ############################################################## + # Find TBB +@@ -13,16 +13,16 @@ ELSEIF (TASKING_TBB) + list(APPEND CMAKE_PREFIX_PATH ${EMBREE_TBB_ROOT}) + endif() + +- ADD_LIBRARY(tasking STATIC taskschedulertbb.cpp) ++ ADD_LIBRARY(embree4_tasking STATIC taskschedulertbb.cpp) + + if (TARGET TBB::${EMBREE_TBB_COMPONENT}) + message("-- TBB: reuse existing TBB::${TBB_COMPONENT} target") +- TARGET_LINK_LIBRARIES(tasking PUBLIC TBB::${EMBREE_TBB_COMPONENT}) ++ TARGET_LINK_LIBRARIES(embree4_tasking PUBLIC TBB::${EMBREE_TBB_COMPONENT}) + else() + # Try getting TBB via config first + find_package(TBB 2020 COMPONENTS ${EMBREE_TBB_COMPONENT} CONFIG ${TBB_FIND_PACKAGE_OPTION}) + if (TBB_FOUND) +- TARGET_LINK_LIBRARIES(tasking PUBLIC TBB::${EMBREE_TBB_COMPONENT}) ++ TARGET_LINK_LIBRARIES(embree4_tasking PUBLIC TBB::${EMBREE_TBB_COMPONENT}) + message("-- Found TBB: ${TBB_VERSION} at ${TBB_DIR} via TBBConfig.cmake") + else() + +@@ -32,8 +32,8 @@ ELSEIF (TASKING_TBB) + unset(TBB_DIR CACHE) + find_package(TBB 4.1 REQUIRED ${EMBREE_TBB_COMPONENT}) + if (TBB_FOUND) +- TARGET_LINK_LIBRARIES(tasking PUBLIC TBB) +- TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC $) ++ TARGET_LINK_LIBRARIES(embree4_tasking PUBLIC TBB) ++ TARGET_INCLUDE_DIRECTORIES(embree4_tasking PUBLIC $) + + IF (EMBREE_STATIC_LIB) + INSTALL(TARGETS TBB EXPORT TBB-targets) +@@ -50,8 +50,8 @@ ELSEIF (TASKING_TBB) + IF(WIN32) + GET_TARGET_PROPERTY(DLL_PATH TBB::${EMBREE_TBB_COMPONENT} IMPORTED_LOCATION_RELEASE) + GET_TARGET_PROPERTY(DLL_PATH_DEBUG TBB::${EMBREE_TBB_COMPONENT} IMPORTED_LOCATION_DEBUG) +- SET_TARGET_PROPERTIES(tasking PROPERTIES IMPORTED_LOCATION_RELEASE ${DLL_PATH}) +- SET_TARGET_PROPERTIES(tasking PROPERTIES IMPORTED_LOCATION_DEBUG ${DLL_PATH_DEBUG}) ++ SET_TARGET_PROPERTIES(embree4_tasking PROPERTIES IMPORTED_LOCATION_RELEASE ${DLL_PATH}) ++ SET_TARGET_PROPERTIES(embree4_tasking PROPERTIES IMPORTED_LOCATION_DEBUG ${DLL_PATH_DEBUG}) + ENDIF() + + ############################################################### +@@ -65,14 +65,14 @@ ELSEIF (TASKING_TBB) + include(installTBB) + + ELSEIF (TASKING_PPL) +- ADD_LIBRARY(tasking STATIC taskschedulerppl.cpp) +- TARGET_LINK_LIBRARIES(tasking PUBLIC ${PPL_LIBRARIES}) ++ ADD_LIBRARY(embree4_tasking STATIC taskschedulerppl.cpp) ++ TARGET_LINK_LIBRARIES(embree4_tasking PUBLIC ${PPL_LIBRARIES}) + ENDIF() + +-SET_PROPERTY(TARGET tasking PROPERTY FOLDER common) +-SET_PROPERTY(TARGET tasking APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") ++SET_PROPERTY(TARGET embree4_tasking PROPERTY FOLDER common) ++SET_PROPERTY(TARGET embree4_tasking APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS tasking EXPORT tasking-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_tasking EXPORT tasking-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT tasking-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() +diff --git i/kernels/CMakeLists.txt w/kernels/CMakeLists.txt +index b8278079..da9824f3 100644 +--- i/kernels/CMakeLists.txt ++++ w/kernels/CMakeLists.txt +@@ -31,7 +31,7 @@ SOURCE_GROUP("Source Files\\algorithms" "/algorithms/") + SOURCE_GROUP("" FILES embree.rc) + + SET(EMBREE_LIBRARY_FILES +- ++ + embree.rc + + common/device.cpp +@@ -105,7 +105,7 @@ IF (EMBREE_GEOMETRY_SUBDIVISION) + subdiv/tessellation_cache.cpp + subdiv/subdivpatch1base.cpp + subdiv/catmullclark_coefficients.cpp +- geometry/grid_soa.cpp ++ geometry/grid_soa.cpp + subdiv/subdivpatch1base_eval.cpp + bvh/bvh_builder_subdiv.cpp) + ENDIF() +@@ -116,7 +116,7 @@ IF (EMBREE_RAY_PACKETS) + ENDIF() + + MACRO(embree_files TARGET ISA) +- ++ + SET(${TARGET} + geometry/instance_intersector.cpp + geometry/instance_array_intersector.cpp +@@ -130,16 +130,16 @@ MACRO(embree_files TARGET ISA) + + IF (${ISA} EQUAL ${ISA_LOWEST_AVX}) + LIST(APPEND ${TARGET} geometry/primitive8.cpp) +- ENDIF() ++ ENDIF() + + IF (${ISA} EQUAL ${SSE2} OR ${ISA} EQUAL ${AVX} OR ${ISA} EQUAL ${AVX2} OR ${ISA} EQUAL ${AVX512} OR ${ISA_LOWEST} EQUAL ${ISA}) +- ++ + LIST(APPEND ${TARGET} + common/scene_user_geometry.cpp + common/scene_instance.cpp + common/scene_instance_array.cpp + common/scene_triangle_mesh.cpp +- common/scene_quad_mesh.cpp ++ common/scene_quad_mesh.cpp + common/scene_curves.cpp + common/scene_line_segments.cpp + common/scene_grid_mesh.cpp +@@ -166,7 +166,7 @@ MACRO(embree_files TARGET ISA) + bvh/bvh_rotate.cpp + builders/primrefgen.cpp) + ENDIF() +- ++ + IF (${ISA} GREATER ${SSE42}) + LIST(APPEND ${TARGET} bvh/bvh_intersector1_bvh8.cpp) + ENDIF() +@@ -183,7 +183,7 @@ MACRO(embree_files TARGET ISA) + geometry/grid_soa.cpp + subdiv/subdivpatch1base_eval.cpp) + ENDIF() +- ++ + IF (EMBREE_RAY_PACKETS) + LIST(APPEND ${TARGET} + bvh/bvh_intersector_hybrid4_bvh4.cpp) +@@ -201,7 +201,7 @@ MACRO(embree_files TARGET ISA) + bvh/bvh_intersector_hybrid16_bvh4.cpp) + ENDIF() + ENDIF() +- ++ + ENDMACRO() + + #embree_files(EMBREE_LIBRARY_FILES_SSE2 ${SSE2}) +@@ -225,7 +225,7 @@ MACRO (CreateISADummyFiles list isa) + SET(dst_file "${CMAKE_BINARY_DIR}/${src}.${isa}.cpp") + SET(${list} ${${list}} ${dst_file}) + ADD_CUSTOM_COMMAND(OUTPUT ${dst_file} +- COMMAND ${CMAKE_COMMAND} ++ COMMAND ${CMAKE_COMMAND} + -D src=${src_file} + -D dst=${dst_file} + -P "${PROJECT_SOURCE_DIR}/common/cmake/create_isa_dummy_file.cmake" +@@ -243,40 +243,40 @@ MACRO (CheckGlobals library) + ADD_CUSTOM_TARGET(${library}_check_globals ALL COMMAND ${CMAKE_COMMAND} -D file=$ -P "${PROJECT_SOURCE_DIR}/common/cmake/check_globals.cmake" DEPENDS ${library}) + ENDIF() + ENDMACRO() +- ++ + DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES}) +-ADD_LIBRARY(embree ${EMBREE_LIB_TYPE} ${EMBREE_LIBRARY_FILES}) ++ADD_LIBRARY(embree4_embree ${EMBREE_LIB_TYPE} ${EMBREE_LIBRARY_FILES}) + + IF (EMBREE_SYCL_SUPPORT) + # add link flag '-fsycl' here to include the kernel for USM prefetch from + # scene_sycl.cpp in embree4.dll/embree4.so +- TARGET_LINK_OPTIONS(embree PRIVATE "-fsycl") ++ TARGET_LINK_OPTIONS(embree4_embree PRIVATE "-fsycl") + +- ADD_LIBRARY(embree_sycl STATIC ++ ADD_LIBRARY(embree4_embree_sycl STATIC + sycl/rtcore_sycl.cpp + sycl/rthwif_embree.cpp) + +- SET_TARGET_PROPERTIES(embree_sycl PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FLAGS_SYCL}) ++ SET_TARGET_PROPERTIES(embree4_embree_sycl PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FLAGS_SYCL}) + IF (EMBREE_SYCL_RT_VALIDATION_API) +- TARGET_LINK_LIBRARIES(embree_sycl PRIVATE embree_rthwif_sycl) ++ TARGET_LINK_LIBRARIES(embree4_embree_sycl PRIVATE embree_rthwif_sycl) + ENDIF() + + IF (EMBREE_SYCL_RT_SIMULATION) +- TARGET_LINK_LIBRARIES(embree_sycl PRIVATE rtcore) ++ TARGET_LINK_LIBRARIES(embree4_embree_sycl PRIVATE rtcore) + ENDIF() + +- INSTALL(TARGETS embree_sycl EXPORT embree_sycl-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(TARGETS embree4_embree_sycl EXPORT embree_sycl-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) + INSTALL(EXPORT embree_sycl-targets DESTINATION ${EMBREE_CMAKEEXPORT_DIR} COMPONENT devel) + +- SET_TARGET_PROPERTIES(embree_sycl PROPERTIES OUTPUT_NAME embree${EMBREE_VERSION_MAJOR}_sycl) ++ SET_TARGET_PROPERTIES(embree4_embree_sycl PROPERTIES OUTPUT_NAME embree${EMBREE_VERSION_MAJOR}_sycl) + + ENDIF() + +-SET_TARGET_PROPERTIES(embree PROPERTIES COMPILE_FLAGS "${FLAGS_LOWEST}") +-SET_TARGET_PROPERTIES(embree PROPERTIES COMPILE_DEFINITIONS "EMBREE_LOWEST_ISA") +-SET_PROPERTY(TARGET embree PROPERTY FOLDER kernels) ++SET_TARGET_PROPERTIES(embree4_embree PROPERTIES COMPILE_FLAGS "${FLAGS_LOWEST}") ++SET_TARGET_PROPERTIES(embree4_embree PROPERTIES COMPILE_DEFINITIONS "EMBREE_LOWEST_ISA") ++SET_PROPERTY(TARGET embree4_embree PROPERTY FOLDER kernels) + IF (NOT WIN32 AND NOT APPLE) +- ADD_CUSTOM_TARGET(embree_check_stack_frame_size COMMAND ${CMAKE_COMMAND} -D file=$ -P "${PROJECT_SOURCE_DIR}/common/cmake/check_stack_frame_size.cmake" DEPENDS embree) ++ ADD_CUSTOM_TARGET(embree_check_stack_frame_size COMMAND ${CMAKE_COMMAND} -D file=$ -P "${PROJECT_SOURCE_DIR}/common/cmake/check_stack_frame_size.cmake" DEPENDS embree4_embree) + ENDIF() + + #IF (EMBREE_ISA_SSE2 AND EMBREE_LIBRARY_FILES_SSE2) +@@ -292,68 +292,68 @@ ENDIF() + + IF (EMBREE_ISA_SSE42 AND EMBREE_LIBRARY_FILES_SSE42) + DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_SSE42}) +- ADD_LIBRARY(embree_sse42 STATIC ${EMBREE_LIBRARY_FILES_SSE42}) +- TARGET_LINK_LIBRARIES(embree_sse42 PRIVATE tasking) +- SET_TARGET_PROPERTIES(embree_sse42 PROPERTIES COMPILE_FLAGS "${FLAGS_SSE42}") +- SET_PROPERTY(TARGET embree_sse42 PROPERTY FOLDER kernels) +- SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_sse42) +- CheckGlobals(embree_sse42) ++ ADD_LIBRARY(embree4_embree_sse42 STATIC ${EMBREE_LIBRARY_FILES_SSE42}) ++ TARGET_LINK_LIBRARIES(embree4_embree_sse42 PRIVATE tasking) ++ SET_TARGET_PROPERTIES(embree4_embree_sse42 PROPERTIES COMPILE_FLAGS "${FLAGS_SSE42}") ++ SET_PROPERTY(TARGET embree4_embree_sse42 PROPERTY FOLDER kernels) ++ SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree4_embree_sse42) ++ CheckGlobals(embree4_embree_sse42) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_sse42 EXPORT embree_sse42-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_embree_sse42 EXPORT embree_sse42-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT embree_sse42-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() + ENDIF () + + IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX) + DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX}) +- ADD_LIBRARY(embree_avx STATIC ${EMBREE_LIBRARY_FILES_AVX}) +- TARGET_LINK_LIBRARIES(embree_avx PRIVATE tasking) +- SET_TARGET_PROPERTIES(embree_avx PROPERTIES COMPILE_FLAGS "${FLAGS_AVX}") +- SET_PROPERTY(TARGET embree_avx PROPERTY FOLDER kernels) +- SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx) +- CheckGlobals(embree_avx) ++ ADD_LIBRARY(embree4_embree_avx STATIC ${EMBREE_LIBRARY_FILES_AVX}) ++ TARGET_LINK_LIBRARIES(embree4_embree_avx PRIVATE tasking) ++ SET_TARGET_PROPERTIES(embree4_embree_avx PROPERTIES COMPILE_FLAGS "${FLAGS_AVX}") ++ SET_PROPERTY(TARGET embree4_embree_avx PROPERTY FOLDER kernels) ++ SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree4_embree_avx) ++ CheckGlobals(embree4_embree_avx) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_avx EXPORT embree_avx-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_embree_avx EXPORT embree_avx-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT embree_avx-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() + ENDIF() + + IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2) + DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2}) +- ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2}) +- TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking) +- SET_TARGET_PROPERTIES(embree_avx2 PROPERTIES COMPILE_FLAGS "${FLAGS_AVX2}") +- SET_PROPERTY(TARGET embree_avx2 PROPERTY FOLDER kernels) +- SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx2) +- CheckGlobals(embree_avx2) ++ ADD_LIBRARY(embree4_embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2}) ++ TARGET_LINK_LIBRARIES(embree4_embree_avx2 PRIVATE tasking) ++ SET_TARGET_PROPERTIES(embree4_embree_avx2 PROPERTIES COMPILE_FLAGS "${FLAGS_AVX2}") ++ SET_PROPERTY(TARGET embree4_embree_avx2 PROPERTY FOLDER kernels) ++ SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree4_embree_avx2) ++ CheckGlobals(embree4_embree_avx2) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_avx2 EXPORT embree_avx2-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_embree_avx2 EXPORT embree_avx2-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT embree_avx2-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() + ENDIF() + + IF (EMBREE_ISA_AVX512 AND EMBREE_LIBRARY_FILES_AVX512) + DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX512}) +- ADD_LIBRARY(embree_avx512 STATIC ${EMBREE_LIBRARY_FILES_AVX512}) +- TARGET_LINK_LIBRARIES(embree_avx512 PRIVATE tasking) +- SET_TARGET_PROPERTIES(embree_avx512 PROPERTIES COMPILE_FLAGS "${FLAGS_AVX512}") +- SET_PROPERTY(TARGET embree_avx512 PROPERTY FOLDER kernels) +- SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx512) +- CheckGlobals(embree_avx512) ++ ADD_LIBRARY(embree4_embree_avx512 STATIC ${EMBREE_LIBRARY_FILES_AVX512}) ++ TARGET_LINK_LIBRARIES(embree4_embree_avx512 PRIVATE tasking) ++ SET_TARGET_PROPERTIES(embree4_embree_avx512 PROPERTIES COMPILE_FLAGS "${FLAGS_AVX512}") ++ SET_PROPERTY(TARGET embree4_embree_avx512 PROPERTY FOLDER kernels) ++ SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree4_embree_avx512) ++ CheckGlobals(embree4_embree_avx512) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_avx512 EXPORT embree_avx512-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) ++ INSTALL(TARGETS embree4_embree_avx512 EXPORT embree_avx512-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) + INSTALL(EXPORT embree_avx512-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) + ENDIF() + ENDIF() + +-TARGET_LINK_LIBRARIES(embree PRIVATE ${EMBREE_LIBRARIES} sys math simd lexers tasking) ++TARGET_LINK_LIBRARIES(embree4_embree PRIVATE ${EMBREE_LIBRARIES} embree4_sys embree4_math embree4_simd embree4_lexers embree4_tasking) + IF (EMBREE_SYCL_SUPPORT) +- TARGET_LINK_LIBRARIES(embree PRIVATE ${SYCL_LIB_NAME} ze_wrapper PUBLIC embree_sycl) ++ TARGET_LINK_LIBRARIES(embree4_embree PRIVATE ${SYCL_LIB_NAME} ze_wrapper PUBLIC embree4_embree_sycl) + ENDIF() + + #TARGET_LINK_LIBRARIES(embree PRIVATE ${EMBREE_LIBRARIES} sys math simd lexers tasking ${CMAKE_LINK_FLAGS_SYCL}) # FIXME: enable this line +-SET_TARGET_PROPERTIES(embree PROPERTIES OUTPUT_NAME ${EMBREE_LIBRARY_NAME}) +-target_include_directories(embree PUBLIC ++SET_TARGET_PROPERTIES(embree4_embree PROPERTIES OUTPUT_NAME ${EMBREE_LIBRARY_NAME}) ++target_include_directories(embree4_embree PUBLIC + $ + $) + +@@ -361,27 +361,27 @@ target_include_directories(embree PUBLIC + # libtbb is located in same install folder as libembree + IF(WIN32) + ELSEIF(APPLE) +- SET_TARGET_PROPERTIES(embree PROPERTIES INSTALL_RPATH "@loader_path") # On MacOSX we tell dyld to find libtbb in the folder libembree is placed ++ SET_TARGET_PROPERTIES(embree4_embree PROPERTIES INSTALL_RPATH "@loader_path") # On MacOSX we tell dyld to find libtbb in the folder libembree is placed + ELSE() +- SET_TARGET_PROPERTIES(embree PROPERTIES INSTALL_RPATH "$ORIGIN") # Linux we tell ld to find libtbb in the folder libembree is placed. ++ SET_TARGET_PROPERTIES(embree4_embree PROPERTIES INSTALL_RPATH "$ORIGIN") # Linux we tell ld to find libtbb in the folder libembree is placed. + ENDIF() + + IF (WIN32) + ELSEIF (APPLE) +- SET_TARGET_PROPERTIES(embree PROPERTIES LINK_FLAGS -Wl,-exported_symbols_list,"${PROJECT_SOURCE_DIR}/kernels/export.macosx.map") +- SET_SOURCE_FILES_PROPERTIES(common/rtcore.cpp PROPERTIES OBJECT_DEPENDS "${PROJECT_SOURCE_DIR}/kernels/export.macosx.map") ++ SET_TARGET_PROPERTIES(embree4_embree PROPERTIES LINK_FLAGS -Wl,-exported_symbols_list,"${PROJECT_SOURCE_DIR}/kernels/export.macosx.map") ++ SET_SOURCE_FILES_PROPERTIES(common/rtcore.cpp PROPERTIES OBJECT_DEPENDS "${PROJECT_SOURCE_DIR}/kernels/export.macosx.map") + ELSE() +- SET_TARGET_PROPERTIES(embree PROPERTIES LINK_FLAGS -Wl,--version-script="${PROJECT_SOURCE_DIR}/kernels/export.linux.map") ++ SET_TARGET_PROPERTIES(embree4_embree PROPERTIES LINK_FLAGS -Wl,--version-script="${PROJECT_SOURCE_DIR}/kernels/export.linux.map") + SET_SOURCE_FILES_PROPERTIES(common/rtcore.cpp PROPERTIES OBJECT_DEPENDS "${PROJECT_SOURCE_DIR}/kernels/export.linux.map") + ENDIF() + + IF (EMBREE_ZIP_MODE) +- SET_TARGET_PROPERTIES(embree PROPERTIES VERSION ${EMBREE_VERSION_MAJOR} SOVERSION ${EMBREE_VERSION_MAJOR}) ++ SET_TARGET_PROPERTIES(embree4_embree PROPERTIES VERSION ${EMBREE_VERSION_MAJOR} SOVERSION ${EMBREE_VERSION_MAJOR}) + ELSE() +- SET_TARGET_PROPERTIES(embree PROPERTIES VERSION ${EMBREE_VERSION} SOVERSION ${EMBREE_VERSION_MAJOR}) ++ SET_TARGET_PROPERTIES(embree4_embree PROPERTIES VERSION ${EMBREE_VERSION} SOVERSION ${EMBREE_VERSION_MAJOR}) + ENDIF() + +-INSTALL(TARGETS embree EXPORT embree-targets ++INSTALL(TARGETS embree4_embree EXPORT embree-targets + LIBRARY NAMELINK_SKIP DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib + # on Windows put the dlls into bin + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT examples +@@ -394,9 +394,9 @@ INSTALL(EXPORT embree-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT + + # installs libembree4.so link + IF (NOT EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree ++ INSTALL(TARGETS embree4_embree + LIBRARY NAMELINK_ONLY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel + ) + ENDIF() + +-SIGN_TARGET(embree) ++SIGN_TARGET(embree4_embree) diff --git a/modules/raycasting/CMakeLists.txt b/modules/raycasting/CMakeLists.txt index 0c719a4f..703be955 100644 --- a/modules/raycasting/CMakeLists.txt +++ b/modules/raycasting/CMakeLists.txt @@ -13,14 +13,22 @@ lagrange_add_module() # 2. dependencies -lagrange_find_package(embree 3 CONFIG REQUIRED) lagrange_include_modules(bvh) target_link_libraries(lagrange_raycasting PUBLIC lagrange::core lagrange::bvh - embree::embree ) +option(LAGRANGE_WITH_EMBREE_4 "Use Embree4 with Lagrange" ON) +if(LAGRANGE_WITH_EMBREE_4) + lagrange_find_package(embree 4 CONFIG REQUIRED) + target_compile_definitions(lagrange_raycasting PUBLIC LAGRANGE_WITH_EMBREE_4) + target_link_libraries(lagrange_raycasting PUBLIC embree::embree4) +else() + lagrange_find_package(embree 3 CONFIG REQUIRED) + target_link_libraries(lagrange_raycasting PUBLIC embree::embree) +endif() + option(LAGRANGE_EMBREE_DEBUG "Perform error-checking when performing each single Embree call" OFF) if(LAGRANGE_EMBREE_DEBUG) target_compile_definitions(lagrange_raycasting PUBLIC LAGRANGE_EMBREE_DEBUG) diff --git a/modules/raycasting/include/lagrange/raycasting/EmbreeHelper.h b/modules/raycasting/include/lagrange/raycasting/EmbreeHelper.h index c3793877..8e2d0626 100644 --- a/modules/raycasting/include/lagrange/raycasting/EmbreeHelper.h +++ b/modules/raycasting/include/lagrange/raycasting/EmbreeHelper.h @@ -11,9 +11,15 @@ */ #pragma once -#include +#ifdef LAGRANGE_WITH_EMBREE_4 + #include +#else + #include +#endif #include +RTC_NAMESPACE_USE + namespace lagrange { namespace raycasting { namespace EmbreeHelper { diff --git a/modules/raycasting/include/lagrange/raycasting/EmbreeRayCaster.h b/modules/raycasting/include/lagrange/raycasting/EmbreeRayCaster.h index 31cb0bbf..7ad6dbfe 100644 --- a/modules/raycasting/include/lagrange/raycasting/EmbreeRayCaster.h +++ b/modules/raycasting/include/lagrange/raycasting/EmbreeRayCaster.h @@ -11,9 +11,16 @@ */ #pragma once -#include -#include -#include +#ifdef LAGRANGE_WITH_EMBREE_4 + #include + #include + #include +#else + #include + #include + #include +#endif + #include #include #include @@ -33,6 +40,8 @@ #include #include +RTC_NAMESPACE_USE + namespace lagrange { namespace raycasting { @@ -472,11 +481,13 @@ class EmbreeRayCaster for (int i = static_cast(batch_size); i < 4; ++i) packet_mask[i] = 0; ensure_no_errors_internal(); - { - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcIntersect4(packet_mask.data(), m_embree_world_scene, &context, &embree_raypacket); - } +#ifdef LAGRANGE_WITH_EMBREE_4 + rtcIntersect4(packet_mask.data(), m_embree_world_scene, &embree_raypacket); +#else + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcIntersect4(packet_mask.data(), m_embree_world_scene, &context, &embree_raypacket); +#endif ensure_no_errors_internal(); uint32_t is_hits = 0; @@ -582,11 +593,13 @@ class EmbreeRayCaster for (int i = static_cast(batch_size); i < 4; ++i) packet_mask[i] = 0; ensure_no_errors_internal(); - { - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcOccluded4(packet_mask.data(), m_embree_world_scene, &context, &embree_raypacket); - } +#ifdef LAGRANGE_WITH_EMBREE_4 + rtcOccluded4(packet_mask.data(), m_embree_world_scene, &embree_raypacket); +#else + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcOccluded4(packet_mask.data(), m_embree_world_scene, &context, &embree_raypacket); +#endif ensure_no_errors_internal(); // If hit, the tfar field will be set to -inf. @@ -634,11 +647,13 @@ class EmbreeRayCaster embree_rayhit.ray.id = 0; embree_rayhit.ray.flags = 0; ensure_no_errors_internal(); - { - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcIntersect1(m_embree_world_scene, &context, &embree_rayhit); - } +#ifdef LAGRANGE_WITH_EMBREE_4 + rtcIntersect1(m_embree_world_scene, &embree_rayhit); +#else + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcIntersect1(m_embree_world_scene, &context, &embree_rayhit); +#endif ensure_no_errors_internal(); if (embree_rayhit.hit.geomID != RTC_INVALID_GEOMETRY_ID) { @@ -722,11 +737,13 @@ class EmbreeRayCaster embree_ray.flags = 0; ensure_no_errors_internal(); - { - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcOccluded1(m_embree_world_scene, &context, &embree_ray); - } +#ifdef LAGRANGE_WITH_EMBREE_4 + rtcOccluded1(m_embree_world_scene, &embree_ray); +#else + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcOccluded1(m_embree_world_scene, &context, &embree_ray); +#endif ensure_no_errors_internal(); // If hit, the tfar field will be set to -inf. diff --git a/modules/raycasting/include/lagrange/raycasting/embree_closest_point.h b/modules/raycasting/include/lagrange/raycasting/embree_closest_point.h index 241135b8..a8be6833 100644 --- a/modules/raycasting/include/lagrange/raycasting/embree_closest_point.h +++ b/modules/raycasting/include/lagrange/raycasting/embree_closest_point.h @@ -11,11 +11,20 @@ #include -#include -#include -#include +#ifdef LAGRANGE_WITH_EMBREE_4 + #include + #include + #include +#else + #include + #include + #include +#endif + #include +RTC_NAMESPACE_USE + namespace lagrange { namespace raycasting { diff --git a/modules/raycasting/src/EmbreeHelper.cpp b/modules/raycasting/src/EmbreeHelper.cpp index 25b983f5..9a3bde91 100644 --- a/modules/raycasting/src/EmbreeHelper.cpp +++ b/modules/raycasting/src/EmbreeHelper.cpp @@ -9,7 +9,12 @@ * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -#include +#ifdef LAGRANGE_WITH_EMBREE_4 + #include +#else + #include +#endif + #include #include @@ -18,6 +23,7 @@ #include #include +RTC_NAMESPACE_USE void lagrange::raycasting::EmbreeHelper::ensure_no_errors(const RTCDevice& device) { From c89e2602537c2d58502db9fcd01cacca55c35b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 15:17:02 -0800 Subject: [PATCH 20/33] Run CI check on all target branches --- .github/workflows/continuous.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index e7dd456e..4d06d8b2 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -3,7 +3,7 @@ name: Build on: pull_request: branches: - - main + - '*' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} From 83ec15126afed1ac70294fc795b793a8c7636e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 15:18:05 -0800 Subject: [PATCH 21/33] Revert. --- .github/workflows/continuous.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 4d06d8b2..e7dd456e 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -3,7 +3,7 @@ name: Build on: pull_request: branches: - - '*' + - main concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} From 4312983a1637c97e93c324dd4eb4d8c8c2a29f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 15:37:00 -0800 Subject: [PATCH 22/33] Update build type. --- .github/workflows/continuous.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index e7dd456e..45c614e4 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -25,7 +25,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-24.04, macos-15-intel, macos-15] - config: [RelwithDebInfo, Debug] + config: [RelWithDebInfo, Debug] compiler: [gcc, apple, llvm] sanitizer: ["Address", "Thread"] # TODO: Add Memory+Undefined Sanitizer exclude: From 5109ac32592da5447f5d3f7c6bddbbad0ca6353a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 15:50:20 -0800 Subject: [PATCH 23/33] Update config. --- .github/workflows/continuous.yaml | 4 ++-- cmake/recipes/external/embree4.cmake | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 45c614e4..a9a13565 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -157,8 +157,8 @@ jobs: #################### Windows: - name: windows-2025 (${{ matrix.config }}) - runs-on: windows-2025 + name: ${{ matrix.os }} (${{ matrix.config }}) + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: diff --git a/cmake/recipes/external/embree4.cmake b/cmake/recipes/external/embree4.cmake index 8ff3c553..5175b431 100644 --- a/cmake/recipes/external/embree4.cmake +++ b/cmake/recipes/external/embree4.cmake @@ -105,8 +105,10 @@ function(embree4_import_target) GITHUB_REPOSITORY RenderKit/embree GIT_TAG v4.4.0 - # Maybe one day we'll have https://gitlab.kitware.com/cmake/cmake/-/issues/22687 - # Until then, if we want to compile both Embree3 and Embree4 side by side, we need patching + PATCHES + # Maybe one day we'll have https://gitlab.kitware.com/cmake/cmake/-/issues/22687 + # Until then, if we want to compile both Embree3 and Embree4 side by side, we need patching. + embree4.patch ) unignore_package(TBB) From 727aa72f7c9cf6ab1da6b681622fff84c46b3019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 16:09:35 -0800 Subject: [PATCH 24/33] Update sccache setup. --- .github/workflows/continuous.yaml | 20 ++++---------------- cmake/recipes/external/embree4.patch | 4 ++-- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index a9a13565..5d42ed36 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -180,28 +180,15 @@ jobs: - name: Install Ninja uses: seanmiddleditch/gha-setup-ninja@master - - name: Set env variable for sccache - run: | - echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV} - - name: Get number of CPU cores uses: SimenB/github-actions-cpu-cores@v1 id: cpu-cores - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: ${{ env.appdata }}\Mozilla\sccache - key: ${{ runner.os }}-${{ matrix.config }}-cache + - name: Configure sccache + run: echo "SCCACHE_GHA_ENABLED=true" >> ${env:GITHUB_ENV} - name: Prepare sccache - run: | - iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1' - .\install.ps1 -RunAsAdmin - scoop install sccache --global - # Scoop modifies the PATH so we make it available for the next steps of the job - echo "${env:PATH}" >> ${env:GITHUB_PATH} + uses: mozilla-actions/sccache-action@v0.0.9 # We run configure + build in the same step, since they both need to call VsDevCmd # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) @@ -217,6 +204,7 @@ jobs: -B "D:/build" ^ -S . cmake --build "D:/build" -j ${{ steps.cpu-cores.outputs.count }} + sccache --show-stats - name: Show disk space if: always() diff --git a/cmake/recipes/external/embree4.patch b/cmake/recipes/external/embree4.patch index 75c28184..b2e14a91 100644 --- a/cmake/recipes/external/embree4.patch +++ b/cmake/recipes/external/embree4.patch @@ -200,7 +200,7 @@ index bf790ef6..e2768e98 100644 INSTALL(EXPORT tasking-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) ENDIF() diff --git i/kernels/CMakeLists.txt w/kernels/CMakeLists.txt -index b8278079..da9824f3 100644 +index b8278079..33e8a3c6 100644 --- i/kernels/CMakeLists.txt +++ w/kernels/CMakeLists.txt @@ -31,7 +31,7 @@ SOURCE_GROUP("Source Files\\algorithms" "/algorithms/") @@ -336,7 +336,7 @@ index b8278079..da9824f3 100644 +SET_PROPERTY(TARGET embree4_embree PROPERTY FOLDER kernels) IF (NOT WIN32 AND NOT APPLE) - ADD_CUSTOM_TARGET(embree_check_stack_frame_size COMMAND ${CMAKE_COMMAND} -D file=$ -P "${PROJECT_SOURCE_DIR}/common/cmake/check_stack_frame_size.cmake" DEPENDS embree) -+ ADD_CUSTOM_TARGET(embree_check_stack_frame_size COMMAND ${CMAKE_COMMAND} -D file=$ -P "${PROJECT_SOURCE_DIR}/common/cmake/check_stack_frame_size.cmake" DEPENDS embree4_embree) ++ ADD_CUSTOM_TARGET(embree_check_stack_frame_size COMMAND ${CMAKE_COMMAND} -D file=$ -P "${PROJECT_SOURCE_DIR}/common/cmake/check_stack_frame_size.cmake" DEPENDS embree4_embree) ENDIF() #IF (EMBREE_ISA_SSE2 AND EMBREE_LIBRARY_FILES_SSE2) From 99acb1dafa629f139f99a63dab913bdba5b7e783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 16:25:53 -0800 Subject: [PATCH 25/33] Update sscache winarm action. --- .github/workflows/continuous.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 5d42ed36..abcbeda3 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -188,7 +188,9 @@ jobs: run: echo "SCCACHE_GHA_ENABLED=true" >> ${env:GITHUB_ENV} - name: Prepare sccache - uses: mozilla-actions/sccache-action@v0.0.9 + # Re-enable official action one https://github.com/Mozilla-Actions/sccache-action/pull/225 is merged + # uses: mozilla-actions/sccache-action@v0.0.9 + uses: Vee99BR/sccache-action@v0.0.1 # We run configure + build in the same step, since they both need to call VsDevCmd # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) @@ -204,7 +206,6 @@ jobs: -B "D:/build" ^ -S . cmake --build "D:/build" -j ${{ steps.cpu-cores.outputs.count }} - sccache --show-stats - name: Show disk space if: always() From d4c0c3dead631d2aa4563dbaeb38d8d60ddfa5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 16:48:36 -0800 Subject: [PATCH 26/33] Set build dir for winarm --- .github/workflows/continuous.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index abcbeda3..6d319bef 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -192,6 +192,14 @@ jobs: # uses: mozilla-actions/sccache-action@v0.0.9 uses: Vee99BR/sccache-action@v0.0.1 + - name: Set build folder + run: | + if ("${{ matrix.os }}" -eq "windows-2025") { + echo "BUILD_DIR=D:/build" >> ${env:GITHUB_ENV} + } else { + echo "BUILD_DIR=C:/build" >> ${env:GITHUB_ENV} + } + # We run configure + build in the same step, since they both need to call VsDevCmd # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) - name: Configure and build @@ -203,13 +211,14 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ -DLAGRANGE_JENKINS=ON ^ -DLAGRANGE_ALL=ON ^ - -B "D:/build" ^ + -B %BUILD_DIR% ^ -S . - cmake --build "D:/build" -j ${{ steps.cpu-cores.outputs.count }} + cmake --build %BUILD_DIR% -j ${{ steps.cpu-cores.outputs.count }} - name: Show disk space if: always() run: Get-PSDrive - name: Tests - run: cd "D:/build"; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} + run: cd %BUILD_DIR%; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} + shell: cmd From 8010e9e96340a21c4fe5bb41ca268c638620ab9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 17:14:55 -0800 Subject: [PATCH 27/33] Patch boost context for winarm. --- cmake/recipes/external/Boost.cmake | 9 ++++++--- cmake/recipes/external/Boost.winarm.patch | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 cmake/recipes/external/Boost.winarm.patch diff --git a/cmake/recipes/external/Boost.cmake b/cmake/recipes/external/Boost.cmake index fba630f0..1c88d522 100644 --- a/cmake/recipes/external/Boost.cmake +++ b/cmake/recipes/external/Boost.cmake @@ -84,12 +84,15 @@ if(SKBUILD) set(BUILD_SHARED_LIBS ON) endif() -set(BOOST_PATCHES "") +set(BOOST_PATCHES) if(EMSCRIPTEN) # Wasm doesn't have rounding mode control yet, so we trick Boost::interval into thinking it has. # https://github.com/WebAssembly/rounding-mode-control # https://github.com/boostorg/interval/issues/44 - set(BOOST_PATCHES PATCHES Boost.wasm.patch) + list(APPEND BOOST_PATCHES Boost.wasm.patch) +endif() +if(WIN32) + list(APPEND BOOST_PATCHES Boost.winarm.patch) endif() # Modern CMake target support was added in Boost 1.82.0 @@ -101,7 +104,7 @@ CPMAddPackage( GITHUB_REPOSITORY "boostorg/boost" GIT_TAG "boost-1.84.0" EXCLUDE_FROM_ALL ON - ${BOOST_PATCHES} + PATCHES ${BOOST_PATCHES} ) if(SKBUILD) diff --git a/cmake/recipes/external/Boost.winarm.patch b/cmake/recipes/external/Boost.winarm.patch new file mode 100644 index 00000000..907e8220 --- /dev/null +++ b/cmake/recipes/external/Boost.winarm.patch @@ -0,0 +1 @@ +Submodule libs/context contains modified content From 9512ca537dde9132a24ab36a02a2e1c98509ae21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 17:29:36 -0800 Subject: [PATCH 28/33] Fix patch. --- cmake/recipes/external/Boost.winarm.patch | 134 ++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/cmake/recipes/external/Boost.winarm.patch b/cmake/recipes/external/Boost.winarm.patch index 907e8220..b788d7d5 100644 --- a/cmake/recipes/external/Boost.winarm.patch +++ b/cmake/recipes/external/Boost.winarm.patch @@ -1 +1,135 @@ Submodule libs/context contains modified content +diff --git i/libs/context/CMakeLists.txt w/libs/context/CMakeLists.txt +index dca5349..089592f 100644 +--- i/libs/context/CMakeLists.txt ++++ w/libs/context/CMakeLists.txt +@@ -12,7 +12,7 @@ list(APPEND CMAKE_MODULE_PATH ${boost_context_SOURCE_DIR}/cmake) + + ## Binary format + +-if(WIN32) ++if(WIN32 OR CYGWIN) + set(_default_binfmt pe) + elseif(APPLE) + set(_default_binfmt mach-o) +@@ -31,7 +31,7 @@ math(EXPR _bits "${CMAKE_SIZEOF_VOID_P}*8") + + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^[Aa][Rr][Mm]" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(_default_abi aapcs) +-elseif(WIN32) ++elseif(WIN32 OR CYGWIN) + set(_default_abi ms) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") + if(_bits EQUAL 32) +@@ -60,6 +60,8 @@ elseif(_bits EQUAL 32) + set(_default_arch arm) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") + set(_default_arch mips32) ++ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc32)") ++ set(_default_arch ppc32) + else() + set(_default_arch i386) + endif() +@@ -69,6 +71,8 @@ else() + set(_default_arch arm64) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") + set(_default_arch mips64) ++ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc64)") ++ set(_default_arch ppc64) + else() + set(_default_arch x86_64) + endif() +@@ -89,18 +93,22 @@ if(MSVC) + else() + set(_default_asm masm) + endif() ++elseif(BOOST_CONTEXT_ARCHITECTURE STREQUAL arm64 AND MINGW) ++ set(_default_asm armclang) + else() + set(_default_asm gas) + endif() + +-set(BOOST_CONTEXT_ASSEMBLER "${_default_asm}" CACHE STRING "Boost.Context assembler (masm, gas, armasm)") +-set_property(CACHE BOOST_CONTEXT_ASSEMBLER PROPERTY STRINGS masm gas armasm) ++set(BOOST_CONTEXT_ASSEMBLER "${_default_asm}" CACHE STRING "Boost.Context assembler (masm, gas, armasm, armclang)") ++set_property(CACHE BOOST_CONTEXT_ASSEMBLER PROPERTY STRINGS masm gas armasm armclang) + + unset(_default_asm) + + ## Assembler source suffix + +-if(BOOST_CONTEXT_BINARY_FORMAT STREQUAL pe) ++if(BOOST_CONTEXT_ASSEMBLER STREQUAL armclang) ++ set(_default_ext .S) ++elseif(BOOST_CONTEXT_BINARY_FORMAT STREQUAL pe) + set(_default_ext .asm) + elseif(BOOST_CONTEXT_ASSEMBLER STREQUAL gas) + set(_default_ext .S) +@@ -133,18 +141,22 @@ message(STATUS "Boost.Context: " + "implementation ${BOOST_CONTEXT_IMPLEMENTATION}") + + # Enable the right assembler +- ++set(ASM_LANGUAGE) + if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "fcontext") +- if(BOOST_CONTEXT_ASSEMBLER STREQUAL gas) ++ if(BOOST_CONTEXT_ASSEMBLER STREQUAL gas OR BOOST_CONTEXT_ASSEMBLER STREQUAL armclang) + if(CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin") +- enable_language(ASM-ATT) ++ set(ASM_LANGUAGE ASM-ATT) + else() +- enable_language(ASM) ++ set(ASM_LANGUAGE ASM) + endif() + elseif(BOOST_CONTEXT_ASSEMBLER STREQUAL armasm) +- enable_language(ASM_ARMASM) ++ if(MSVC) ++ set(ASM_LANGUAGE ASM_MARMASM) ++ else() ++ set(ASM_LANGUAGE ASM_ARMASM) ++ endif() + else() +- enable_language(ASM_MASM) ++ set(ASM_LANGUAGE ASM_MASM) + endif() + endif() + +@@ -168,15 +180,31 @@ unset(_asm_suffix) + + if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "fcontext") + +- set(IMPL_SOURCES ${ASM_SOURCES}) ++ set(IMPL_SOURCES ${ASM_SOURCES} src/fcontext.cpp) + +- if(BOOST_CONTEXT_ASSEMBLER STREQUAL masm AND BOOST_CONTEXT_ARCHITECTURE STREQUAL i386) +- set_source_files_properties(${ASM_SOURCES} PROPERTIES COMPILE_FLAGS "/safeseh") +- endif() ++ if(BOOST_CONTEXT_ASSEMBLER STREQUAL masm) + +- if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +- set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp") +- endif() ++ set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "/nologo") ++ ++ if(MSVC AND NOT(MSVC_VERSION LESS 1936) AND NOT(CMAKE_CXX_SIMULATE_VERSION)) ++ set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "/quiet") ++ endif() ++ ++ if(BOOST_CONTEXT_ARCHITECTURE STREQUAL i386) ++ set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "/safeseh") ++ endif() ++ ++ # armasm doesn't support most of these options ++ elseif(NOT BOOST_CONTEXT_ASSEMBLER STREQUAL armasm) # masm ++ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ++ set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp") ++ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "-Wno-unused-command-line-argument") ++ endif() ++ endif() # masm ++ ++ enable_language(${ASM_LANGUAGE}) ++ set_source_files_properties(${ASM_SOURCES} PROPERTIES LANGUAGE ${ASM_LANGUAGE}) + else() + set(IMPL_SOURCES + src/continuation.cpp From 38a0c32fff8bcbf154750db06c1a662587dfb77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 17:42:15 -0800 Subject: [PATCH 29/33] Update patch. --- cmake/recipes/external/Boost.winarm.patch | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmake/recipes/external/Boost.winarm.patch b/cmake/recipes/external/Boost.winarm.patch index b788d7d5..fc6681aa 100644 --- a/cmake/recipes/external/Boost.winarm.patch +++ b/cmake/recipes/external/Boost.winarm.patch @@ -1,6 +1,6 @@ Submodule libs/context contains modified content diff --git i/libs/context/CMakeLists.txt w/libs/context/CMakeLists.txt -index dca5349..089592f 100644 +index dca5349..bd064b1 100644 --- i/libs/context/CMakeLists.txt +++ w/libs/context/CMakeLists.txt @@ -12,7 +12,7 @@ list(APPEND CMAKE_MODULE_PATH ${boost_context_SOURCE_DIR}/cmake) @@ -94,12 +94,9 @@ index dca5349..089592f 100644 endif() endif() -@@ -168,15 +180,31 @@ unset(_asm_suffix) +@@ -170,13 +182,29 @@ if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "fcontext") - if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "fcontext") - -- set(IMPL_SOURCES ${ASM_SOURCES}) -+ set(IMPL_SOURCES ${ASM_SOURCES} src/fcontext.cpp) + set(IMPL_SOURCES ${ASM_SOURCES}) - if(BOOST_CONTEXT_ASSEMBLER STREQUAL masm AND BOOST_CONTEXT_ARCHITECTURE STREQUAL i386) - set_source_files_properties(${ASM_SOURCES} PROPERTIES COMPILE_FLAGS "/safeseh") From 25e206a225640886731701d1490a82bf97de0baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 21:01:35 -0800 Subject: [PATCH 30/33] Update vs dev prompt setup. --- .github/workflows/continuous.yaml | 44 ++++++++++++++++++------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 6d319bef..4b7ebf1f 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -192,33 +192,41 @@ jobs: # uses: mozilla-actions/sccache-action@v0.0.9 uses: Vee99BR/sccache-action@v0.0.1 - - name: Set build folder + - name: Set x64 vars + if: runner.os == 'windows-2025' run: | - if ("${{ matrix.os }}" -eq "windows-2025") { echo "BUILD_DIR=D:/build" >> ${env:GITHUB_ENV} - } else { + echo "ARCH=x64" >> ${env:GITHUB_ENV} + + - name: Set arm64 vars + if: runner.os == 'windows-11-arm' + run: | echo "BUILD_DIR=C:/build" >> ${env:GITHUB_ENV} - } + echo "ARCH=arm64" >> ${env:GITHUB_ENV} - # We run configure + build in the same step, since they both need to call VsDevCmd - # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) - - name: Configure and build - shell: cmd + - name: Setup MSVC Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ env.ARCH }} + + # Cmd uses ^ to break commands into multiple lines, powershell uses ` + - name: Configure run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64 - cmake --version - cmake -G Ninja ^ - -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ - -DLAGRANGE_JENKINS=ON ^ - -DLAGRANGE_ALL=ON ^ - -B %BUILD_DIR% ^ + cmake --version ` + cmake -G Ninja ` + -DCMAKE_BUILD_TYPE=${{ matrix.config }} ` + -DLAGRANGE_JENKINS=ON ` + -DLAGRANGE_ALL=ON ` + -B ${{ env.BUILD_DIR }} ` -S . - cmake --build %BUILD_DIR% -j ${{ steps.cpu-cores.outputs.count }} + + - name: Build + run: | + cmake --build ${{ env.BUILD_DIR }} -j ${{ steps.cpu-cores.outputs.count }} - name: Show disk space if: always() run: Get-PSDrive - name: Tests - run: cd %BUILD_DIR%; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} - shell: cmd + run: cd ${{ env.BUILD_DIR }}; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} From 7afbec68eb1009e93feadae7e330026ecb871631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 21:27:22 -0800 Subject: [PATCH 31/33] Fix line break. --- .github/workflows/continuous.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 4b7ebf1f..593c7b4d 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -212,7 +212,7 @@ jobs: # Cmd uses ^ to break commands into multiple lines, powershell uses ` - name: Configure run: | - cmake --version ` + cmake --version cmake -G Ninja ` -DCMAKE_BUILD_TYPE=${{ matrix.config }} ` -DLAGRANGE_JENKINS=ON ` From c0593e99cc03d00af05d108d064a4bf5c5293458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Fri, 14 Nov 2025 22:07:55 -0800 Subject: [PATCH 32/33] Update config. --- .github/workflows/continuous.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 593c7b4d..7f8e6937 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -193,13 +193,13 @@ jobs: uses: Vee99BR/sccache-action@v0.0.1 - name: Set x64 vars - if: runner.os == 'windows-2025' + if: matrix.os == 'windows-2025' run: | echo "BUILD_DIR=D:/build" >> ${env:GITHUB_ENV} echo "ARCH=x64" >> ${env:GITHUB_ENV} - name: Set arm64 vars - if: runner.os == 'windows-11-arm' + if: matrix.os == 'windows-11-arm' run: | echo "BUILD_DIR=C:/build" >> ${env:GITHUB_ENV} echo "ARCH=arm64" >> ${env:GITHUB_ENV} From 195867a898a552e639160e89ce6fcb5ae910db08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20Dumas?= Date: Tue, 18 Nov 2025 10:02:03 -0800 Subject: [PATCH 33/33] Try out winarm branch for embree. --- .github/workflows/continuous.yaml | 2 +- cmake/recipes/external/embree4.cmake | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 7f8e6937..68605e5d 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -216,7 +216,7 @@ jobs: cmake -G Ninja ` -DCMAKE_BUILD_TYPE=${{ matrix.config }} ` -DLAGRANGE_JENKINS=ON ` - -DLAGRANGE_ALL=ON ` + -DLAGRANGE_MODULE_RAYCASTING=ON ` -B ${{ env.BUILD_DIR }} ` -S . diff --git a/cmake/recipes/external/embree4.cmake b/cmake/recipes/external/embree4.cmake index 5175b431..5e5f0eba 100644 --- a/cmake/recipes/external/embree4.cmake +++ b/cmake/recipes/external/embree4.cmake @@ -100,15 +100,16 @@ function(embree4_import_target) # Ready to include embree's atrocious CMake include(CPM) + set(CMAKE_POLICY_VERSION_MINIMUM 3.5) CPMAddPackage( NAME embree4 - GITHUB_REPOSITORY RenderKit/embree - GIT_TAG v4.4.0 + GITHUB_REPOSITORY anthony-linaro/embree + GIT_TAG f4d986c7707b6c8c4e95dba25ed7a035c67925ff - PATCHES - # Maybe one day we'll have https://gitlab.kitware.com/cmake/cmake/-/issues/22687 - # Until then, if we want to compile both Embree3 and Embree4 side by side, we need patching. - embree4.patch + # PATCHES + # # Maybe one day we'll have https://gitlab.kitware.com/cmake/cmake/-/issues/22687 + # # Until then, if we want to compile both Embree3 and Embree4 side by side, we need patching. + # embree4.patch ) unignore_package(TBB) @@ -120,21 +121,21 @@ function(embree4_import_target) # for misfiring warnings. See https://github.com/embree/embree/issues/271 # # The issue should be fixed for gcc 9.2.1 and later. - target_compile_options(embree4_embree PRIVATE "-Wno-array-bounds") + target_compile_options(embree PRIVATE "-Wno-array-bounds") endif() # Warning setting set(unix_compilers "AppleClang;Clang;GNU") if(CMAKE_CXX_COMPILER_ID IN_LIST unix_compilers) # IN_LIST wants the second arg to be a var - target_compile_options(embree4_embree PRIVATE "-Wno-unused-private-field") - target_compile_options(embree4_embree PRIVATE "-Wno-unused-but-set-variable") + target_compile_options(embree PRIVATE "-Wno-unused-private-field") + target_compile_options(embree PRIVATE "-Wno-unused-but-set-variable") endif() # Now we need to do some juggling to propagate the include directory properties # along with the `embree` target add_library(embree::embree4 INTERFACE IMPORTED GLOBAL) target_include_directories(embree::embree4 SYSTEM INTERFACE ${embree4_SOURCE_DIR}/include) - target_link_libraries(embree::embree4 INTERFACE embree4_embree) + target_link_libraries(embree::embree4 INTERFACE embree) # Generate a dummy .cpp for embree's math library, to workaround a weird link issue with # LLVM-Clang on macOS @@ -145,7 +146,7 @@ function(embree4_import_target) } ]]) configure_file(${embree4_BINARY_DIR}/embree_math_dummy.cpp.in ${embree4_BINARY_DIR}/embree_math_dummy.cpp COPYONLY) - target_sources(embree4_math PRIVATE ${embree4_BINARY_DIR}/embree_math_dummy.cpp) + target_sources(math PRIVATE ${embree4_BINARY_DIR}/embree_math_dummy.cpp) endfunction() # Call via a proper function in order to scope variables such as CMAKE_FIND_PACKAGE_PREFER_CONFIG and TBB_DIR @@ -154,6 +155,6 @@ embree4_import_target() # Cleanup for IDEs foreach(name IN ITEMS embree algorithms lexers math simd sys tasking uninstall) if(TARGET ${name}) - set_target_properties(embree4_${name} PROPERTIES FOLDER "third_party//embree4") + set_target_properties(${name} PROPERTIES FOLDER "third_party//embree4") endif() endforeach()