Skip to content

Commit

Permalink
Introduced CMake presets for the project.
Browse files Browse the repository at this point in the history
At the same time updated "some of" the CI configurations to make
use of them.
  • Loading branch information
krasznaa committed Apr 12, 2024
1 parent 66554c2 commit 6c3ec24
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 21 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ jobs:
- uses: actions/checkout@v2
# Run the CMake configuration.
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }}
-DDETRAY_EIGEN_PLUGIN=ON
-DDETRAY_VC_PLUGIN=ON
-DDETRAY_BUILD_CUDA=FALSE
run: cmake --preset default-fp64
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }}
-DDETRAY_FAIL_ON_WARNINGS=ON
-S ${{ github.workspace }} -B build
-G "${{ matrix.PLATFORM.GENERATOR }}"
# Perform the build.
Expand Down Expand Up @@ -86,7 +85,7 @@ jobs:
- name: Configure
run: |
source ${GITHUB_WORKSPACE}/.github/ci_setup.sh ${{ matrix.PLATFORM.NAME }}
cmake -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DDETRAY_CUSTOM_SCALARTYPE=${{ matrix.SCALAR_TYPE }} ${{ matrix.PLATFORM.OPTIONS }} -S ${GITHUB_WORKSPACE} -B build
cmake -DDETRAY_FAIL_ON_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DDETRAY_CUSTOM_SCALARTYPE=${{ matrix.SCALAR_TYPE }} ${{ matrix.PLATFORM.OPTIONS }} -S ${GITHUB_WORKSPACE} -B build
# Perform the build.
- name: Build
run: |
Expand Down Expand Up @@ -139,7 +138,7 @@ jobs:
- name: Configure
run: |
source ${GITHUB_WORKSPACE}/.github/ci_setup.sh ${{ matrix.PLATFORM.NAME }}
cmake -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DDETRAY_CUSTOM_SCALARTYPE=${{ matrix.SCALAR_TYPE }} ${{ matrix.PLATFORM.OPTIONS }} -S ${GITHUB_WORKSPACE} -B build
cmake -DDETRAY_FAIL_ON_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DDETRAY_CUSTOM_SCALARTYPE=${{ matrix.SCALAR_TYPE }} ${{ matrix.PLATFORM.OPTIONS }} -S ${GITHUB_WORKSPACE} -B build
# Perform the build.
- name: Build
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/bin
/build
/run
/out

# python files
**/__pycache__
Expand All @@ -16,4 +17,4 @@
**/*.so
**/*C_ACLiC*
**/thread_*
**/merged/
**/merged/
25 changes: 11 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Detray library, part of the ACTS project (R&D line)
#
# (c) 2021-2024 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

stages:
- build
- test
Expand All @@ -14,15 +20,11 @@ build_cuda:
- git clone $CLONE_URL src
- git -C src checkout $HEAD_SHA
- >
cmake -S src -B build
cmake --preset cuda -S src -B build
-DCMAKE_BUILD_TYPE=Release
-DDETRAY_CUSTOM_SCALARTYPE=float
-DBUILD_TESTING=ON
-DDETRAY_BUILD_TESTING=ON
-DDETRAY_BUILD_CUDA=ON
-DDETRAY_VC_PLUGIN=OFF
-DDETRAY_SMATRIX_PLUGIN=OFF
-DDETRAY_EIGEN_PLUGIN=ON
-DDETRAY_FAIL_ON_WARNINGS=ON
- cmake --build build


Expand Down Expand Up @@ -57,16 +59,11 @@ build_sycl:
- git -C src checkout $HEAD_SHA
- source src/.github/ci_setup.sh SYCL
- >
cmake -S src -B build
cmake --preset sycl -S src -B build
-DCMAKE_BUILD_TYPE=Release
-DDETRAY_CUSTOM_SCALARTYPE=float
-DDETRAY_BUILD_CUDA=OFF
-DDETRAY_BUILD_SYCL=ON
-DBUILD_TESTING=ON
-DBUILD_TESTING=ON
-DDETRAY_BUILD_TESTING=ON
-DDETRAY_VC_PLUGIN=OFF
-DDETRAY_SMATRIX_PLUGIN=OFF
-DDETRAY_EIGEN_PLUGIN=ON
-DDETRAY_FAIL_ON_WARNINGS=ON
- cmake --build build


Expand Down
59 changes: 59 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"version" : 3,
"configurePresets": [
{
"name" : "base",
"displayName" : "Base Developer Configuration",
"warnings": {
"deprecated": true
},
"cacheVariables": {
"CMAKE_BUILD_TYPE" : "RelWithDebInfo"
}
},
{
"name" : "default-fp64",
"displayName" : "FP64 Developer Configuration",
"inherits" : [ "base" ],
"cacheVariables" : {
"DETRAY_CUSTOM_SCALARTYPE" : "double"
}
},
{
"name" : "default-fp32",
"displayName" : "FP32 Developer Configuration",
"inherits" : [ "base" ],
"cacheVariables" : {
"DETRAY_CUSTOM_SCALARTYPE" : "float"
}
},
{
"name" : "cuda",
"displayName" : "CUDA Developer Configuration",
"inherits" : [ "default-fp32" ],
"cacheVariables" : {
"DETRAY_BUILD_CUDA" : "TRUE",
"DETRAY_VC_PLUGIN" : "FALSE",
"DETRAY_SMATRIX_PLUGIN" : "FALSE"
}
},
{
"name" : "sycl",
"displayName" : "SYCL Developer Configuration",
"inherits" : [ "default-fp32" ],
"cacheVariables" : {
"DETRAY_BUILD_SYCL" : "TRUE",
"DETRAY_VC_PLUGIN" : "FALSE",
"DETRAY_SMATRIX_PLUGIN" : "FALSE"
}
},
{
"name" : "smatrix",
"displayName" : "SMatrix Developer Configuration",
"inherits" : [ "default-fp64" ],
"cacheVariables" : {
"DETRAY_SMATRIX_PLUGIN" : "TRUE"
}
}
]
}

0 comments on commit 6c3ec24

Please sign in to comment.