Skip to content

CMake fixes

CMake fixes #724

Workflow file for this run

# This is a basic workflow to compile DALES
name: DALES compilation CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events
push:
branches:
pull_request:
branches:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["gnu", "intel"]
hypre: ["On", "Off"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Install common dependencies
run: |
# Enable sources for netcdff-dev
sudo sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list"
sudo apt-get update
sudo apt-get install -y cmake libfftw3-dev libhypre-dev libnetcdf-dev
- name : Install Intel (oneapi) dependencies
if: matrix.toolchain == 'intel'
run: |
# use wget to fetch the Intel repository public key
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# add to your apt sources keyring so that archives signed with this key will be trusted.
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# remove the public key
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt install -y intel-oneapi-mpi-devel intel-oneapi-compiler-fortran
- name: Checkout NetCdf-Fortran for Intel
if: matrix.toolchain == 'intel'
uses: actions/checkout@v2
with:
repository: Unidata/netcdf-fortran
ref: 4.4.4
path: netcdf-fortran
- name: Compile netcdf-Fortran for Intel
if: matrix.toolchain == 'intel'
run: |
source /opt/intel/oneapi/setvars.sh
#make sure ifx is found
sudo ln -s `which ifx` /usr/bin/ifx
cd netcdf-fortran
NCDIR=/usr FC=/usr/bin/ifx ./configure
sudo make -j2
sudo make install
- name: Install Gnu dependencies
if: matrix.toolchain == 'gnu'
run: |
sudo apt-get install -y libopenmpi-dev libnetcdff-dev
- name : Set up Build
run: |
if [[ -f /opt/intel/oneapi/setvars.sh ]]; then
source /opt/intel/oneapi/setvars.sh
export FC=mpiifx
fi
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=DEBUG -DENABLE_HYPRE=${{ matrix.hypre }} ../
- name : Build
run: |
if [[ -f /opt/intel/oneapi/setvars.sh ]]; then
source /opt/intel/oneapi/setvars.sh
fi
cd build
make -j2