Skip to content

Commit

Permalink
Simplify and cache Intel CI setup
Browse files Browse the repository at this point in the history
Update to 'icx'

Source Intel compilers after install

Revert to ICC

Test version output of compilers

Export paths to installed netCDF

Fixed variable error

Try to add netCDF to pkg-config path

Remove output from 'nf-config'

Test path to netCDF pkgconfig

Fix path to pkgconfig

Add environment setup

Update cache path

Separate cache into two steps

Move environment setup to top

Removed parallel compilation

Debug NFDIR path during caching

Move debug output

Debug more netCDF paths

Install other dependencies independent of Intel
  • Loading branch information
Jørgen Nordmoen committed Apr 22, 2021
1 parent 0c7f492 commit f183aaa
Showing 1 changed file with 40 additions and 23 deletions.
63 changes: 40 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@ jobs:
matrix:
os: [ubuntu-20.04, macos-10.15]
mpi: [true, false]

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: meson

- name: Setup Python for newer version of Meson
uses: actions/setup-python@v2

- name: Install dependencies - Ubuntu
run: |
sudo apt update
Expand All @@ -35,6 +26,12 @@ jobs:
HOMEBREW_NO_INSTALL_CLEANUP: 1
if: runner.os == 'macOS'

- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python for newer version of Meson
uses: actions/setup-python@v2

- name: Run Meson build step
uses: BSFishy/[email protected]
env:
Expand All @@ -56,31 +53,57 @@ jobs:
env:
CC: icc
FC: ifort
NFDIR: '/opt/netcdf'
steps:
- name: Setup Intel repository
- name: Install dependencies
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt update
sudo apt install -y ninja-build libnetcdf-dev
- name: Cache Intel setup
id: cache-intel
uses: actions/cache@v2
with:
path: /opt/intel/
key: intel-${{ runner.os }}-compiler

- name: Setup Intel compiler
if: steps.cache-intel.outputs.cache-hit != 'true'
run: |
wget -q https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt update
sudo apt install -y\
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic\
intel-oneapi-compiler-fortran intel-oneapi-mpi-devel
- name: Install dependencies
run: sudo apt install -y ninja-build libnetcdf-dev intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-mpi-devel
- name: Cache netCDF install
id: cache-netcdf
uses: actions/cache@v2
with:
path: ${{ env.NFDIR }}
key: netcdf-4.5.2-${{ runner.os }}-intel

- name: Checkout netCDF for compiling with Intel
if: steps.cache-netcdf.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: 'Unidata/netcdf-fortran'
ref: 'v4.5.2'

- name: Compile and install custom netCDF
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
source /opt/intel/oneapi/setvars.sh
./configure --prefix="$NFDIR"
make
sudo make install
env:
NFDIR: /usr/local
- name: Setup netCDF environment
run: |
echo "${NFDIR}/bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=${NFDIR}/lib/pkgconfig" >> $GITHUB_ENV
- name: Setup Python for newer version of Meson
uses: actions/setup-python@v2
Expand All @@ -90,15 +113,9 @@ jobs:

- name: Checkout code
uses: actions/checkout@v2
with:
ref: meson

- name: Setup build directory
- name: Build with Intel compilers
run: |
source /opt/intel/oneapi/setvars.sh
meson setup builddir -Dmpi=${{ matrix.mpi }}
- name: Compile source code
run: |
source /opt/intel/oneapi/setvars.sh
meson compile -C builddir

0 comments on commit f183aaa

Please sign in to comment.