-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from AlexanderRichert-NOAA/ci_updates_nov2023
Add IntelLLVM support & add Spack-based CI
- Loading branch information
Showing
7 changed files
with
166 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# This is a CI workflow for the NCEPLIBS-ncio project. | ||
# | ||
# This workflow builds ncio with Spack, including installing with the "--test | ||
# root" option to run the Ctest suite. It also has a one-off job that validates | ||
# the recipe by ensuring that every CMake option that should be set in the | ||
# Spack recipe is so set. | ||
# | ||
# Alex Richert, Sep 2023 | ||
name: Spack | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
Spack: | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
- name: checkout-ncio | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ncio | ||
|
||
- name: cache-spack | ||
id: cache-spack | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/spack-build-cache | ||
key: spack-build-cache-${{ matrix.os }}-1 | ||
|
||
- name: spack-build-and-test | ||
run: | | ||
sudo apt install openmpi-bin libopenmpi-dev | ||
cd | ||
git clone -c feature.manyFiles=true https://github.com/jcsda/spack | ||
. spack/share/spack/setup-env.sh | ||
spack env create ncio-env | ||
spack env activate ncio-env | ||
cp $GITHUB_WORKSPACE/ncio/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/ncio/package.py | ||
spack develop --no-clone --path $GITHUB_WORKSPACE/ncio ncio@develop | ||
spack add ncio@develop%gcc@11 ^netcdf-c ~blosc ~szip ^openmpi | ||
spack external find cmake gmake openmpi | ||
spack config add "packages:openmpi:buildable:false" | ||
for mirror in $(spack mirror list | awk '{print $1}'); do | ||
spack mirror rm --scope defaults ${mirror} | ||
done | ||
spack mirror add spack-build-cache ~/spack-build-cache | ||
spack concretize | ||
# Run installation and run CTest suite | ||
if [ "${{ steps.cache.outputs.cache-hit }}" == true ]; then deps=only; else deps=auto; fi | ||
spack install --verbose --fail-fast --no-check-signature --use-buildcache package:never,dependencies:${deps} --test root | ||
# Run 'spack load' to check for obvious errors in setup_run_environment | ||
spack load ncio | ||
ls $NCIO_LIB | ||
spack buildcache push --only dependencies --unsigned --allow-root ~/spack-build-cache ncio | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() }} | ||
with: | ||
name: spackci-ctest-output-${{ matrix.os }}-${{ matrix.openmp }} | ||
path: ${{ github.workspace }}/ncio/spack-build-*/Testing/Temporary/LastTest.log | ||
|
||
# This job validates the Spack recipe by making sure each cmake build option is represented | ||
recipe-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: checkout-ncio | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ncio | ||
|
||
- name: recipe-check | ||
run: | | ||
echo "If this jobs fails, look at the most recently output CMake option below and make sure that option appears in spack/package.py" | ||
for opt in $(grep -ioP '^option\(\K(?!(ENABLE_DOCS))[^ ]+' $GITHUB_WORKSPACE/ncio/CMakeLists.txt) ; do | ||
echo "Checking for presence of '$opt' CMake option in package.py" | ||
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/ncio/spack/package.py | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This directory contains an authoritative, up-to-date Spack recipe for NCEPLIBS-ncio, which is found under Spack as "ncio". | ||
|
||
Before each release of NCEPLIBS-ncio, this file should be updated to accommodate changes in build options, etc., and .github/workflows/spack.yml should be updated to exercise all variants. Only the version entry should need to be updated after the release prior to incorporation into the Spack repository and the JCSDA Spack fork. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
from spack.package import * | ||
|
||
|
||
class Ncio(CMakePackage): | ||
"""This is a library used by NCEP GSI system to read the GFS forecast | ||
files for use in data assimilation. | ||
This is part of NOAA's NCEPLIBS project.""" | ||
|
||
homepage = "https://github.com/NOAA-EMC/NCEPLIBS-ncio" | ||
url = "https://github.com/NOAA-EMC/NCEPLIBS-ncio/archive/refs/tags/v1.0.0.tar.gz" | ||
git = "https://github.com/NOAA-EMC/NCEPLIBS-ncio" | ||
|
||
maintainers("edwardhartnett", "AlexanderRichert-NOAA", "Hang-Lei-NOAA") | ||
|
||
version("develop", branch="develop") | ||
version("1.1.2", sha256="2e4506fe3176344f28e837f2f69bcbd3dda51a64cacf33af0e435b13abe094fc") | ||
version("1.1.1", sha256="c1cfeb3d731a2ae858bdfc02b2914fd6c8eac5cc76c7e67eb2580ae5e7500a2b") | ||
version("1.1.0", sha256="9de05cf3b8b1291010197737666cede3d621605806379b528d2146c4f02d08f6") | ||
version("1.0.0", sha256="2e2630b26513bf7b0665619c6c3475fe171a9d8b930e9242f5546ddf54749bd4") | ||
|
||
depends_on("mpi") | ||
depends_on("netcdf-fortran") | ||
|
||
def setup_run_environment(self, env): | ||
lib = find_libraries("libncio", root=self.prefix, shared=False, recursive=True) | ||
env.set("NCIO_LIB", lib[0]) | ||
env.set("NCIO_INC", join_path(self.prefix, "include")) | ||
env.set("NCIO_LIBDIR", lib[0]) | ||
|
||
def check(self): | ||
with working_dir(self.builder.build_directory): | ||
make("test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters