Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
cd build
cmake .. \
-DIPC_TOOLKIT_WITH_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES=75 \
-DSCALABLE_CCD_CUDA_ARCHITECTURES=75 \
-DIPC_TOOLKIT_BUILD_TESTS=ON \
-DIPC_TOOLKIT_BUILD_PYTHON=ON \
Expand Down
26 changes: 10 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ else()
endif()

# Check required CMake version
set(REQUIRED_CMAKE_VERSION "3.18.0")
set(REQUIRED_CMAKE_VERSION "3.24.0")
if(IPC_TOOLKIT_TOPLEVEL_PROJECT)
cmake_minimum_required(VERSION ${REQUIRED_CMAKE_VERSION})
else()
Expand Down Expand Up @@ -64,9 +64,6 @@ project(IPCToolkit
LANGUAGES CXX
VERSION "1.5.0")

include(CheckLanguage)
check_language(CUDA)

if(IPC_TOOLKIT_TOPLEVEL_PROJECT)
option(IPC_TOOLKIT_BUILD_TESTS "Build unit-tests" ON)
option(IPC_TOOLKIT_BUILD_PYTHON "Build Python bindings" OFF)
Expand All @@ -77,11 +74,7 @@ else()
set(IPC_TOOLKIT_BUILD_PYTHON OFF CACHE BOOL "Build Python bindings" FORCE)
endif()

if(CMAKE_CUDA_COMPILER)
option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" ON)
else()
option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" OFF)
endif()
option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" OFF)
option(IPC_TOOLKIT_WITH_RATIONAL_INTERSECTION "Use rational edge-triangle intersection check" OFF)
option(IPC_TOOLKIT_WITH_ROBIN_MAP "Use Tessil's robin-map rather than std maps" ON)
option(IPC_TOOLKIT_WITH_ABSEIL "Use Abseil's hash functions" ON)
Expand Down Expand Up @@ -245,9 +238,14 @@ target_compile_features(ipc_toolkit PUBLIC cxx_std_17)
################################################################################

if(IPC_TOOLKIT_WITH_CUDA)
if(NOT CMAKE_CUDA_COMPILER)
message(FATAL_ERROR "CUDA support requested but no CUDA compiler found!")
# If CMAKE_CUDA_ARCHITECTURES was not specified, set it to native.
if(DEFINED CMAKE_CUDA_ARCHITECTURES)
message(STATUS "CMAKE_CUDA_ARCHITECTURES was specified, skipping auto-detection")
else()
message(STATUS "CMAKE_CUDA_ARCHITECTURES was not specified, set it to native")
set(CMAKE_CUDA_ARCHITECTURES "native")
endif()
message(STATUS "Targeting CUDA_ARCHITECTURES \"${CMAKE_CUDA_ARCHITECTURES}\"")

# Enable CUDA support
enable_language(CUDA)
Expand All @@ -256,10 +254,6 @@ if(IPC_TOOLKIT_WITH_CUDA)
# library to be built with -dc as the member functions could be called by
# other libraries and executables.
set_target_properties(ipc_toolkit PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

# Use the same CUDA architectures Scalable CCD
get_target_property(CMAKE_CUDA_ARCHITECTURES scalable_ccd CUDA_ARCHITECTURES)
set_target_properties(ipc_toolkit PROPERTIES CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}")
endif()

################################################################################
Expand Down Expand Up @@ -311,4 +305,4 @@ if (CMAKE_GENERATOR STREQUAL "Xcode")
if(IPC_TOOLKIT_BUILD_PYTHON)
set_target_properties(ipctk PROPERTIES XCODE_GENERATE_SCHEME ON)
endif()
endif()
endif()
4 changes: 2 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 18
"minor": 24
},
"configurePresets": [{
"name": "release",
Expand Down Expand Up @@ -166,4 +166,4 @@
}
}
]
}
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ IPC Toolkit is a set of reusable functions to integrate Incremental Potential Co

### Features

