Skip to content

Add CI for MacOS

Add CI for MacOS #16

Workflow file for this run

name: MacOS Intel
# triggered events (push, pull_request) for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
macos_Build:
name: Mac OS Intel Build
# The type of runner that the job will run on
runs-on: macos-13
env:
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/edb4dc2f-266f-47f2-8d56-21bc7764e119/m_HPCKit_p_2023.2.0.49443_offline.dmg
CC: icc
FC: ifort
steps:
# Prepare for Intel cache restore
- name: Prepare for Intel cache restore
run: |
sudo mkdir -p /opt/intel
sudo chown $USER /opt/intel
# Cache Intel HPC Toolkit
- name: Cache Intel HPC Toolkit
id: cache-intel-hpc-toolkit
uses: actions/cache@v2
with:
path: /opt/intel/oneapi
key: install-${{ env.MACOS_HPCKIT_URL }}-all
# Install Intel HPC Toolkit
- name: Install Intel HPC Toolkit
if: steps.cache-intel-hpc-toolkit.outputs.cache-hit != 'true'
run: |
curl --output webimage.dmg --url "$MACOS_HPCKIT_URL" --retry 5 --retry-delay 5
hdiutil attach webimage.dmg
sudo /Volumes/$(basename $MACOS_HPCKIT_URL .dmg)/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components=all --eula=accept --continue-with-optional-error=yes --log-dir=.
hdiutil detach /Volumes/$(basename "$MACOS_HPCKIT_URL" .dmg) -quiet
# Check location of installed Intel compilers
- name: Check compiler install
run: |
source /opt/intel/oneapi/setvars.sh
which icc
which ifort
# Cache OpenMPI
- name: Cache OpenMPI
uses: actions/cache@v3
id: cache-openmpi
with:
path: ~/openmpi
key: openmpi-4.1.6-${{ runner.os }}-intel
# Install OpenMPI
- name: Install OpenMPI
if: ${{ steps.cache-openmpi.outputs.cache-hit != 'true' }}
run: |
source /opt/intel/oneapi/setvars.sh
export CC="icc -m64"
export FC="ifort -m64"
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.gz
tar -xvf ./openmpi-4.1.6.tar.gz
cd openmpi-4.1.6
./configure --prefix=${HOME}/openmpi
make -j2
sudo make install
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
# Test debug mode
- name: Test gf Debug
run: |
source /opt/intel/oneapi/setvars.sh
export PATH="${HOME}/openmpi/bin:$PATH"
cd ref
rm -rf build
mkdir build
cd build
#export OMP_NUM_THREADS=4
export CC=icc
export FC=ifort
cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_PREFIX_PATH='~;~/openmpi' -DMPIEXEC_PREFLAGS=--oversubscribe -DENABLE_GPU=off ..
make VERBOSE=1
ulimit -s hard
ctest --output-on-failure
# Test release mode
# INTEL CLASSIC COMPILERS HANG WHILE BUILDING cu_gf_deep.F90, TURN OFF FOR NOW
#- name: Test gf Release
# run: |
# source /opt/intel/oneapi/setvars.sh
# export PATH="${HOME}/openmpi/bin:$PATH"
# cd ref
# rm -rf build
# mkdir build
# cd build
# #export OMP_NUM_THREADS=4
# export CC=icc
# export FC=ifort
# cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH='~;~/openmpi' -DMPIEXEC_PREFLAGS=--oversubscribe -DENABLE_GPU=off ..
# make VERBOSE=1
# ulimit -s hard
# ctest --output-on-failure
# Debug session for failures
-
name: Debug session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
limit-access-to-actor: true