|
| 1 | +# UFS_UTILS test workflow. |
| 2 | +# |
| 3 | +# This workflow tests UFS_UTILS with the Intel compiler. |
| 4 | +# |
| 5 | +# Ed Hartnett 12/14/22 |
| 6 | +name: Intel1 |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - develop |
| 11 | + paths-ignore: |
| 12 | + - README.md |
| 13 | + pull_request: |
| 14 | + branches: |
| 15 | + - develop |
| 16 | + paths-ignore: |
| 17 | + - README.md |
| 18 | + |
| 19 | +# Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh |
| 20 | +# without having to do it in manually every step. |
| 21 | +defaults: |
| 22 | + run: |
| 23 | + shell: bash -leo pipefail {0} |
| 24 | + |
| 25 | +jobs: |
| 26 | + Intel: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + env: |
| 29 | + CC: icc |
| 30 | + FC: ifort |
| 31 | + |
| 32 | + steps: |
| 33 | + |
| 34 | + # See https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html |
| 35 | + - name: install-intel |
| 36 | + run: | |
| 37 | + cd /tmp |
| 38 | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB |
| 39 | + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB |
| 40 | + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB |
| 41 | + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list |
| 42 | + sudo apt-get update |
| 43 | + sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic |
| 44 | + echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile |
| 45 | +
|
| 46 | + - name: cache-netcdf |
| 47 | + id: cache-netcdf |
| 48 | + uses: actions/cache@v2 |
| 49 | + with: |
| 50 | + path: ~/netcdf |
| 51 | + key: Intel-netcdf-c-$4.7.4-{{ runner.os }}-intel3 |
| 52 | + |
| 53 | + - name: build-hdf5 |
| 54 | + if: steps.cache-netcdf.outputs.cache-hit != 'true' |
| 55 | + run: | |
| 56 | + export CC=mpiicc |
| 57 | + wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.7/src/hdf5-1.10.7.tar.gz &> /dev/null |
| 58 | + tar -xzf hdf5-1.10.7.tar.gz |
| 59 | + pushd hdf5-1.10.7 |
| 60 | + ./configure --prefix=${HOME}/netcdf --enable-parallel --disable-tools --disable-fortran --disable-cxx --enable-parallel-tests --disable-shared --disable-shared --enable-static |
| 61 | + make -j2 |
| 62 | + make install |
| 63 | + |
| 64 | + - name: build-netcdf-c |
| 65 | + if: steps.cache-netcdf.outputs.cache-hit != 'true' |
| 66 | + run: | |
| 67 | + export CC=mpiicc |
| 68 | + export CPPFLAGS=-I${HOME}/netcdf/include |
| 69 | + export LDFLAGS=-L${HOME}/netcdf/lib |
| 70 | + wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.7.4.tar.gz &> /dev/null |
| 71 | + tar -xzf v4.7.4.tar.gz |
| 72 | + pushd netcdf-c-4.7.4 |
| 73 | + ./configure --prefix=${HOME}/netcdf --disable-dap --disable-utilities --disable-shared |
| 74 | + make -j2 |
| 75 | + make install |
| 76 | +
|
| 77 | + - name: build-netcdf-fortran |
| 78 | + if: steps.cache-netcdf.outputs.cache-hit != 'true' |
| 79 | + run: | |
| 80 | + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${HOME}/netcdf/lib" |
| 81 | + export PATH="${HOME}/netcdf/bin:$PATH" |
| 82 | + export CC=mpiicc |
| 83 | + export FC=mpiifort |
| 84 | + export CPPFLAGS=-I${HOME}/netcdf/include |
| 85 | + export LDFLAGS=-L${HOME}/netcdf/lib |
| 86 | + export LIBS=`nc-config --libs` |
| 87 | + wget https://github.com/Unidata/netcdf-fortran/archive/v4.5.3.tar.gz &> /dev/null |
| 88 | + tar -xzf v4.5.3.tar.gz |
| 89 | + pushd netcdf-fortran-4.5.3 |
| 90 | + ./configure --prefix=${HOME}/netcdf --disable-shared |
| 91 | + make -j2 |
| 92 | + make install |
| 93 | +
|
| 94 | + - name: cache-esmf |
| 95 | + id: cache-esmf |
| 96 | + uses: actions/cache@v2 |
| 97 | + with: |
| 98 | + path: ~/esmf |
| 99 | + key: Intel-esmf-8.2.0-${{ runner.os }}-intel3 |
| 100 | + |
| 101 | + - name: build-esmf |
| 102 | + if: steps.cache-esmf.outputs.cache-hit != 'true' |
| 103 | + run: | |
| 104 | + pushd ~ |
| 105 | + export ESMF_DIR=~/esmf-ESMF_8_2_0 |
| 106 | + wget https://github.com/esmf-org/esmf/archive/ESMF_8_2_0.tar.gz &> /dev/null |
| 107 | + tar zxf ESMF_8_2_0.tar.gz |
| 108 | + cd esmf-ESMF_8_2_0 |
| 109 | + export ESMF_COMM=intelmpi |
| 110 | + export ESMF_INSTALL_BINDIR=bin |
| 111 | + export ESMF_INSTALL_LIBDIR=lib |
| 112 | + export ESMF_INSTALL_MODDIR=mod |
| 113 | + export ESMF_COMPILER=intel |
| 114 | + export ESMF_INSTALL_PREFIX=~/esmf |
| 115 | + export ESMF_NETCDF=split |
| 116 | + export ESMF_NETCDF_INCLUDE=${HOME}/netcdf/include |
| 117 | + export ESMF_NETCDF_LIBPATH=${HOME}/netcdf/lib |
| 118 | + export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz" |
| 119 | + make -j2 |
| 120 | + make install |
| 121 | +
|
| 122 | + - name: cache-jasper |
| 123 | + id: cache-jasper |
| 124 | + uses: actions/cache@v2 |
| 125 | + with: |
| 126 | + path: ~/jasper |
| 127 | + key: Intel-jasper-2.0.25-${{ runner.os }}-intel3 |
| 128 | + |
| 129 | + - name: build-jasper |
| 130 | + if: steps.cache-jasper.outputs.cache-hit != 'true' |
| 131 | + run: | |
| 132 | + wget https://github.com/jasper-software/jasper/archive/version-2.0.25.tar.gz &> /dev/null |
| 133 | + tar zxf version-2.0.25.tar.gz |
| 134 | + cd jasper-version-2.0.25 |
| 135 | + mkdir build-jasper && cd build-jasper |
| 136 | + cmake .. -DCMAKE_INSTALL_PREFIX=~/jasper -DJAS_ENABLE_SHARED=OFF |
| 137 | + make -j2 |
| 138 | + make install |
| 139 | +
|
| 140 | + - name: checkout-nceplibs |
| 141 | + uses: actions/checkout@v2 |
| 142 | + with: |
| 143 | + repository: NOAA-EMC/NCEPLIBS |
| 144 | + path: nceplibs |
| 145 | + |
| 146 | + - name: cache-nceplibs |
| 147 | + id: cache-nceplibs |
| 148 | + uses: actions/cache@v2 |
| 149 | + with: |
| 150 | + path: ~/nceplibs |
| 151 | + key: Intel-nceplibs-1.4.0-${{ runner.os }}-intel3 |
| 152 | + |
| 153 | + - name: build-nceplibs |
| 154 | + if: steps.cache-nceplibs.outputs.cache-hit != 'true' |
| 155 | + run: | |
| 156 | + export ESMFMKFILE=~/esmf/lib/esmf.mk |
| 157 | + wget https://github.com/NOAA-EMC/NCEPLIBS/archive/v1.4.0.tar.gz &> /dev/null |
| 158 | + tar zxf v1.4.0.tar.gz |
| 159 | + cd NCEPLIBS-1.4.0 |
| 160 | + mkdir build && cd build |
| 161 | + cmake .. -DCMAKE_PREFIX_PATH='~;~/jasper;~/netcdf' -DCMAKE_INSTALL_PREFIX='~/nceplibs' -DFLAT=ON |
| 162 | + make -j2 |
| 163 | + |
| 164 | + - name: checkout-ufs-utils |
| 165 | + uses: actions/checkout@v2 |
| 166 | + with: |
| 167 | + path: ufs_utils |
| 168 | + submodules: recursive |
| 169 | + |
| 170 | + - name: cache-data |
| 171 | + id: cache-data |
| 172 | + uses: actions/cache@v2 |
| 173 | + with: |
| 174 | + path: ~/data |
| 175 | + key: data-1 |
| 176 | + |
| 177 | + - name: build |
| 178 | + run: | |
| 179 | + export ESMFMKFILE=~/esmf/lib/esmf.mk |
| 180 | + cd ufs_utils |
| 181 | + mkdir build && cd build |
| 182 | + export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:~/jasper/lib;~/jasper/lib64" |
| 183 | + cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH='~;~/jasper;~/nceplibs;~/netcdf' .. |
| 184 | + make -j2 |
| 185 | + |
| 186 | + - name: test |
| 187 | + run: | |
| 188 | + cd ufs_utils/build |
| 189 | + ctest --rerun-failed --output-on-failure |
| 190 | +
|
| 191 | + - name: cache-data |
| 192 | + if: steps.cache-data.outputs.cache-hit != 'true' |
| 193 | + run: | |
| 194 | + mkdir ~/data |
| 195 | + cp ufs_utils/build/tests/chgres_cube/data/* ~/data |
| 196 | + cp ufs_utils/build/tests/sfc_climo_gen/data/* ~/data |
| 197 | + cp ufs_utils/build/tests/cpld_gridgen/data/* ~/data |
| 198 | + cp ufs_utils/tests/filter_topo/data/* ~/data |
| 199 | + cp ufs_utils/tests/emcsfc_snow2mdl/data/* ~/data |
| 200 | + cp ufs_utils/tests/chgres_cube/data/* ~/data |
| 201 | + ls -l ~/data |
| 202 | + |
0 commit comments