Skip to content
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

Modernize CMake #99

Merged
merged 41 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
573b4c0
refactor(cmake): add `CPM.cmake`, restructure CMakeLists
Curve Nov 20, 2023
028c686
refactor(cmake): update examples
Curve Nov 21, 2023
54fbd01
refactor(cmake): update tests
Curve Nov 21, 2023
257e641
fix: missing include
Curve Nov 21, 2023
bdd32ce
refactor(cmake): update python bindings
Curve Nov 21, 2023
0d24ce7
feat: add sanitizer options
Curve Nov 21, 2023
b152b49
feat(cmake): add install target
Curve Nov 21, 2023
1fddcee
refactor(cmake/python): use `CMAKE_LIBRARY_OUTPUT_DIRECTORY` when ava…
Curve Nov 21, 2023
80d4611
feat(cmake): add sanitizer options for gcc
Curve Nov 21, 2023
fd458de
fix(cmake): static builds
Curve Nov 21, 2023
1926d32
refactor(cmake): add messages
Curve Nov 21, 2023
36fa52d
fix(format-project): shellcheck issues
Curve Nov 21, 2023
396c57e
refactor(cmake/sanitizer): more explicit compiler id check
Curve Nov 22, 2023
1b96dce
fix: update formatting
Curve Nov 27, 2023
1032eb6
fix(workflows): build commands
Curve Nov 27, 2023
e972ef2
fix(workflows(windows): long paths
Curve Nov 27, 2023
74df39c
fix(CMakeLists): disable VTK rendering group
Curve Nov 27, 2023
9c40d8a
docs(readme): update build instructions
Curve Nov 27, 2023
3ca2284
docs(readme): fix test command
Curve Nov 27, 2023
7757f39
fix: ctest excludes
Curve Nov 27, 2023
6b062d6
refactor: disable sanitizer for msvc and apple clang
Curve Nov 29, 2023
94f3945
chore: apply cmake-format
Curve Nov 29, 2023
08fc6fa
fix(cmake-format): define CPM functions
Curve Nov 29, 2023
89e63fb
fix(vtk): disable libproj support
Curve Nov 29, 2023
6315461
revert: formatting
Curve Nov 29, 2023
1184801
fix(ci/windows): enable long paths
Curve Nov 29, 2023
d75cd9c
refactor(cmake): disable wrapping for vtk and disable libproj
Curve Nov 29, 2023
e6b56f7
refactor(cmake): disable sanitizer by default
Curve Nov 29, 2023
8c894ba
fix(windows): only export symbols for viennals
Curve Nov 29, 2023
a3898eb
refactor(cmake): exclude dependencies from all target
Curve Nov 29, 2023
6b5bef8
refactor(cmake): use get-cpm
Curve Nov 29, 2023
6dbe999
refactor(cmake): lower required vtk version
Curve Nov 29, 2023
5af2536
fix: formatting
Curve Nov 29, 2023
5b3f309
fix: setup vtk env for targets
Curve Dec 2, 2023
38771b5
fix: formatting
Curve Dec 2, 2023
357a02c
fix: remove debug print
Curve Dec 2, 2023
2aa3da1
fix(cmakelists): vtk dir on linux
Curve Dec 2, 2023
c95fd8d
fix: skip vtk environment on non windows platforms
Curve Dec 2, 2023
a8acd4c
fix: formatting
Curve Dec 2, 2023
0a440c9
refactor: more logging, don't use early return in macro
Curve Dec 2, 2023
05eb427
refactor: adjust target naming
Curve Dec 3, 2023
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
3 changes: 3 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include: ["cmake/.cpm-format"]
format:
line_width: 100
12 changes: 5 additions & 7 deletions .github/workflows/linux_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@ jobs:

- name: Configure
run: |
cmake -B ./build \
cmake -B build \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D VIENNALS_BUILD_TESTS=ON

- name: Build Dependencies
run: cmake --build ./build --target buildDependencies

- name: Build Tests
run: cmake --build ./build --target buildTests
run: cmake --build build

- name: Run Tests
working-directory: ${{github.workspace}}/build
# Run all tests that are not labeled as benchmark
run: ctest -LE '^benchmark$'
run: ctest -E "Benchmark|Performance"

- name: Trigger Action on ViennaPS Repository
if: ${{ vars.TRIGGER_VIENNAPS == 'true' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
Expand All @@ -53,6 +50,7 @@ jobs:
token: ${{ secrets.PAT_VIENNAPS }}
repository: ${{github.repository_owner}}/ViennaPS
event-type: viennals-update-linux

linux-python:
runs-on: ubuntu-latest
steps:
Expand All @@ -65,7 +63,7 @@ jobs:
with:
key: viennals-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './external/upstream/**CMakeLists.txt' ) }}
path: ${{github.workspace}}/dependencies/Install

