diff --git a/.github/workflows/Intel.yml b/.github/workflows/Intel.yml index 4408977..56db252 100644 --- a/.github/workflows/Intel.yml +++ b/.github/workflows/Intel.yml @@ -7,42 +7,29 @@ on: branches: - develop -# Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh -# without having to do it in manually every step -defaults: - run: - shell: bash -leo pipefail {0} - jobs: Intel: runs-on: ubuntu-latest strategy: matrix: - compilers: ["CC=icc FC=ifort", "CC=icx FC=ifx"] + compilers: ["oneapi", "classic"] steps: + - name: "Install Intel" + uses: NOAA-EMC/ci-install-intel-toolkit@develop + with: + compiler-setup: ${{ matrix.compilers }} + + - name: "Install NetCDF" + run: sudo apt-get install libnetcdf-dev libnetcdff-dev + - name: checkout-wrf_io - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: wrf_io - # See https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html - - name: install-dependencies - run: | - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt-get update - sudo apt-get install intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic - sudo apt-get install libnetcdf-dev libnetcdff-dev - echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile - - name: build_wrf_io run: | - cd wrf_io - mkdir build - cd build - cmake .. - make VERBOSE=1 + cmake -S wrf_io -B wrf_io/build + cmake --build wrf_io/build --verbose diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index cb64ca1..a62542a 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -11,12 +11,12 @@ jobs: Linux: runs-on: ubuntu-latest env: - FC: gfortran-9 - CC: gcc-9 + FC: gfortran-11 + CC: gcc-11 steps: - name: checkout-wrf_io - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: wrf_io @@ -26,10 +26,6 @@ jobs: - name: build_wrf_io run: | - set -x - cd wrf_io - mkdir build - cd build - cmake .. - make VERBOSE=1 + cmake -S wrf_io -B wrf_io/build + cmake --build wrf_io/build --verbose diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index 82a1060..40c509c 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -12,12 +12,12 @@ jobs: runs-on: macos-latest env: FC: gfortran-12 - CC: gcc + CC: gcc-12 steps: - name: checkout-wrf_io - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: wrf_io @@ -30,9 +30,6 @@ jobs: - name: build_wrf_io run: | - set -x - cd wrf_io - mkdir build - cd build - cmake .. - make VERBOSE=1 + cmake -S wrf_io -B wrf_io/build + cmake --build wrf_io/build --verbose + diff --git a/.github/workflows/Spack.yml b/.github/workflows/Spack.yml index dce2854..1cdd577 100644 --- a/.github/workflows/Spack.yml +++ b/.github/workflows/Spack.yml @@ -24,62 +24,26 @@ jobs: steps: - - name: checkout-wrf-io - uses: actions/checkout@v4 - with: - path: wrf-io - - - 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: | - cd - git clone -c feature.manyFiles=true https://github.com/jcsda/spack - . spack/share/spack/setup-env.sh - spack env create wrf-io-env - spack env activate wrf-io-env - cp $GITHUB_WORKSPACE/wrf-io/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/wrf-io/package.py - spack develop --no-clone --path $GITHUB_WORKSPACE/wrf-io wrf-io@develop - spack add wrf-io@develop%gcc@11 ^netcdf-c ~blosc ~szip ~mpi ^hdf5~mpi - 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 - spack buildcache push --only dependencies --unsigned --allow-root ~/spack-build-cache wrf-io - - - name: Upload test results - uses: actions/upload-artifact@v3 - if: ${{ failure() }} + - name: "Build Spack package" + uses: NOAA-EMC/ci-test-spack-package@develop with: - name: spackci-ctest-output-${{ matrix.os }}-${{ matrix.openmp }} - path: ${{ github.workspace }}/wrf-io/spack-build-*/Testing/Temporary/LastTest.log + package-name: wrf-io + package-variants: "^netcdf-c ~blosc ~szip ~mpi ^hdf5~mpi" + custom-recipe: spack/package.py + use-repo-cache: true + spack-compiler: gcc + repo-cache-key-suffix: ${{ matrix.os }}-1 + spack-externals: cmake gmake perl openmpi # This job validates the Spack recipe by making sure each cmake build option is represented recipe-check: runs-on: ubuntu-latest steps: - - - name: checkout-wrf-io - uses: actions/checkout@v4 - with: - path: wrf-io - 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/wrf-io/CMakeLists.txt) ; do - echo "Checking for presence of '$opt' CMake option in package.py" - grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/wrf-io/spack/package.py - done + uses: NOAA-EMC/ci-check-spack-recipe@develop + with: + recipe-file: package/spack/package.py + cmakelists-txt: package/CMakeLists.txt + ignore-list: ENABLE_DOCS diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 6bc3a62..3a370af 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -11,13 +11,13 @@ jobs: developer: runs-on: ubuntu-latest env: - FC: gfortran-9 - CC: gcc-9 + FC: gfortran-11 + CC: gcc-11 steps: - name: checkout-wrf_io - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: wrf_io @@ -28,11 +28,5 @@ jobs: - name: build_wrf_io run: | set -x - cd wrf_io - mkdir build - cd build - cmake -DENABLE_DOCS=On -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fsanitize=address" .. - make VERBOSE=1 - - - + cmake -S wrf_io -B wrf_io/build -DENABLE_DOCS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fsanitize=address" .. + cmake --build wrf_io/build --verbose