* IPC barrier function and its derivatives and adaptive barrier stiffness algorithm
* IPC barrier function and its derivatives, and adaptive barrier stiffness algorithm
* Broad- and narrow-phase continuous collision detection (CCD) of linear and nonlinear trajectories
* Distance computation and derivatives between edges in 2D and triangles in 3D
* Distance barrier potential and its derivatives
* Smooth and lagged dissipative friction potential and its derivatives

### Limitations

This is not a full simulation library. As such it does not include any physics or solvers. For a full simulation implementation, we recommend [PolyFEM](https://polyfem.github.io/) (a finite element library) or [Rigid IPC](https://github.com/ipc-sim/rigid-ipc) (rigid-body dynamics) both of which utilize the IPC Toolkit.
This is not a full simulation library. As such, it does not include any physics or solvers. For a full simulation implementation, we recommend [PolyFEM](https://polyfem.github.io/) (a finite element library) or [Rigid IPC](https://github.com/ipc-sim/rigid-ipc) (rigid-body dynamics), both of which utilize the IPC Toolkit.

## Build

Instruction for building and including the IPC Toolkit in your CMake project can be found on the website [here](https://ipctk.xyz/build.html).
Instructions for building and including the IPC Toolkit in your CMake project can be found on the website [here](https://ipctk.xyz/build/c++.html).

### Dependencies

Expand All @@ -42,7 +42,7 @@ A full list of dependencies can be found on the [dependencies page](https://ipct

We provide Python bindings for functions in the toolkit using [pybind11](https://github.com/pybind/pybind11).

For more information see the [Python documentation](https://ipctk.xyz/python.html).
For more information, see the [Python documentation](https://ipctk.xyz/python.html).

## Usage

Expand All @@ -61,7 +61,7 @@ Simply fork this repository and make a Pull Request! We would appreciate:

## Citation

IPC Toolkit is created and maintained by academics: citations let us know our work is having impact! Please cite the IPC Toolkit or otherwise give a shout-out if and when it contributes to published works.
The IPC Toolkit is created and maintained by academics: citations let us know our work is having an impact! Please cite the IPC Toolkit or otherwise give a shout-out if and when it contributes to published works.

```bibtex
@software{ipc_toolkit,
Expand Down Expand Up @@ -93,4 +93,4 @@ This project is licensed under the MIT License.

You are free to use, modify, and distribute this code in your projects, even commercial ones, as long as you include the original copyright and license notice. A copy of the full license text can be found in the <a href="https://github.com/ipc-sim/ipc-toolkit/blob/main/LICENSE"><code>LICENSE</code></a> file.

If you use this code in a product you distribute to others, you are required to **include a copy of the original copyright and license notice**. This is typically done in the product's documentation, an "About" or "Third-Party Licenses" section, or in a clear open-source software statement.
If you use this code in a product you distribute to others, you are required to **include a copy of the original copyright and license notice**. This is typically done in the product's documentation, an "About" or "Third-Party Licenses" section, or in a clear open-source software statement.
4 changes: 3 additions & 1 deletion docs/source/build/c++.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ You can build the IPC Toolkit using CMake as you would any other CMake project.

This will build the IPC Toolkit and all of its dependencies. The ``IPC_TOOLKIT_BUILD_TESTS`` option enables building the unit tests, and the ``IPC_TOOLKIT_BUILD_PYTHON`` option enables building the Python bindings.

CUDA support is disabled by default. Enable it by setting CMake option ``IPC_TOOLKIT_WITH_CUDA`` to ON.

.. warning::
Installing the IPC Toolkit using the ``make install`` has not been tested and is not recommended. The IPC Toolkit is designed to be used as a submodule in your project, and as such does not have a proper install target.

Expand All @@ -61,4 +63,4 @@ Dependencies

**All required dependencies are downloaded through CMake** depending on the build options, and are built automatically when you build the IPC Toolkit. You do not need to install them separately.

A full list of dependencies can be found on the `dependencies page <https://ipctk.xyz/dependencies.html>`_.
A full list of dependencies can be found on the `dependencies page <https://ipctk.xyz/dependencies.html>`_.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"setuptools>=42",
"wheel",
"ninja",
# "cmake>=3.14",
# "cmake>=3.24",
]
build-backend = "setuptools.build_meta"

Expand Down