- name: Build and install Python module
shell: bash
run: pip3 install --user . -v
11 changes: 4 additions & 7 deletions .github/workflows/macos_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Configure
run: |
cmake -B ./build \
cmake -B build \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D VIENNALS_BUILD_TESTS=ON \
-D OpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include" \
Expand All @@ -41,16 +41,13 @@ jobs:
-D OpenMP_CXX_LIB_NAMES="omp" \
-D OpenMP_omp_LIBRARY="$(brew --prefix libomp)/lib/libomp.a"

- name: Build Dependencies
run: cmake --build ./build --target buildDependencies

- name: Build Tests
run: cmake --build ./build --target buildTests
- name: Build
run: cmake --build build

- name: Run Tests
working-directory: ${{github.workspace}}/build
# Run all tests that are not labeled as benchmark
run: ctest -LE '^benchmark$'
run: ctest -E "Benchmark|Performance"

- name: Trigger Action on ViennaPS Repository
if: ${{ vars.TRIGGER_VIENNAPS == 'true' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/windows_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@ jobs:
key: viennals-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './external/upstream/**CMakeLists.txt' ) }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#cpm_source_cache

We should use the CPM_SOURCE_CACHE in the workflows to cache

path: ${{github.workspace}}/dependencies/Install

- name: Configure Git
# Workaround for windows, as the filename is 260 by default, however
# VTK has some files that exceed this limit, thus we need this workaround.
run: git config --system core.longpaths true

- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DVIENNALS_BUILD_TESTS=ON

- name: Build Dependencies
run: cmake --build ${{github.workspace}}/build --target buildDependencies

- name: Build Tests
run: cmake --build ${{github.workspace}}/build --target buildTests
- name: Build
run: cmake --build ${{github.workspace}}/build

- name: Add VTK to PATH
run: echo "${{github.workspace}}\dependencies\Install\vtk_external\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Run Tests
working-directory: ${{github.workspace}}/build
# Run all tests except those that are labeled as benchmark
run: ctest -LE "^benchmark$" -j 2 --output-on-failure --timeout 1800 -C ${{env.BUILD_TYPE}}
run: ctest -E "Benchmark|Performance" -j 2 --output-on-failure --timeout 1800 -C ${{env.BUILD_TYPE}}

- name: Trigger Action on ViennaPS Repository
if: ${{ vars.TRIGGER_VIENNAPS == 'true' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
Expand All @@ -54,6 +56,7 @@ jobs:
token: ${{ secrets.PAT_VIENNAPS }}
repository: ${{github.repository_owner}}/ViennaPS
event-type: viennals-update-windows

windows-python:
runs-on: windows-latest

Expand All @@ -68,6 +71,11 @@ jobs:
key: viennals-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './external/upstream/**CMakeLists.txt' ) }}
path: ${{github.workspace}}/dependencies/Install

- name: Configure Git
# Workaround for windows, as the filename is 260 by default, however
# VTK has some files that exceed this limit, thus we need this workaround.
run: git config --system core.longpaths true

- name: Build and install Python module
shell: bash
run: pip3 install --user . -v
run: pip3 install --user . -v
Loading
Loading