Skip to content

Commit 1d5279b

Browse files
authored
Merge pull request #140 from CasparJungbacker/dev-cmake
Refactor CMake Clean up and refactor our CMake infrastructure, using ECMWF's [ecbuild](https://github.com/ecmwf/ecbuild) helper functions. - Use CMake presets for toolchain selection. Instead of using the `SYST` environment variable, a toolchain can be selected by providing `--preset=<name>` to the `cmake` command. For example: ``` cmake --preset=gnu .. ``` is equal to the old workflow of setting `SYST=gnu-fast` before calling `cmake`. To get a list of all defined presets, execute: ``` cmake --list-presets ``` - Renamed some compilation options. I will provide an updated list of these in the documentation. - Renamed the DALES executable from `dalesX.Y` to just `dales`. The DALES library has been renamed to `libdales`. - Disabled compilation of the DALES library by default. - Update minimum CMake version to 3.17. - Updated CI.
2 parents 6450aa2 + 2d282a4 commit 1d5279b

File tree

8 files changed

+373
-339
lines changed

8 files changed

+373
-339
lines changed

.github/workflows/compile.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
toolchain: ["gnu", "intel"]
25-
hypre: ["", "-DUSE_HYPRE=T"]
25+
hypre: ["On", "Off"]
2626

2727
# Steps represent a sequence of tasks that will be executed as part of the job
2828
steps:
@@ -54,8 +54,6 @@ jobs:
5454
5555
sudo apt install -y intel-oneapi-mpi-devel intel-oneapi-compiler-fortran
5656
57-
echo "SYST=localpc_ifx" >> $GITHUB_ENV
58-
5957
- name: Checkout NetCdf-Fortran for Intel
6058
if: matrix.toolchain == 'intel'
6159
uses: actions/checkout@v2
@@ -87,7 +85,7 @@ jobs:
8785
fi
8886
mkdir build
8987
cd build
90-
cmake -DCMAKE_BUILD_TYPE=DEBUG ${{ matrix.fftw }} ${{ matrix.hypre }} ../
88+
cmake --preset=${{ matrix.toolchain }} -DCMAKE_BUILD_TYPE=DEBUG -DENABLE_HYPRE=${{ matrix.hypre }} ../
9189
9290
- name : Build
9391
run: |

.github/workflows/precision.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
hypre: ["", "-DUSE_HYPRE=T"]
23-
field_r: ["32","64"]
24-
pois_r: ["32","64"]
22+
hypre: ["On", "Off"]
23+
sp_fields: ["On","Off"]
24+
sp_pois: ["On","Off"]
2525

2626
# Steps represent a sequence of tasks that will be executed as part of the job
2727
steps:
@@ -39,11 +39,11 @@ jobs:
3939
run: |
4040
mkdir build
4141
cd build
42-
cmake -DCMAKE_BUILD_TYPE=DEBUG \
43-
${{ matrix.fftw }} \
44-
${{ matrix.hypre }} \
45-
-DPOIS_PRECISION=${{ matrix.pois_r }} \
46-
-DFIELD_PRECISION=${{ matrix.field_r }} ../
42+
cmake --preset=gnu \
43+
-DENABLE_HYPRE=${{ matrix.hypre }} \
44+
-DENABLE_FP32_FIELDS=${{ matrix.sp_fields }} \
45+
-DENABLE_FP32_POIS=${{ matrix.sp_pois }} \
46+
../
4747
- name : Build
4848
run: |
4949
cd build

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: |
3131
mkdir build
3232
cd build
33-
cmake -DCMAKE_BUILD_TYPE=DEBUG -DUSE_FFTW=True ..
33+
cmake --preset=gnu -DCMAKE_BUILD_TYPE=Debug ../
3434
3535
- name: Build
3636
run: |
@@ -49,6 +49,6 @@ jobs:
4949
5050
- name: Run tests
5151
run: |
52-
export DALES=$(find ~+/build/src -maxdepth 1 -name "dales*")
52+
export DALES=/home/runner/work/dales/dales/build/bin/dales
5353
pytest -rf --assert=plain --case=${{ matrix.case }}
5454

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77
[submodule "src/RTE-RRTMGP"]
88
path = src/RTE-RRTMGP
99
url = https://github.com/earth-system-radiation/rte-rrtmgp.git
10+
[submodule "external/ecbuild"]
11+
path = external/ecbuild
12+
url = https://github.com/ecmwf/ecbuild.git
13+
branch = develop

0 commit comments

Comments
 (0)