From fb11b9f700e9bc1970c6fb3b400888310eda1059 Mon Sep 17 00:00:00 2001 From: Frederick ROY Date: Thu, 28 Nov 2024 11:49:56 +0100 Subject: [PATCH] Squashed commit of the following: commit f9ca1aed6ec89e4521b74382484ace41d6ffcd2f Author: Jean-Nicolas Brunet Date: Tue Aug 8 09:17:42 2023 -0400 Windows compatibility commit 385403bf1a6ae69ca728c90fa6265954d11c9bd0 Author: Jean-Nicolas Brunet Date: Tue Aug 8 08:55:55 2023 -0400 Windows compatibility commit 6339704fe4f893d98fadedb1a43fe5bc48a3e6cf Author: Jean-Nicolas Brunet Date: Mon Aug 7 21:50:23 2023 -0400 Windows compatibility commit a1ab1d95a4bd7abbb22ebcff695c7a2a25536a53 Author: Jean-Nicolas Brunet Date: Mon Aug 7 20:02:54 2023 -0400 Windows compatibility commit 34dbe28ad82bbb53335d43d702c77aa6cb647a02 Author: Jean-Nicolas Brunet Date: Thu Aug 3 22:15:26 2023 -0400 Windows compatibility commit 8984c380e3571166ae13616865b60a0585a1ffeb Author: Jean-Nicolas Brunet Date: Thu Aug 3 22:02:25 2023 -0400 Windows compatibility commit 90ce4cedffb7cf4a6dac5f9881a8dfab50c82b19 Merge: 15f9b91 2aa665c Author: Jean-Nicolas Brunet Date: Tue Jun 27 19:41:58 2023 -0400 Merge remote-tracking branch 'origin/master' into windows_workflow # Conflicts: # .github/workflows/macos.yml # .github/workflows/ubuntu.yml # src/SofaCaribou/Algebra/EigenMatrix.h # src/SofaCaribou/Algebra/EigenVector.h # unittest/SofaCaribou/Mass/test_cariboumass.cpp commit 15f9b91cfc4af41e5a92eefb845c40c6589938c6 Author: Jean-Nicolas Brunet Date: Wed Jun 22 21:11:33 2022 -0400 temp commit 6d9d0b8ce3e88ed66199787ad87e138d85dff0fc Author: Jean-Nicolas Brunet Date: Fri May 27 22:07:23 2022 -0400 [wip] Windows workflow commit 01ee3db8241288d6e12242fb3002942323fe9d85 Author: Jean-Nicolas Brunet Date: Fri May 27 21:30:24 2022 -0400 [wip] Windows workflow commit c31d85b062e0bf51f6325379fbb43bc408f1a166 Author: Jean-Nicolas Brunet Date: Sat May 7 14:27:22 2022 -0400 [wip] Windows workflow commit 5fbb7043a015edde8b12a8d99b5daed9a55c94bb Author: Jean-Nicolas Brunet Date: Sat May 7 13:47:16 2022 -0400 [wip] Windows workflow commit 1e61133d878697ddde908082f0aaeb49a33230cf Author: Jean-Nicolas Brunet Date: Fri May 6 20:48:42 2022 -0400 [wip] Windows workflow commit c1eaeb7fda492dadbf844360c30d311c0c833499 Author: Jean-Nicolas Brunet Date: Thu May 5 11:41:52 2022 -0400 [wip] Windows workflow commit 6957494d3ee28b967e366cb0f57eb50e838fae10 Author: Jean-Nicolas Brunet Date: Thu Mar 31 10:22:13 2022 -0400 [wip] Windows workflow commit 57deb1d9f40f9f710ecc48b7ff0afcd351494a1c Author: Jean-Nicolas Brunet Date: Sat Sep 18 09:58:16 2021 -0400 [wip] Windows workflow --- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows.yml | 251 ++++++++++++++++++ CMakeLists.txt | 23 +- cmake/FindSOFA.cmake | 15 +- src/SofaCaribou/Algebra/EigenMatrix.h | 17 +- src/SofaCaribou/CMakeLists.txt | 14 +- unittest/Caribou/Geometry/CMakeLists.txt | 2 + unittest/SofaCaribou/CMakeLists.txt | 6 +- .../test_hyperelasticforcefield.cpp | 1 + 9 files changed, 292 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index fca4b794..3e0cf6ec 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -37,7 +37,7 @@ jobs: git config --global user.email "caribou@github.com" git config --global user.name "Caribou Github" git fetch origin - git rebase origin/master + git merge origin/master - name: Install pybind11 if: ${{ matrix.PYBIND11_VERSION != '2.4' }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..6240fccc --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,251 @@ +name: Windows + +on: + pull_request: + branches: + - master + schedule: + # Runs every day at 23:15 + - cron: '15 23 * * *' + +jobs: + build: + name: Building with ${{ matrix.sofa_version }} + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + sofa_version: [ master ] + include: + - sofa_version: master + PYTHON_VERSION: 3.8 + EIGEN_VERSION: 3.4 + PYBIND11_VERSION: 2.4.3 +# - sofa_version: v21.12.00 +# PYTHON_VERSION: 3.7 +# EIGEN_VERSION: 3.3.7 +# PYBIND11_VERSION: 2.4.3 + env: + SOFA_VERSION: ${{ matrix.sofa_version }} + SOFA_ROOT: ${{ format('{0}/sofa', github.workspace) }} + PYBIND11_ROOT: ${{ format('{0}/pybind11', github.workspace) }} + PYBIND11_VERSION: ${{ matrix.PYBIND11_VERSION }} + QT_ROOT: ${{ format('{0}/qt', github.workspace) }} + PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} + BOOST_ROOT: ${{ format('{0}/boost', github.workspace) }} + EIGEN_ROOT: ${{ format('{0}/eigen', github.workspace) }} + EIGEN_VERSION: ${{ matrix.EIGEN_VERSION }} + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - run: | + git config --global user.email "caribou@github.com" + git config --global user.name "Caribou Github" + git fetch origin + git merge origin/master + +# Python + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.PYTHON_VERSION }} + +# Eigen3 + - name: cache eigen + uses: actions/cache@v2 + id: cache-eigen + with: + path: ${{ github.workspace }}/eigen + key: eigen-${{ matrix.EIGEN_VERSION }}-windows + - name: Install Eigen + if: steps.cache-eigen.outputs.cache-hit != 'true' + shell: bash + run: | + git clone --depth 1 -b $EIGEN_VERSION https://gitlab.com/libeigen/eigen.git eigen_src + cmake -S eigen_src -B eigen_src/build -DCMAKE_BUILD_TYPE=Release -DEIGEN_BUILD_DOC=OFF -DCMAKE_INSTALL_PREFIX="$EIGEN_ROOT" + cmake --build eigen_src/build --target install + +# PYBIND11 + - name: Install pybind11 + shell: bash + run: | + git clone --depth 1 -b v$PYBIND11_VERSION https://github.com/pybind/pybind11.git pybind11_src + cmake -S pybind11_src -B pybind11_src/build -DPYBIND11_TEST=OFF -DCMAKE_BUILD_TYPE=Release -DPYBIND11_FINDPYTHON=ON + cmake --install pybind11_src/build --prefix $PYBIND11_ROOT + rm -rf pybind11_src + +# BOOST + - name: Cache Boost + id: cache-Boost + uses: actions/cache@v1 + with: + path: ${{ format('{0}/boost', github.workspace) }} + key: boost-1.69.0-windows + + - name: Install Boost + if: steps.cache-Boost.outputs.cache-hit != 'true' + run: | + $BOOST_MAJOR = 1 + $BOOST_MINOR = 69 + $BOOST_PATCH = 0 + Invoke-WebRequest "https://boost.teeks99.com/bin/$($BOOST_MAJOR).$($BOOST_MINOR).$($BOOST_PATCH)/boost_$($BOOST_MAJOR)_$($BOOST_MINOR)_$($BOOST_PATCH)-msvc-14.1-64.exe" -OutFile boostinstaller.exe + ./boostinstaller.exe /NORESTART /VERYSILENT /DIR="$($BOOST_ROOT)" | Out-Null + rm -Force boostinstaller.exe + +# SOFA + - name: Download SOFA Release + shell: bash + run: | + if [ "$SOFA_VERSION" = "master" ]; then + curl --output sofa.zip -L "https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=master,CI_SCOPE=standard/lastSuccessfulBuild/artifact/Windows/*zip*/Windows.zip" + unzip sofa.zip -d temp + mv temp/Windows/`ls temp/Windows` sofa.zip + rm -rf temp + unzip sofa.zip -d temp + mv temp/`ls temp` $SOFA_ROOT + rm -rf temp + else + curl --output sofa.zip -L "https://github.com/sofa-framework/sofa/releases/download/$SOFA_VERSION/SOFA_"$SOFA_VERSION"_Win64.zip" + unzip sofa.zip -d temp + mv temp/`ls temp` $SOFA_ROOT + fi + + # Patch SP3 absolute path + sed -i 's/C:\/pybind11\/[0-9].[0-9].[0-9]\/install\/include;//' $SOFA_ROOT/plugins/SofaPython3/lib/cmake/SofaPython3/PluginTargets.cmake + +# SOFA DEPENDENCY PACK + - name: Download SOFA Dependency pack + shell: bash + run: | + curl --output sofa_dependency.zip -L "https://www.sofa-framework.org/download/WinDepPack/VS-2017/latest" + unzip sofa_dependency.zip -d temp + mv temp/`ls temp` $SOFA_ROOT/windows_dependency + rm -rf temp + +# QT + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ${{ format('{0}/qt', github.workspace) }} + key: qt-5.12.6-windows + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: '5.12.6' + dir: ${{ format('{0}/qt', github.workspace) }} + cached: ${{ steps.cache-qt.outputs.cache-hit }} + modules: 'qtcharts qtwebengine' + +# CARIBOU + - name: Build caribou + shell: bash + run: + cmake -DCMAKE_BUILD_TYPE=Release + -Dpybind11_DIR=$PYBIND11_ROOT + -DEigen3_ROOT=$EIGEN_ROOT + -DCMAKE_INCLUDE_PATH=$SOFA_ROOT/windows_dependency/include + -DCMAKE_LIBRARY_PATH=$SOFA_ROOT/windows_dependency/lib/win64 + -DQt5_ROOT=$QT_ROOT\5.12.5\msvc2017_64 + -DCMAKE_INSTALL_PREFIX=$SOFA_ROOT/plugins/SofaCaribou + -DCARIBOU_WITH_PYTHON_3=OFF + . + && cmake --build . --config Release + && cmake --install . + +# ZIP + - name: Zip production + run: Compress-Archive -LiteralPath "$($env:SOFA_ROOT)/plugins/SofaCaribou" -DestinationPath SofaCaribou.zip + +# ARCHIVE + - name: Archive production + uses: actions/upload-artifact@v2 + with: + name: caribou_win64_${{ matrix.sofa_version }} + path: SofaCaribou.zip + + test: + name: Testing with ${{ matrix.sofa_version }} + needs: [build] + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + sofa_version: [ master ] + include: + - sofa_version: master + PYTHON_VERSION: 3.8.10 +# - sofa_version: v21.12.00 +# PYTHON_VERSION: 3.7 + env: + SOFA_VERSION: ${{ matrix.sofa_version }} + SOFA_ROOT: ${{ format('{0}\sofa', github.workspace) }} + CARIBOU_ROOT: ${{ format('{0}\sofa\plugins\SofaCaribou', github.workspace) }} + + steps: +# Python + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.PYTHON_VERSION }} + +# PATH + - run: echo "${$env:SOFA_ROOT}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + +# SOFA + - name: Download SOFA Release + shell: bash + run: | + if [ "$SOFA_VERSION" = "master" ]; then + curl --output sofa.zip -L "https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=master,CI_SCOPE=standard/lastSuccessfulBuild/artifact/Windows/*zip*/Windows.zip" + unzip sofa.zip -d temp + mv temp/Windows/`ls temp/Windows` sofa.zip + rm -rf temp + unzip sofa.zip -d temp + mv temp/`ls temp` $SOFA_ROOT + rm -rf temp + else + curl --output sofa.zip -L "https://github.com/sofa-framework/sofa/releases/download/$SOFA_VERSION/SOFA_"$SOFA_VERSION"_Win64.zip" + unzip sofa.zip -d temp + mv temp/`ls temp` $SOFA_ROOT + fi + +# CARIBOU + - name: Download caribou + uses: actions/download-artifact@v2 + with: + name: caribou_win64_${{ matrix.sofa_version }} + - name: Install caribou + run: Expand-Archive -Path SofaCaribou.zip -DestinationPath "${$env:SOFA_ROOT}\plugins" + + - name: Caribou.unittests.Geometry + if: ${{ always() }} + shell: bash + run: | + export PATH="$SOFA_ROOT/bin:$PATH" + $CARIBOU_ROOT/bin/Caribou.unittests.Geometry.exe + + - name: Caribou.unittests.Topology + if: ${{ always() }} + shell: bash + run: | + export PATH="$SOFA_ROOT/bin:$PATH" + $CARIBOU_ROOT/bin/Caribou.unittests.Topology.exe + + - name: Caribou.unittests.Mechanics + if: ${{ always() }} + shell: bash + run: | + export PATH="$SOFA_ROOT/bin:$PATH" + $CARIBOU_ROOT/bin/Caribou.unittests.Mechanics.exe + + - name: Caribou.unittests.SofaCaribou + if: ${{ always() }} + shell: bash + run: | + export PATH="$SOFA_ROOT/bin:$PATH" + $CARIBOU_ROOT/bin/Caribou.unittests.SofaCaribou.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eb2b5d2..28bf2764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,16 +50,19 @@ CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) # OPTIONS option(CARIBOU_USE_FLOAT "Use float precision for floating point values." OFF) +option(CARIBOU_WITH_PYTHON_3 "Compile the plugin with python 3 support" OFF) CMAKE_DEPENDENT_OPTION(CARIBOU_OPTIMIZE_FOR_NATIVE "Build with -march=native to allow msse support" ON "COMPILER_SUPPORTS_MARCH_NATIVE" OFF) # SOFA option find_package(Threads QUIET) -find_package(SOFA COMPONENTS SofaFramework QUIET) +find_package(SOFA COMPONENTS Sofa.Framework QUIET) CMAKE_DEPENDENT_OPTION(CARIBOU_WITH_SOFA "Compile the SofaCaribou library" ON "SOFA_FOUND" OFF) if (CARIBOU_WITH_SOFA) list(APPEND CMAKE_PREFIX_PATH ${SOFA_MODULE_DIR}) list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH) - find_package(SofaPython3 QUIET) # We need to do this first to setup the exact python version required + if (CARIBOU_WITH_PYTHON_3) + find_package(SofaPython3 QUIET) # We need to do this first to setup the exact python version required + endif() endif() # Tests @@ -94,21 +97,27 @@ else() endif() # Python 3 option -if (CARIBOU_WITH_SOFA) +if (CARIBOU_WITH_SOFA AND CARIBOU_WITH_PYTHON_3) sofa_find_package(SofaPython3 QUIET) endif() set(CMAKE_CXX_STANDARD 17) set(PYBIND11_FINDPYTHON ON) set(PYBIND11_PYTHON_VERSION 3) set(Python_FIND_FRAMEWORK LAST) -find_package(SofaPython3 QUIET) +if (CARIBOU_WITH_SOFA AND CARIBOU_WITH_PYTHON_3) + find_package(SofaPython3 QUIET) +endif() if (SofaPython3_FOUND) set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) set(PYBIND11_PYTHON_VERSION ${PYTHON_VERSION}) endif() find_package(Python ${PYBIND11_PYTHON_VERSION} COMPONENTS Interpreter Development QUIET) find_package(pybind11 CONFIG QUIET) -CMAKE_DEPENDENT_OPTION(CARIBOU_WITH_PYTHON_3 "Compile the plugin with python 3 support" ON "Python_FOUND;pybind11_FOUND" OFF) +if (CARIBOU_WITH_PYTHON_3 AND (NOT Python_FOUND OR NOT pybind11_FOUND)) + SET(CARIBOU_WITH_PYTHON_3 OFF) + message(ERROR "Caribou is set to be compiled with python support, but pybind11 cannot be resolved.") +endif() + if (CARIBOU_WITH_PYTHON_3) message(STATUS "Caribou with Python support: Version: ${Python_VERSION} @@ -122,10 +131,10 @@ endif() # SOFA Python 3 if (CARIBOU_WITH_SOFA) - get_filename_component(SOFA_ROOT_DIR "${SofaFramework_DIR}/../../.." ABSOLUTE) + get_filename_component(SOFA_ROOT_DIR "${Sofa.Framework_DIR}/../../.." ABSOLUTE) message(STATUS "Caribou with SOFA support\n" - " SOFA version: ${SofaFramework_VERSION}\n" + " SOFA version: ${Sofa.Framework_VERSION}\n" " SOFA location: ${SOFA_ROOT_DIR}" ) if (CARIBOU_WITH_PYTHON_3) diff --git a/cmake/FindSOFA.cmake b/cmake/FindSOFA.cmake index 1f0db7b0..f282629d 100644 --- a/cmake/FindSOFA.cmake +++ b/cmake/FindSOFA.cmake @@ -15,8 +15,11 @@ # endif() ################################################################################ +# In cases quotes were added to the SOFA_ROOT env variable +STRING(REPLACE "\"" "" SOFA_ROOT_ENV $ENV{SOFA_ROOT}) + # Try to find SOFA's cmake module directory -find_package(SofaFramework CONFIG QUIET) # This defines SOFA_ROOT if SofaFrameworkConfig.cmake is found +find_package(Sofa.Framework CONFIG QUIET) # This defines SOFA_ROOT if SofaFrameworkConfig.cmake is found find_path ( SOFA_MODULE_DIR SofaFramework/SofaFrameworkConfig.cmake PATHS @@ -24,10 +27,10 @@ find_path ( ${SOFA_ROOT}/install/lib/cmake ${SOFA_ROOT}/build/install/lib/cmake ${SOFA_ROOT}/build/master/install/lib/cmake - $ENV{SOFA_ROOT}/lib/cmake - $ENV{SOFA_ROOT}/install/lib/cmake - $ENV{SOFA_ROOT}/build/install/lib/cmake - $ENV{SOFA_ROOT}/build/master/install/lib/cmake + ${SOFA_ROOT_ENV}/lib/cmake + ${SOFA_ROOT_ENV}/install/lib/cmake + ${SOFA_ROOT_ENV}/build/install/lib/cmake + ${SOFA_ROOT_ENV}/build/master/install/lib/cmake ) if (SOFA_MODULE_DIR) @@ -63,7 +66,7 @@ if (NOT SOFA_FIND_COMPONENTS) endif() # Compatibility layer -set(SOFA_VERSION ${SofaFramework_VERSION}) +set(SOFA_VERSION ${Sofa.Framework_VERSION}) foreach(component ${SOFA_FIND_COMPONENTS}) if (SOFA_VERSION VERSION_LESS "22.06.99") string(REGEX REPLACE "Sofa.Simulation.*" "SofaSimulation" component ${component}) diff --git a/src/SofaCaribou/Algebra/EigenMatrix.h b/src/SofaCaribou/Algebra/EigenMatrix.h index 9e7a18dd..547f3a89 100644 --- a/src/SofaCaribou/Algebra/EigenMatrix.h +++ b/src/SofaCaribou/Algebra/EigenMatrix.h @@ -5,23 +5,8 @@ DISABLE_ALL_WARNINGS_BEGIN #include -#include DISABLE_ALL_WARNINGS_END - -#if (defined(SOFA_VERSION) && SOFA_VERSION < 201200) -namespace sofa { using Size = unsigned int; } -#endif - -#if (defined(SOFA_VERSION) && SOFA_VERSION < 210600) -namespace sofa::type { -using Mat3x3d = ::sofa::defaulttype::Mat3x3d; -using Mat3x3f = ::sofa::defaulttype::Mat3x3f; -using Mat2x2d = ::sofa::defaulttype::Mat2x2d; -using Mat2x2f = ::sofa::defaulttype::Mat2x2f; -template -using Mat = ::sofa::defaulttype::Mat; -} -#endif +#include #include diff --git a/src/SofaCaribou/CMakeLists.txt b/src/SofaCaribou/CMakeLists.txt index 2e516ada..9b352e96 100644 --- a/src/SofaCaribou/CMakeLists.txt +++ b/src/SofaCaribou/CMakeLists.txt @@ -146,7 +146,7 @@ if (NOT TARGET Caribou::Algebra) endif() # Sofa's packages -find_package(SOFA COMPONENTS SofaFramework Sofa.Component.LinearSolver.Iterative Sofa.Component.Topology.Container.Grid Sofa.Component.Topology.Container.Constant Sofa.Component.Topology.Container.Dynamic Sofa.LinearAlgebra QUIET REQUIRED) +find_package(SOFA COMPONENTS Sofa.Framework Sofa.Component.LinearSolver.Iterative Sofa.Component.Topology.Container.Grid Sofa.Component.Topology.Container.Constant Sofa.Component.Topology.Container.Dynamic Sofa.LinearAlgebra QUIET REQUIRED) # Optional packages find_package(Eigen3 QUIET REQUIRED) @@ -159,7 +159,7 @@ endif() add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${TEMPLATE_FILES} ${HEADER_FILES}) add_library(Caribou::Plugin ALIAS ${PROJECT_NAME}) -target_link_libraries(${PROJECT_NAME} PUBLIC SofaCore Sofa.Component.Topology.Container.Grid Sofa.Component.Topology.Container.Constant Sofa.Component.Topology.Container.Dynamic Sofa.Component.LinearSolver.Iterative Sofa.LinearAlgebra) +target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.Topology.Container.Grid Sofa.Component.Topology.Container.Constant Sofa.Component.Topology.Container.Dynamic Sofa.Component.LinearSolver.Iterative Sofa.LinearAlgebra) target_link_libraries(${PROJECT_NAME} PUBLIC Caribou::Algebra Caribou::Geometry Caribou::Topology Caribou::Mechanics) target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) @@ -215,10 +215,12 @@ caribou_add_target_to_component ( HEADER_SRC_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.." ) -find_package(SofaPython3 QUIET) -if (CARIBOU_WITH_SOFA AND SofaPython3_FOUND AND CARIBOU_WITH_PYTHON_3) - add_subdirectory(Python) - set(CARIBOU_WITH_SP3 ON) +if (CARIBOU_WITH_PYTHON_3) + find_package(SofaPython3 QUIET) + if (CARIBOU_WITH_SOFA AND SofaPython3_FOUND) + add_subdirectory(Python) + set(CARIBOU_WITH_SP3 ON) + endif() endif() install ( diff --git a/unittest/Caribou/Geometry/CMakeLists.txt b/unittest/Caribou/Geometry/CMakeLists.txt index 4dc11839..b7012d6e 100644 --- a/unittest/Caribou/Geometry/CMakeLists.txt +++ b/unittest/Caribou/Geometry/CMakeLists.txt @@ -16,6 +16,8 @@ target_link_libraries(${PROJECT_NAME} Caribou::Geometry Caribou::Config) if (NOT WIN32) target_link_libraries(${PROJECT_NAME} pthread) +elseif(MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /bigobj) endif() list(APPEND target_rpath diff --git a/unittest/SofaCaribou/CMakeLists.txt b/unittest/SofaCaribou/CMakeLists.txt index 0ab493de..a0b1ea38 100644 --- a/unittest/SofaCaribou/CMakeLists.txt +++ b/unittest/SofaCaribou/CMakeLists.txt @@ -15,7 +15,7 @@ set(SOURCE_FILES enable_testing() -find_package(SOFA COMPONENTS SofaFramework Sofa.Simulation.Graph Sofa.Component.StateContainer Sofa.Component.Mass Sofa.Component.SceneUtility Sofa.Component.LinearSolver.Iterative Sofa.Component.Mass Sofa.Component.SolidMechanics.FEM.Elastic QUIET REQUIRED) +find_package(SOFA COMPONENTS Sofa.Framework Sofa.Simulation.Graph Sofa.Component.StateContainer Sofa.Component.Mass Sofa.Component.SceneUtility Sofa.Component.LinearSolver.Iterative Sofa.Component.Mass Sofa.Component.SolidMechanics.FEM.Elastic QUIET REQUIRED) find_package(Caribou COMPONENTS Topology REQUIRED) find_package(Threads REQUIRED) @@ -31,11 +31,11 @@ endif() target_link_libraries(${PROJECT_NAME} PUBLIC gtest) target_link_libraries(${PROJECT_NAME} PUBLIC SofaCaribou) -target_link_libraries(${PROJECT_NAME} PUBLIC SofaHelper Sofa.Component.StateContainer Sofa.Component.Mass Sofa.Component.SceneUtility Sofa.Component.LinearSolver.Iterative Sofa.Component.SolidMechanics.FEM.Elastic) +target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Helper Sofa.Component.StateContainer Sofa.Component.Mass Sofa.Component.SceneUtility Sofa.Component.LinearSolver.Iterative Sofa.Component.SolidMechanics.FEM.Elastic) target_link_libraries(${PROJECT_NAME} PUBLIC $<$,$,8.0>>:stdc++fs> $<$,$,9.0>>:c++fs>) -if (${SofaFramework_VERSION} VERSION_LESS "22.06.99") +if (${Sofa.Framework_VERSION} VERSION_LESS "22.06.99") target_link_libraries(${PROJECT_NAME} PUBLIC SofaSimulationGraph) else() target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph) diff --git a/unittest/SofaCaribou/Forcefield/test_hyperelasticforcefield.cpp b/unittest/SofaCaribou/Forcefield/test_hyperelasticforcefield.cpp index 525b6149..c82b3ecf 100644 --- a/unittest/SofaCaribou/Forcefield/test_hyperelasticforcefield.cpp +++ b/unittest/SofaCaribou/Forcefield/test_hyperelasticforcefield.cpp @@ -29,6 +29,7 @@ TEST(HyperelasticForcefield, Hexahedron_from_SOFA) { createObject(root, "RequiredPlugin", {{"pluginName", "Sofa.Component.Constraint.Projective"}}); createObject(root, "RequiredPlugin", {{"pluginName", "Sofa.Component.Engine.Select"}}); createObject(root, "RequiredPlugin", {{"pluginName", "Sofa.Component.Topology.Container.Grid"}}); + createObject(root, "RequiredPlugin", {{"pluginName", "Sofa.Component.Topology.Container.Dynamic"}}); createObject(root, "RegularGridTopology", {{"name", "grid"}, {"min", "-7.5 -7.5 0"}, {"max", "7.5 7.5 80"}, {"n", "3 3 9"}}); auto meca = createChild(root, "meca");