Skip to content

Commit

Permalink
Add macOS CI (#11)
Browse files Browse the repository at this point in the history
build on macOS CI with clang and gcc.  tested with mpich.
  • Loading branch information
aerorahul authored Aug 23, 2020
1 parent 0923e86 commit a2896c8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/build_macOS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build macOS
on: [push, pull_request]

jobs:
build:
env:
VERBOSE: 1
runs-on: macos-10.15
strategy:
matrix:
mpi: ['mpich']
compiler: ['clang', 'gcc']

steps:

# - name: Update brew packages
# run: |
# brew update

- name: Get sources
uses: actions/checkout@v2
with:
path: ${{ matrix.compiler }}-${{ matrix.mpi }}

- name: Build
run: |
cd ${{ matrix.compiler }}-${{ matrix.mpi }}
prefix=$GITHUB_WORKSPACE/install-${{ matrix.compiler }}-${{ matrix.mpi }}
export PATH="$prefix/bin:$PATH"
export LD_LIBRARY_PATH="$prefix/lib:$LD_LIBRARY_PATH"
if [[ ${{ matrix.compiler }} == "gcc" ]]; then
export CC=/usr/local/bin/gcc-9
export CXX=/usr/local/bin/g++-9
export FC=/usr/local/bin/gfortran-9
elif [[ ${{ matrix.compiler }} == "clang" ]]; then
export CC=clang
export CXX=clang++
export FC=/usr/local/bin/gfortran-9
fi
export SERIAL_CC=${CC}
export SERIAL_CXX=${CXX}
export SERIAL_FC=${FC}
gcc_ver=$( ${CC} -dumpfullversion -dumpversion )
export HPC_COMPILER="${{ matrix.compiler }}/${gcc_ver}"
export HPC_MPI="${{ matrix.mpi }}/${mpi_ver}"
./build_stack.sh -p $prefix -c config/config_mac.sh -y config/stack_mac.yaml
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.compiler }}-${{ matrix.mpi }}-log
path: ${{ matrix.compiler }}-${{ matrix.mpi }}/log
2 changes: 1 addition & 1 deletion .github/workflows/build_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
elif [[ ${{ matrix.mpi }} == "openmpi" ]]; then
mpi_ver=$( mpiexec --version | grep OpenRTE | awk '{ print $3 }' )
fi
gnu_ver=$( gcc -dumpversion )
gnu_ver=$( gcc -dumpfullversion -dumpversion )
export HPC_COMPILER="gnu/${gnu_ver}"
export HPC_MPI="${{ matrix.mpi }}/${mpi_ver}"
./build_stack.sh -p $prefix -c config/config_custom.sh -y config/stack_custom.yaml
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Software Stack

![Ubuntu](https://github.com/noaa-emc/hpc-stack/workflows/Build%20Ubuntu/badge.svg)
![macOS](https://github.com/noaa-emc/hpc-stack/workflows/Build%20macOS/badge.svg)

This repository provides a unified, shell script based build system for building commonly used software stack.

Expand Down

0 comments on commit a2896c8

Please sign in to comment.