Add IntelLLVM support & add Spack-based CI #118
Workflow file for this run
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 is a GitHub CI workflow for the NCEPLIBS-ncio project. | |
# | |
# This workflow runs the intel compiler. | |
# | |
# Ed Hartnett 1/12/23 | |
name: Intel | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
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: ["oneapi", "classic"] | |
steps: | |
- uses: actions/checkout@v2 | |
# See https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html | |
- name: install-dependencies | |
run: | | |
cd /tmp | |
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-dev-utilities intel-oneapi-openmp intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran | |
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile | |
if [ ${{ matrix.compilers }} == "oneapi" ]; then | |
echo "export CC=mpiicx FC=mpiifx" >> ~/.bash_profile | |
elif [ ${{ matrix.compilers }} == "intel" ]; then | |
echo "export CC=mpiicc FC=mpiifort" >> ~/.bash_profile | |
fi | |
- name: cache-netcdf | |
id: cache-netcdf | |
uses: actions/cache@v2 | |
with: | |
path: ~/netcdf | |
key: Linux-netcdf-c-4.9.2-${{ runner.os }}-${{ matrix.compilers }} | |
- name: build-hdf5 | |
if: steps.cache-netcdf.outputs.cache-hit != 'true' | |
run: | | |
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.3/src/hdf5-1.14.3.tar.gz &> /dev/null | |
tar -xzf hdf5-1.14.3.tar.gz | |
pushd hdf5-1.14.3 | |
./configure --prefix=${HOME}/netcdf --enable-parallel --disable-tools --disable-fortran --disable-cxx --disable-parallel-tests --disable-tests --disable-static | |
make -j2 VERBOSE=1 | |
make install | |
- name: build-netcdf-c | |
if: steps.cache-netcdf.outputs.cache-hit != 'true' | |
run: | | |
export CPPFLAGS=-I${HOME}/netcdf/include | |
export LDFLAGS=-L${HOME}/netcdf/lib | |
wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.2.tar.gz | |
tar -xzf v4.9.2.tar.gz | |
cd netcdf-c-4.9.2 | |
./configure --prefix=${HOME}/netcdf --disable-dap --disable-byterange --disable-utilities | |
make -j2 VERBOSE=1 | |
make install | |
- name: build-netcdf-fortran | |
if: steps.cache-netcdf.outputs.cache-hit != 'true' | |
run: | | |
# Avoid mpiifx wrapper bug in netcdf-fortran installation | |
if [ ${{ matrix.compilers}} == oneapi ]; then | |
export CC=icx FC=ifx | |
fi | |
export PATH="${HOME}/netcdf/bin:$PATH" | |
export CPPFLAGS=-I${HOME}/netcdf/include | |
export LDFLAGS=-L${HOME}/netcdf/lib | |
export LD_LIBRARY_PATH=${HOME}/netcdf/lib:$LD_LIBRARY_PATH | |
wget https://github.com/Unidata/netcdf-fortran/archive/v4.6.1.tar.gz &> /dev/null | |
tar -xzf v4.6.1.tar.gz | |
pushd netcdf-fortran-4.6.1 | |
./configure --prefix=${HOME}/netcdf | |
make -j2 VERBOSE=1 | |
make install | |
- name: build and test | |
run: | | |
mkdir build && cd build | |
cmake -DCMAKE_PREFIX_PATH='~;~/netcdf' .. | |
make -j2 VERBOSE=1 | |
ctest --verbose --output-on-failure --rerun-failed |