Skip to content

Update dependencies #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 15 additions & 21 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,23 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
os: [ubuntu-latest, macos-latest]
config: [Debug, Release]
include:
- os: macos-latest
name: macOS
- os: ubuntu-18.04
name: Linux
- os: ubuntu-20.04
- os: ubuntu-latest
name: Linux
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2.5.0
with:
fetch-depth: 10

- name: Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
ccache \
xorg-dev \
Expand Down Expand Up @@ -83,54 +82,49 @@ jobs:

Windows:
runs-on: windows-latest
env:
CC: cl.exe
CXX: cl.exe
strategy:
fail-fast: false
matrix:
config: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2.5.0
with:
fetch-depth: 10
- uses: seanmiddleditch/gha-setup-ninja@master

# https://github.com/actions/cache/issues/101
- name: Set env
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Set env variable for sccache
run: |
echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}

- name: Cache build
id: cache-build
uses: actions/cache@v1
uses: actions/cache@v3.0.11
with:
path: ${{ env.appdata }}\Mozilla\sccache
key: ${{ runner.os }}-${{ matrix.config }}-cache

- name: Prepare sccache
run: |
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
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}

# 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
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
cmake --version
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
cmake -G Ninja ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
-DRIGID_IPC_WITH_UNIT_TESTS=ON ^
-B build ^
-S .
cd build
ninja -j4
cmake --build build -j1

