Skip to content

Commit 8bf8914

Browse files
authored
Merge pull request #2 from ipc-sim/main
update ipc
2 parents 2ea9bf7 + a42bad3 commit 8bf8914

File tree

222 files changed

+306216
-10020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+306216
-10020
lines changed

.clang-format

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,32 @@ BinPackParameters: false
88
AllowAllParametersOfDeclarationOnNextLine: true
99
AlignAfterOpenBracket: AlwaysBreak
1010
BreakBeforeBinaryOperators: NonAssignment
11-
SortIncludes: false
11+
SortIncludes: true
1212
CommentPragmas: '^@.+'
1313
BreakStringLiterals: false
1414
PackConstructorInitializers: CurrentLine
15+
# Regroup includes with a priority system
16+
IncludeBlocks: Regroup
17+
IncludeCategories:
18+
# by default, the main header of a cpp will get priority 0
19+
# regex here are sorted by search pattern, not by sort priority
20+
- Regex: "^<ipc\/[^/]*>" # this libraries
21+
Priority: 2 # internal library group
22+
SortPriority: 2
23+
CaseSensitive: true
24+
- Regex: "^<ipc\/.*\/.*>" # this libraries
25+
Priority: 2 # internal library group
26+
SortPriority: 3
27+
CaseSensitive: true
28+
- Regex: "^<(.*\\.h[px]*)|(Eigen\/.*)>"
29+
Priority: 4 # libraries (because they end in .h)
30+
SortPriority: 4
31+
CaseSensitive: false
32+
- Regex: "^<.*"
33+
Priority: 5 # system (without .h, because that is captured by the other group)
34+
SortPriority: 5
35+
CaseSensitive: false
36+
- Regex: ".*" # catch-all for internal files
37+
Priority: 1 # internal file group
38+
SortPriority: 1
39+
CaseSensitive: true

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# These files should be ignored from GitHub's language statistics.
22
python/example.ipynb linguist-vendored
3+
notebooks/*.ipynb linguist-vendored

.github/pull_request_template.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ Please describe the tests that you ran to verify your changes. Provide instructi
2222
- [ ] Test B
2323

2424
**Test Configuration**:
25-
* OS and version:
26-
* Compile and version:
25+
* OS and Version:
26+
* Compiler and Version:
2727

28-
# Checklist:
28+
# Checklist
2929

3030
- [ ] I have followed the project [style guide](https://ipctk.xyz/style_guide.html)
3131
- [ ] My code follows the clang-format style guidelines of this project
@@ -35,5 +35,4 @@ Please describe the tests that you ran to verify your changes. Provide instructi
3535
- [ ] My changes generate no new warnings
3636
- [ ] I have added tests that prove my fix is effective or that my feature works
3737
- [ ] New and existing unit tests pass locally with my changes
38-
- [ ] Any dependent changes have been merged and published in downstream modules
39-
38+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/pypi.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
os: [ubuntu-latest, macos-latest, windows-latest]
24-
python-version: [cp38, cp39, cp310, cp311, cp312]
24+
python-version: [cp39, cp310, cp311, cp312, cp313]
2525
arch: [x86_64, arm64]
2626
exclude:
2727
- os: ubuntu-latest
@@ -40,14 +40,14 @@ jobs:
4040
- uses: actions/[email protected]
4141

4242
- name: Build wheels
43-
uses: pypa/cibuildwheel@v2.19.2
43+
uses: pypa/cibuildwheel@v2.21.3
4444
# to supply options, put them in 'env', like:
4545
env:
4646
MACOSX_DEPLOYMENT_TARGET: "11.0"
4747
CIBW_ARCHS: auto64
4848
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
4949
CIBW_BUILD: ${{ matrix.python-version }}-*
50-
CIBW_SKIP: "cp36-* cp37-* pp* *musllinux* *manylinux1* *-win32 *linux_i686 *linux_aarch64 *linux_ppc64le *linux_s390x"
50+
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *musllinux* *manylinux1* *-win32 *linux_i686 *linux_aarch64 *linux_ppc64le *linux_s390x"
5151

5252
- uses: actions/upload-artifact@v3
5353
with:
@@ -75,7 +75,7 @@ jobs:
7575
# alternatively, to publish when a GitHub Release is created, use the following rule:
7676
# if: github.event_name == 'release' && github.event.action == 'published'
7777
steps:
78-
- uses: actions/download-artifact@v4.1.7
78+
- uses: actions/download-artifact@v3
7979
with:
8080
# unpacks default artifact into dist/
8181
# if `name: artifact` is omitted, the action will create extra parent dir

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
os: [ubuntu-latest, macos-latest, windows-latest]
26-
python-version: ["3.9", "3.10", "3.11", "3.12"]
26+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2727
include:
2828
- os: ubuntu-latest
2929
name: Linux

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ install_manifest.txt
487487
compile_commands.json
488488
CTestTestfile.cmake
489489
_deps
490+
CMakeUserPresets.json
490491

491492

492493
## Build

CMakeLists.txt

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,18 @@ endif()
5959
project(IPCToolkit
6060
DESCRIPTION "A set of reusable functions to integrate IPC into an existing simulation."
6161
LANGUAGES CXX
62-
VERSION "1.3.1")
62+
VERSION "1.4.0")
6363

64-
option(IPC_TOOLKIT_BUILD_TESTS "Build unit-tests" ${IPC_TOOLKIT_TOPLEVEL_PROJECT})
65-
option(IPC_TOOLKIT_BUILD_PYTHON "Build Python bindings" OFF)
66-
option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" OFF)
64+
include(CheckLanguage)
65+
check_language(CUDA)
66+
67+
option(IPC_TOOLKIT_BUILD_TESTS "Build unit-tests" ${IPC_TOOLKIT_TOPLEVEL_PROJECT})
68+
option(IPC_TOOLKIT_BUILD_PYTHON "Build Python bindings" OFF)
69+
if(CMAKE_CUDA_COMPILER)
70+
option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" ON)
71+
else()
72+
option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" OFF)
73+
endif()
6774
option(IPC_TOOLKIT_WITH_RATIONAL_INTERSECTION "Use rational edge-triangle intersection check" OFF)
6875
option(IPC_TOOLKIT_WITH_ROBIN_MAP "Use Tessil's robin-map rather than std maps" ON)
6976
option(IPC_TOOLKIT_WITH_ABSEIL "Use Abseil's hash functions" ON)
@@ -118,13 +125,6 @@ add_subdirectory("${IPC_TOOLKIT_SOURCE_DIR}")
118125
# Public include directory for IPC Toolkit
119126
target_include_directories(ipc_toolkit PUBLIC "${IPC_TOOLKIT_INCLUDE_DIR}")
120127

121-
################################################################################
122-
# Optional Definitions
123-
################################################################################
124-
125-
# For MSVC, do not use the min and max macros.
126-
target_compile_definitions(ipc_toolkit PUBLIC NOMINMAX)
127-
128128
################################################################################
129129
# Dependencies
130130
################################################################################
@@ -208,6 +208,11 @@ else()
208208
message(STATUS "SIMD support disabled")
209209
endif()
210210

211+
# For MSVC, do not use the min and max macros.
212+
if(MSVC)
213+
target_compile_definitions(ipc_toolkit PRIVATE NOMINMAX)
214+
endif()
215+
211216
# Use C++17
212217
target_compile_features(ipc_toolkit PUBLIC cxx_std_17)
213218

@@ -216,15 +221,13 @@ target_compile_features(ipc_toolkit PUBLIC cxx_std_17)
216221
################################################################################
217222

218223
if(IPC_TOOLKIT_WITH_CUDA)
219-
include(CheckLanguage)
220-
check_language(CUDA)
221-
222-
if(CMAKE_CUDA_COMPILER)
223-
enable_language(CUDA)
224-
else()
225-
message(FATAL_ERROR "No CUDA support found!")
224+
if(NOT CMAKE_CUDA_COMPILER)
225+
message(FATAL_ERROR "CUDA support requested but no CUDA compiler found!")
226226
endif()
227227

228+
# Enable CUDA support
229+
enable_language(CUDA)
230+
228231
# We need to explicitly state that we need all CUDA files in the particle
229232
# library to be built with -dc as the member functions could be called by
230233
# other libraries and executables.

0 commit comments

Comments
 (0)