From 34fa0dd60e30a8fab9b2354f907deb241c565f95 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 14:09:48 -0400 Subject: [PATCH 01/22] WIP: Add Spack build in CI --- .github/workflows/spack-ci.yml | 43 ++++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/spack-ci.yml diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml new file mode 100644 index 000000000000..5ab4b8db89c1 --- /dev/null +++ b/.github/workflows/spack-ci.yml @@ -0,0 +1,43 @@ +name: spack-ci-gcc + +on: + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Spack + uses: spack/setup-spack@v2 + with: + ref: develop # Spack version (examples: develop, releases/v0.21) + color: true # Force color output (SPACK_COLOR=always) + path: spack # Where to clone Spack + + - name: Login + run: | + spack -e ./share/spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache + + - name: Concretize + run: | + spack -e ./share/spack-env concretize + + - name: Install + run: | + spack -e ./share/spack-env install --no-check-signature + + - name: Build with Cmake + shell: spack-bash {0} + run: | + spack env activate ./share/spack-env/ + FC=gfortran CC=gcc CXX=g++ + cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF + cmake --build build -j 4 + cmake --install build + diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d1fbb5bc9e..a257e9c32ba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Allow update offsets of ±timestep in ExtData2G +- Added CI build using spack ### Changed From 7126ef6bfaf4862decabdce2d5e9146ed2d133e3 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 14:12:39 -0400 Subject: [PATCH 02/22] Bad environment --- .github/workflows/spack-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 5ab4b8db89c1..790a01b971e9 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -22,20 +22,20 @@ jobs: - name: Login run: | - spack -e ./share/spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache + spack -e . mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache - name: Concretize run: | - spack -e ./share/spack-env concretize + spack -e . concretize - name: Install run: | - spack -e ./share/spack-env install --no-check-signature + spack -e . install --no-check-signature - name: Build with Cmake shell: spack-bash {0} run: | - spack env activate ./share/spack-env/ + spack env activate . FC=gfortran CC=gcc CXX=g++ cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF cmake --build build -j 4 From 2be611e41aa6b37696a15f97985ff22877077243 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 14:23:31 -0400 Subject: [PATCH 03/22] Throw more at the wall --- .github/workflows/spack-ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 790a01b971e9..f242da72c70b 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -20,22 +20,26 @@ jobs: color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack + - name: Create Spack environment + run: | + spack env create spack-env + spack env activate spack-env + - name: Login run: | - spack -e . mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache + spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache - name: Concretize run: | - spack -e . concretize + spack -e spack-env concretize - name: Install run: | - spack -e . install --no-check-signature + spack -e spack-env install --no-check-signature - name: Build with Cmake shell: spack-bash {0} run: | - spack env activate . FC=gfortran CC=gcc CXX=g++ cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF cmake --build build -j 4 From f5d3d47c913e702c43050cd0f50712a36440607f Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 14:25:51 -0400 Subject: [PATCH 04/22] mirror add --- .github/workflows/spack-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index f242da72c70b..049a12d1cceb 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -27,6 +27,7 @@ jobs: - name: Login run: | + spack -e spack-env mirror add mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache - name: Concretize From bd8d4fb039a0336298edd77fd353d6778aff610f Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 14:33:10 -0400 Subject: [PATCH 05/22] install packages --- .github/workflows/spack-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 049a12d1cceb..6ba8b5e0de3c 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -36,7 +36,7 @@ jobs: - name: Install run: | - spack -e spack-env install --no-check-signature + spack -e spack-env install --no-check-signature esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - name: Build with Cmake shell: spack-bash {0} From 533dac5f05c25a793706c09a09cf066120d32aa9 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 14:51:18 -0400 Subject: [PATCH 06/22] Add add --- .github/workflows/spack-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 6ba8b5e0de3c..125aaa71aa54 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -36,7 +36,7 @@ jobs: - name: Install run: | - spack -e spack-env install --no-check-signature esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + spack -e spack-env install --add --no-check-signature esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - name: Build with Cmake shell: spack-bash {0} From 118d8ef106bcd5f26d745010829c071074c1726a Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 14:56:57 -0400 Subject: [PATCH 07/22] Try to trigger it? --- .github/workflows/spack-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 125aaa71aa54..5ac511ce055c 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -36,7 +36,8 @@ jobs: - name: Install run: | - spack -e spack-env install --add --no-check-signature esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + spack -e spack-env install --add --no-check-signature \ + esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - name: Build with Cmake shell: spack-bash {0} From 4f6fa5ad2c4182819eb8d6d547a4960808bd6706 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 15:26:23 -0400 Subject: [PATCH 08/22] Set target and compiler and load --- .github/workflows/spack-ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 5ac511ce055c..e5c13492b8bc 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -25,6 +25,15 @@ jobs: spack env create spack-env spack env activate spack-env + - name: Find compilers + run: | + spack compiler find + + - name: Set default compiler and target + run: | + spack config add 'packages:all:compiler:[gcc@13.2.0]' + spack config add 'packages:all:require:target=x86_64_v3' + - name: Login run: | spack -e spack-env mirror add mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache @@ -42,7 +51,9 @@ jobs: - name: Build with Cmake shell: spack-bash {0} run: | - FC=gfortran CC=gcc CXX=g++ + FC=gfortran-13 CC=gcc-13 CXX=g++-13 + spack -e spack-env load \ + esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF cmake --build build -j 4 cmake --install build From d1429cc8ece5e8c25132a7158f61289663c66b97 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 15:33:54 -0400 Subject: [PATCH 09/22] Don't use the buildcache --- .github/workflows/spack-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index e5c13492b8bc..aec73c7c3219 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -19,6 +19,7 @@ jobs: ref: develop # Spack version (examples: develop, releases/v0.21) color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack + buildcache: false # Do not use the spack buildcache - name: Create Spack environment run: | From b595429c8bdab20a786db134d6a7e5808ffcea87 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 15:45:07 -0400 Subject: [PATCH 10/22] Explore the buildcache --- .github/workflows/spack-ci.yml | 40 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index aec73c7c3219..7c30605a121b 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -39,23 +39,25 @@ jobs: run: | spack -e spack-env mirror add mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache - - - name: Concretize - run: | - spack -e spack-env concretize - - - name: Install - run: | - spack -e spack-env install --add --no-check-signature \ - esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - - - name: Build with Cmake - shell: spack-bash {0} - run: | - FC=gfortran-13 CC=gcc-13 CXX=g++-13 - spack -e spack-env load \ - esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF - cmake --build build -j 4 - cmake --install build + spack -e spack-env mirror list + spack -e spack-env buildcache list + + #- name: Concretize + #run: | + #spack -e spack-env concretize + + #- name: Install + #run: | + #spack -e spack-env install --add --no-check-signature \ + #esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + + #- name: Build with Cmake + #shell: spack-bash {0} + #run: | + #FC=gfortran-13 CC=gcc-13 CXX=g++-13 + #spack -e spack-env load \ + #esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + #cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF + #cmake --build build -j 4 + #cmake --install build From 92f93cbf60d9279f3ba356c12a8eef945a4d511d Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 15:47:51 -0400 Subject: [PATCH 11/22] Cancel previous --- .github/workflows/spack-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 7c30605a121b..1152997d9d09 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -10,6 +10,9 @@ jobs: runs-on: ubuntu-24.04 steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action + - name: Checkout repository uses: actions/checkout@v4 From 3c71f36bdc435be1a14d61019e2eee6a1b736fa9 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 15:49:29 -0400 Subject: [PATCH 12/22] Cancel previous using concurrency --- .github/workflows/spack-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 1152997d9d09..cf3f109fdac2 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -5,14 +5,15 @@ on: types: [opened, synchronize, reopened] workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-24.04 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action - - name: Checkout repository uses: actions/checkout@v4 From 37d62cbb3170226c4d2dd9738e0d21b6f86ecef6 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 15:54:03 -0400 Subject: [PATCH 13/22] more testing --- .github/workflows/spack-ci.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index cf3f109fdac2..ff44bd58639e 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -25,32 +25,39 @@ jobs: path: spack # Where to clone Spack buildcache: false # Do not use the spack buildcache - - name: Create Spack environment - run: | - spack env create spack-env - spack env activate spack-env - - name: Find compilers + shell: spack-bash {0} run: | spack compiler find - name: Set default compiler and target + shell: spack-bash {0} run: | spack config add 'packages:all:compiler:[gcc@13.2.0]' spack config add 'packages:all:require:target=x86_64_v3' + - name: Create Spack environment + shell: spack-bash {0} + run: | + spack env create spack-env + spack env activate spack-env + - name: Login + shell: spack-bash {0} run: | spack -e spack-env mirror add mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache spack -e spack-env mirror list - spack -e spack-env buildcache list + spack -e spack-env buildcache update-index mapl-buildcache + spack -e spack-env buildcache list --all-arch #- name: Concretize + #shell: spack-bash {0} #run: | #spack -e spack-env concretize #- name: Install + #shell: spack-bash {0} #run: | #spack -e spack-env install --add --no-check-signature \ #esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits From 2960700a4736d203e69b36cb8ca92c7eb9cff13b Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 15:57:21 -0400 Subject: [PATCH 14/22] Try a new token? --- .github/workflows/spack-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index ff44bd58639e..e52047e0732e 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -46,7 +46,7 @@ jobs: shell: spack-bash {0} run: | spack -e spack-env mirror add mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache - spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" mapl-buildcache + spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.BUILDCACHE_TOKEN }}" mapl-buildcache spack -e spack-env mirror list spack -e spack-env buildcache update-index mapl-buildcache spack -e spack-env buildcache list --all-arch From eb4bef3d5ce67dd59790ac2c86d8da0c5b99fbe0 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 16:00:30 -0400 Subject: [PATCH 15/22] Fix typo --- .github/workflows/spack-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index e52047e0732e..649e53552724 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -49,7 +49,7 @@ jobs: spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.BUILDCACHE_TOKEN }}" mapl-buildcache spack -e spack-env mirror list spack -e spack-env buildcache update-index mapl-buildcache - spack -e spack-env buildcache list --all-arch + spack -e spack-env buildcache list --allarch #- name: Concretize #shell: spack-bash {0} From 8757b8d01800faf2d8708366093e3751e94e5b1f Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 24 Oct 2024 16:03:03 -0400 Subject: [PATCH 16/22] Turn back on install --- .github/workflows/spack-ci.yml | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 649e53552724..0c70e142956c 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -51,24 +51,24 @@ jobs: spack -e spack-env buildcache update-index mapl-buildcache spack -e spack-env buildcache list --allarch - #- name: Concretize - #shell: spack-bash {0} - #run: | - #spack -e spack-env concretize + - name: Concretize + shell: spack-bash {0} + run: | + spack -e spack-env concretize - #- name: Install - #shell: spack-bash {0} - #run: | - #spack -e spack-env install --add --no-check-signature \ - #esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + - name: Install + shell: spack-bash {0} + run: | + spack -e spack-env install --add --no-check-signature --use-buildcache only \ + esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - #- name: Build with Cmake - #shell: spack-bash {0} - #run: | - #FC=gfortran-13 CC=gcc-13 CXX=g++-13 - #spack -e spack-env load \ - #esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - #cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF - #cmake --build build -j 4 - #cmake --install build + - name: Build with Cmake + shell: spack-bash {0} + run: | + FC=gfortran-13 CC=gcc-13 CXX=g++-13 + spack -e spack-env load \ + esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF + cmake --build build -j 4 + cmake --install build From ef196918595c31ceb774c644ef3b32752bad1f72 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 25 Oct 2024 10:26:51 -0400 Subject: [PATCH 17/22] Try this again --- .github/workflows/spack-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 0c70e142956c..f53f28a90b59 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -66,6 +66,9 @@ jobs: shell: spack-bash {0} run: | FC=gfortran-13 CC=gcc-13 CXX=g++-13 + ${FC} --version + ${CC} --version + ${CXX} --version spack -e spack-env load \ esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF From 7aa247a7b5e9e110790f68ace98ed6fd10b30fa1 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 25 Oct 2024 10:35:59 -0400 Subject: [PATCH 18/22] Fix load --- .github/workflows/spack-ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index f53f28a90b59..96af85d79707 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -65,13 +65,11 @@ jobs: - name: Build with Cmake shell: spack-bash {0} run: | - FC=gfortran-13 CC=gcc-13 CXX=g++-13 - ${FC} --version - ${CC} --version - ${CXX} --version - spack -e spack-env load \ + spack env status + spack load \ esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF + spack find --loaded + cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} cmake --build build -j 4 cmake --install build From 86d24de22955085495578758989f3c41f7ab2888 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 25 Oct 2024 10:39:04 -0400 Subject: [PATCH 19/22] Add activate? --- .github/workflows/spack-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 96af85d79707..a811bfb4ef86 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -65,7 +65,7 @@ jobs: - name: Build with Cmake shell: spack-bash {0} run: | - spack env status + spack env activate spack-env spack load \ esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits spack find --loaded From 71d7507269db70752628b3dcf916ef76f25b393e Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 25 Oct 2024 10:50:53 -0400 Subject: [PATCH 20/22] Set FC --- .github/workflows/spack-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index a811bfb4ef86..a90f4a98ede0 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -69,6 +69,7 @@ jobs: spack load \ esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits spack find --loaded + FC=gfortran-13 CC=gcc-13 CXX=g++-13 cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} cmake --build build -j 4 cmake --install build From 475b41c5d642ba4161432bfffa9ffae35912a6d1 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 25 Oct 2024 10:57:02 -0400 Subject: [PATCH 21/22] Add mepo --- .github/workflows/spack-ci.yml | 132 ++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 59 deletions(-) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index a90f4a98ede0..770949d28054 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -14,63 +14,77 @@ jobs: runs-on: ubuntu-24.04 steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Spack - uses: spack/setup-spack@v2 - with: - ref: develop # Spack version (examples: develop, releases/v0.21) - color: true # Force color output (SPACK_COLOR=always) - path: spack # Where to clone Spack - buildcache: false # Do not use the spack buildcache - - - name: Find compilers - shell: spack-bash {0} - run: | - spack compiler find - - - name: Set default compiler and target - shell: spack-bash {0} - run: | - spack config add 'packages:all:compiler:[gcc@13.2.0]' - spack config add 'packages:all:require:target=x86_64_v3' - - - name: Create Spack environment - shell: spack-bash {0} - run: | - spack env create spack-env - spack env activate spack-env - - - name: Login - shell: spack-bash {0} - run: | - spack -e spack-env mirror add mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache - spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.BUILDCACHE_TOKEN }}" mapl-buildcache - spack -e spack-env mirror list - spack -e spack-env buildcache update-index mapl-buildcache - spack -e spack-env buildcache list --allarch - - - name: Concretize - shell: spack-bash {0} - run: | - spack -e spack-env concretize - - - name: Install - shell: spack-bash {0} - run: | - spack -e spack-env install --add --no-check-signature --use-buildcache only \ - esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - - - name: Build with Cmake - shell: spack-bash {0} - run: | - spack env activate spack-env - spack load \ - esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits - spack find --loaded - FC=gfortran-13 CC=gcc-13 CXX=g++-13 - cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} - cmake --build build -j 4 - cmake --install build + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Pip install mepo + run: | + python -m pip install --upgrade pip + pip install mepo + + - name: Mepo clone + run: | + mepo clone + + - name: Set up Spack + uses: spack/setup-spack@v2 + with: + ref: develop # Spack version (examples: develop, releases/v0.21) + color: true # Force color output (SPACK_COLOR=always) + path: spack # Where to clone Spack + buildcache: false # Do not use the spack buildcache + + - name: Find compilers + shell: spack-bash {0} + run: | + spack compiler find + + - name: Set default compiler and target + shell: spack-bash {0} + run: | + spack config add 'packages:all:compiler:[gcc@13.2.0]' + spack config add 'packages:all:require:target=x86_64_v3' + + - name: Create Spack environment + shell: spack-bash {0} + run: | + spack env create spack-env + spack env activate spack-env + + - name: Login + shell: spack-bash {0} + run: | + spack -e spack-env mirror add mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache + spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.BUILDCACHE_TOKEN }}" mapl-buildcache + spack -e spack-env mirror list + spack -e spack-env buildcache update-index mapl-buildcache + spack -e spack-env buildcache list --allarch + + - name: Concretize + shell: spack-bash {0} + run: | + spack -e spack-env concretize + + - name: Install + shell: spack-bash {0} + run: | + spack -e spack-env install --add --no-check-signature --use-buildcache only \ + esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + + - name: Build with Cmake + shell: spack-bash {0} + run: | + spack env activate spack-env + spack load \ + esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits + spack find --loaded + FC=gfortran-13 CC=gcc-13 CXX=g++-13 + cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} + cmake --build build -j 4 + cmake --install build From fa2ad1a83b16bf72b29ee12736406507ca3d45d8 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 25 Oct 2024 11:11:28 -0400 Subject: [PATCH 22/22] Add tests --- .github/workflows/spack-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/spack-ci.yml b/.github/workflows/spack-ci.yml index 770949d28054..22ae2f17b98c 100644 --- a/.github/workflows/spack-ci.yml +++ b/.github/workflows/spack-ci.yml @@ -87,4 +87,6 @@ jobs: cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} cmake --build build -j 4 cmake --install build + cd build + make -j4 tests