- name: Tests
run: cd build; ctest --verbose
run: cd build; ctest --verbose -j2
44 changes: 9 additions & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ option(RIGID_IPC_WITH_DERIVATIVE_CHECK "Check derivatives using finite diff

# Set default minimum C++ standard
if(RIGID_IPC_TOPLEVEL_PROJECT)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
Expand All @@ -55,29 +55,15 @@ include(rigid_ipc_use_colors)

include(rigid_ipc_autogen)

mark_as_advanced(CLEAR CMAKE_BUILD_TYPE)

################################################################################
# External project settings
################################################################################

# libigl options
option(LIBIGL_USE_STATIC_LIBRARY "Use libigl as static library" OFF)
option(LIBIGL_WITH_PREDICATES "Use exact predicates" ON)
set(LIBIGL_WITH_OPENGL_GLFW_IMGUI ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Use OpenGL" FORCE)
set(LIBIGL_WITH_OPENGL_GLFW ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Use GLFW" FORCE)
set(LIBIGL_WITH_OPENGL ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Use IMGUI" FORCE)
set(LIBIGL_WITH_PNG ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Use PNG" FORCE)

# PolySolve settings
option(POLYSOLVE_WITH_CHOLMOD "Enable Cholmod library" ON)
option(POLYSOLVE_WITH_UMFPACK "Enable UmfPack library" OFF)
option(POLYSOLVE_WITH_SUPERLU "Enable SuperLU library" OFF)
option(POLYSOLVE_WITH_MKL "Enable MKL library" OFF)
option(POLYSOLVE_WITH_PARDISO "Enable Pardiso library" OFF)
option(POLYSOLVE_WITH_HYPRE "Enable hypre" OFF)
option(POLYSOLVE_WITH_AMGCL "Use AMGCL" OFF)
option(POLYSOLVE_WITH_SPECTRA "Enable computing spectrum" OFF)
set(LIBIGL_GLFW ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Build target igl::glfw" FORCE)
set(LIBIGL_IMGUI ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Build target igl::imgui" FORCE)
set(LIBIGL_OPENGL ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Build target igl::opengl" FORCE)
set(LIBIGL_PNG ${RIGID_IPC_WITH_OPENGL} CACHE BOOL "Build target igl::png" FORCE)

set(TIGHT_INCLUSION_WITH_NO_ZERO_TOI OFF CACHE BOOL "Enable refinement if CCD produces a zero ToI" FORCE)

Expand All @@ -88,13 +74,14 @@ set(TIGHT_INCLUSION_WITH_NO_ZERO_TOI OFF CACHE BOOL "Enable refinement if CCD pr
add_library(ipc_rigid
src/autodiff/autodiff.cpp


src/utils/sinc.cpp

src/ccd/impact.cpp
src/ccd/ccd.cpp
src/ccd/linear/broad_phase.cpp
src/ccd/piecewise_linear/time_of_impact.cpp
src/interval/filib_rounding.cpp
src/interval/interval.cpp
src/interval/interval_root_finder.cpp
src/ccd/rigid/broad_phase.cpp
src/ccd/rigid/rigid_body_hash_grid.cpp
Expand Down Expand Up @@ -199,7 +186,7 @@ target_link_libraries(ipc_rigid PUBLIC

# JSON Parser
include(json)
target_link_libraries(ipc_rigid PUBLIC nlohmann::json)
target_link_libraries(ipc_rigid PUBLIC nlohmann_json::nlohmann_json)

# Logger
include(spdlog)
Expand All @@ -209,10 +196,6 @@ target_link_libraries(ipc_rigid PUBLIC spdlog::spdlog)
include(finite_diff)
target_link_libraries(ipc_rigid PUBLIC finitediff::finitediff)

# Boost
include(boost)
target_link_libraries(ipc_rigid PUBLIC Boost::boost)

# TBB
include(tbb)
target_link_libraries(ipc_rigid PUBLIC TBB::tbb)
Expand All @@ -221,10 +204,6 @@ target_link_libraries(ipc_rigid PUBLIC TBB::tbb)
include(tight_inclusion)
target_link_libraries(ipc_rigid PUBLIC tight_inclusion::tight_inclusion)

# PolySolve for wrapping linear solvers
include(polysolve)
target_link_libraries(ipc_rigid PUBLIC PolyFEM::polysolve)

# IPC Toolkit
include(ipc_toolkit)
target_link_libraries(ipc_rigid PUBLIC ipc::toolkit)
Expand All @@ -241,10 +220,6 @@ target_link_libraries(ipc_rigid PUBLIC simple_bvh::simple_bvh)
include(tinygltf)
target_link_libraries(ipc_rigid PUBLIC tinygltf::tinygltf)

# Filesystem
include(filesystem)
target_link_libraries(ipc_rigid PUBLIC ghc::filesystem)

################################################################################
# Compiler options
################################################################################
Expand Down Expand Up @@ -296,9 +271,8 @@ target_link_libraries(rigid_ipc_sim PUBLIC CLI11::CLI11)
if(RIGID_IPC_WITH_OPENGL)
target_compile_definitions(rigid_ipc_sim PUBLIC RIGID_IPC_WITH_OPENGL)

include(libigl)
target_link_libraries(rigid_ipc_sim PUBLIC
igl::opengl igl::opengl_glfw igl::opengl_glfw_imgui igl::png)
igl::opengl igl::glfw igl::imgui igl::png)

# Charlie Tangora's gif-h library
include(gif_h)
Expand Down
29 changes: 0 additions & 29 deletions cmake/recipes/boost.cmake

This file was deleted.

24 changes: 12 additions & 12 deletions cmake/recipes/eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(TARGET Eigen3::Eigen)
return()
endif()

option(EIGEN_WITH_MKL "Use Eigen with MKL" OFF)
# option(EIGEN_WITH_MKL "Use Eigen with MKL" OFF)

if(EIGEN_ROOT)
message(STATUS "Third-party: creating target 'Eigen3::Eigen' for external path: ${EIGEN_ROOT}")
Expand All @@ -25,7 +25,7 @@ else()
FetchContent_Declare(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG tags/3.3.7
GIT_TAG tags/3.4.0
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(eigen)
Expand All @@ -49,16 +49,16 @@ target_include_directories(Eigen3_Eigen SYSTEM INTERFACE
)
# target_compile_definitions(Eigen3_Eigen INTERFACE EIGEN_MPL2_ONLY)

if(EIGEN_WITH_MKL)
# TODO: Checks that, on 64bits systems, `mkl::mkl` is using the LP64 interface
# (by looking at the compile definition of the target)
include(mkl)
target_link_libraries(Eigen3_Eigen INTERFACE mkl::mkl)
target_compile_definitions(Eigen3_Eigen INTERFACE
EIGEN_USE_MKL_ALL
EIGEN_USE_LAPACKE_STRICT
)
endif()
# if(EIGEN_WITH_MKL)
# # TODO: Checks that, on 64bits systems, `mkl::mkl` is using the LP64 interface
# # (by looking at the compile definition of the target)
# include(mkl)
# target_link_libraries(Eigen3_Eigen INTERFACE mkl::mkl)
# target_compile_definitions(Eigen3_Eigen INTERFACE
# EIGEN_USE_MKL_ALL
# EIGEN_USE_LAPACKE_STRICT
# )
# endif()

# On Windows, enable natvis files to improve debugging experience
if(WIN32 AND eigen_SOURCE_DIR)
Expand Down
63 changes: 0 additions & 63 deletions cmake/recipes/filesystem.cmake

This file was deleted.

8 changes: 5 additions & 3 deletions cmake/recipes/json.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET nlohmann::json)

# JSON MIT
if(TARGET nlohmann_json::nlohmann_json)
return()
endif()

message(STATUS "Third-party: creating target 'nlohmann::json'")
message(STATUS "Third-party: creating target 'nlohmann_json::nlohmann_json'")

# nlohmann_json is a big repo for a single header, so we just download the release archive
set(NLOHMANNJSON_VERSION "v3.10.2")
Expand All @@ -27,7 +29,7 @@ FetchContent_Declare(
FetchContent_MakeAvailable(nlohmann_json)

add_library(nlohmann_json INTERFACE)
add_library(nlohmann::json ALIAS nlohmann_json)
add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json)

include(GNUInstallDirs)
target_include_directories(nlohmann_json INTERFACE
Expand Down
Loading