Skip to content

Commit

Permalink
Update to the latest yaml for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao committed May 18, 2024
1 parent 8bc716b commit 49b6541
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 16 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/mac_mpich.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '**/*.jpg'
- '**/*.png'
- 'docs/*'
- 'test/test_installed/*'
pull_request:
branches: [ master, test_github_actions ]
paths-ignore:
Expand All @@ -19,19 +20,20 @@ on:
- '**/*.jpg'
- '**/*.png'
- 'docs/*'
- 'test/test_installed/*'

env:
MPICH_VERSION: 4.0.3
MPICH_VERSION: 4.2.0

jobs:
build:
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
brew instal gcc
brew install gcc
which gcc
gcc --version
ls -l /usr/local/bin/gfortran*
Expand All @@ -54,7 +56,7 @@ jobs:
done
which gfortran
gfortran --version
brew instal automake autoconf libtool m4
brew install automake autoconf libtool m4
- name: Build MPICH
run: |
cd ${GITHUB_WORKSPACE}
Expand Down
67 changes: 55 additions & 12 deletions .github/workflows/mac_openmpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '**/*.jpg'
- '**/*.png'
- 'docs/*'
- 'test/test_installed/*'
pull_request:
branches: [ master, test_github_actions ]
paths-ignore:
Expand All @@ -19,22 +20,65 @@ on:
- '**/*.jpg'
- '**/*.png'
- 'docs/*'
- 'test/test_installed/*'

env:
OPENMPI_VERSION: 5.0.2

jobs:
build:
runs-on: macos-latest
timeout-minutes: 60
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
brew instal automake autoconf libtool m4 open-mpi zlib
echo "---- location of OpenMPI C compiler ----"
which mpicc
brew install gcc
which gcc
gcc --version
ls -l /usr/local/bin/gfortran*
version=12
ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran
ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc
ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++
# link lib dir for previous GCC versions to avoid missing .dylib issues
for (( i=12; i>4; i-- ))
do
gcc_lib_path="/usr/local/opt/gcc/lib/gcc/$i"
if [ -d $gcc_lib_path ]; then
echo "found $gcc_lib_path"
for (( j=$i; j>4; j-- ))
do
ln -fs /usr/local/opt/gcc/lib/gcc/$i /usr/local/opt/gcc/lib/gcc/$j
done
break
fi
done
which gfortran
gfortran --version
brew install automake autoconf libtool m4
- name: Build OPENMPI
run: |
cd ${GITHUB_WORKSPACE}
rm -rf OPENMPI ; mkdir OPENMPI ; cd OPENMPI
VER_MAJOR=${OPENMPI_VERSION%.*}
wget -q https://download.open-mpi.org/release/open-mpi/v${VER_MAJOR}/openmpi-${OPENMPI_VERSION}.tar.gz
gzip -dc openmpi-${OPENMPI_VERSION}.tar.gz | tar -xf -
cd openmpi-${OPENMPI_VERSION}
./configure --prefix=${GITHUB_WORKSPACE}/OPENMPI \
--silent \
--with-io-romio-flags="--with-file-system=ufs" \
--with-hwloc=internal \
--with-pmix=internal \
--with-libevent=internal \
CC=gcc \
FC=gfortran \
FCFLAGS=-fallow-argument-mismatch
make -s LIBTOOLFLAGS=--silent V=1 -j 8 install > qout 2>&1
make -s -j 8 distclean >> qout 2>&1
- name: Build PnetCDF
run: |
cd ${GITHUB_WORKSPACE}
export TMPDIR=/tmp
autoreconf -i
mkdir -p pnetcdf_output
./configure --enable-option-checking=fatal \
Expand All @@ -45,7 +89,8 @@ jobs:
--enable-shared \
--enable-thread-safe \
--with-pthread \
TESTMPIRUN="mpiexec --oversubscribe -n NP" \
--with-mpi=${GITHUB_WORKSPACE}/OPENMPI \
TESTMPIRUN="${GITHUB_WORKSPACE}/OPENMPI/bin/mpiexec --oversubscribe -n NP" \
TESTOUTDIR=${GITHUB_WORKSPACE}/pnetcdf_output
make -j 8 tests
- name: Print config.log
Expand All @@ -55,7 +100,6 @@ jobs:
- name: make check
run: |
cd ${GITHUB_WORKSPACE}
export TMPDIR=/tmp
make check
- name: Print test log files
if: ${{ always() }}
Expand All @@ -72,17 +116,16 @@ jobs:
- name: make ptests
run: |
cd ${GITHUB_WORKSPACE}
export TMPDIR=/tmp
make ptests
- name: make distcheck
run: |
cd ${GITHUB_WORKSPACE}
export TMPDIR=/tmp
make -j 8 distcheck DISTCHECK_CONFIGURE_FLAGS="--silent"
make -j 8 distcheck DISTCHECK_CONFIGURE_FLAGS="--silent --with-mpi=${GITHUB_WORKSPACE}/OPENMPI"
- name: Cleanup
if: ${{ always() }}
run: |
cd ${GITHUB_WORKSPACE}
make -s distclean
rm -rf pnetcdf_output
rm -rf ${GITHUB_WORKSPACE}/pnetcdf_output
rm -rf ${GITHUB_WORKSPACE}/OPENMPI

0 comments on commit 49b6541

Please sign in to comment.