Skip to content

Commit

Permalink
Merge pull request #722 from galacticusorg/featBumpMacOS12to13
Browse files Browse the repository at this point in the history
Bumps MacOS version from 12 to 13
  • Loading branch information
abensonca authored Oct 17, 2024
2 parents 4df7c0e + 2e84527 commit fa4b71e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
22 changes: 16 additions & 6 deletions .github/actions/buildMacOS/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ runs:
- name: "Set environmental variables"
shell: bash
run: |
os_ver=$(sw_vers -productVersion)
IFS='.' read -r -a ver <<< "$os_ver"
echo "OS_VER=${ver[0]}" >> $GITHUB_ENV
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
echo "PATH=$PATH:/opt/local/bin:/usr/local/bin" >> $GITHUB_ENV
Expand All @@ -15,12 +18,14 @@ runs:
echo "CCOMPILER=gcc-11" >> $GITHUB_ENV
echo "CPPCOMPILER=g++-11" >> $GITHUB_ENV
echo "BUILDPATH=./work/build" >> $GITHUB_ENV
echo "GALACTICUS_FCFLAGS=$GALACTICUS_FCFLAGS -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib" >> $GITHUB_ENV
if [[ "${ver[0]}" -eq 13 ]]; then
# For MacOS 13 force use of the classic linker as the new linker does not support the '-commons' option - see https://trac.macports.org/ticket/68194#comment:15
echo "GALACTICUS_FCFLAGS=$GALACTICUS_FCFLAGS -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib -Wl,-ld_classic" >> $GITHUB_ENV
else
echo "GALACTICUS_FCFLAGS=$GALACTICUS_FCFLAGS -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib" >> $GITHUB_ENV
fi
echo "GALACTICUS_CFLAGS=-I/usr/local/include -I/opt/local/include -I/opt/local/include/guile-1.8" >> $GITHUB_ENV
echo "GALACTICUS_CPPFLAGS=-I/usr/local/include -I/opt/local/include -I/usr/local/include/libqhullcpp -I/opt/local/include/guile-1.8" >> $GITHUB_ENV
os_ver=$(sw_vers -productVersion)
IFS='.' read -r -a ver <<< "$os_ver"
echo "OS_VER=${ver[0]}" >> $GITHUB_ENV
- name: Fix broken Apple include file
shell: bash
run: |
Expand Down Expand Up @@ -103,8 +108,13 @@ runs:
run: |
curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz --output hdf5-1.8.20.tar.gz
tar -vxzf hdf5-1.8.20.tar.gz
cd hdf5-1.8.20
CC=gcc-11 CXX=g++-11 FC=gfortran-11 ./configure --prefix=/usr/local --enable-fortran --enable-production
cd hdf5-1.8.20
if [[ "${OS_VER}" -eq 13 ]]; then
# For MacOS 13 force use of the classic linker as the new linker does not support the '-commons' option - see https://trac.macports.org/ticket/68194#comment:15
CC=gcc-11 CXX=g++-11 FC=gfortran-11 LDFLAGS=-Wl,-ld_classic ./configure --prefix=/usr/local --enable-fortran --enable-production
else
CC=gcc-11 CXX=g++-11 FC=gfortran-11 ./configure --prefix=/usr/local --enable-fortran --enable-production
fi
make -j3
sudo make install
cd ..
Expand Down
29 changes: 11 additions & 18 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ jobs:
## MacOS
### Static executable
Build-Executable-MacOS:
runs-on: macos-12
runs-on: macos-13
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
Expand All @@ -419,7 +419,7 @@ jobs:
- name: Build Galacticus
run: |
set -o pipefail
make -j3 Galacticus.exe tests.hashes.cryptographic.exe 2>&1 | tee build.log
make -j`sysctl -n hw.activecpu` Galacticus.exe tests.hashes.cryptographic.exe 2>&1 | tee build.log
./scripts/build/staticRelinker.pl `grep '\-o Galacticus.exe' build.log`
./scripts/build/staticRelinker.pl `grep '\-o tests.hashes.cryptographic.exe' build.log`
dsymutil -o Galacticus.exe.dSYM Galacticus.exe
Expand Down Expand Up @@ -455,7 +455,7 @@ jobs:
- name: Build Galacticus
run: |
set -o pipefail
make -j3 Galacticus.exe 2>&1 | tee build.log
make -j`sysctl -n hw.activecpu` Galacticus.exe 2>&1 | tee build.log
./scripts/build/staticRelinker.pl `grep '\-o Galacticus.exe' build.log`
dsymutil -o Galacticus.exe.dSYM Galacticus.exe
zip -r debugSymbolsMacOS-M1.zip Galacticus.exe.dSYM
Expand All @@ -472,7 +472,7 @@ jobs:
path: 'debugSymbolsMacOS-M1.zip'
## Library
Build-Library-MacOS:
runs-on: macos-12
runs-on: macos-13
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
Expand All @@ -484,7 +484,7 @@ jobs:
uses: ./.github/actions/buildMacOS
- name: Build Galacticus
run: |
make -j3 GALACTICUS_BUILD_OPTION=lib libgalacticus.so
make -j`sysctl -n hw.activecpu` GALACTICUS_BUILD_OPTION=lib libgalacticus.so
- name: Package the code
run: |
cd $GALACTICUS_EXEC_PATH
Expand All @@ -504,7 +504,7 @@ jobs:
path: 'libgalacticusMacOS.zip'
### Tools
Build-Tools-MacOS:
runs-on: macos-12
runs-on: macos-13
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
Expand All @@ -521,7 +521,7 @@ jobs:
uses: ./.github/actions/buildMacOS
- name: Build Galacticus
run: |
make -j3 Galacticus.exe
make -j`sysctl -n hw.activecpu` Galacticus.exe
- name: Build tools
run: |
export GALACTICUS_EXEC_PATH=`pwd`
Expand Down Expand Up @@ -597,7 +597,7 @@ jobs:
uses: ./.github/actions/buildMacOS
- name: Build Galacticus
run: |
make -j3 Galacticus.exe 2>&1 | tee build.log
make -j`sysctl -n hw.activecpu` Galacticus.exe 2>&1 | tee build.log
./scripts/build/staticRelinker.pl `grep '\-o Galacticus.exe' build.log`
- name: Build tools
run: |
Expand Down Expand Up @@ -1343,13 +1343,13 @@ jobs:
executable: [ tests.hashes.cryptographic.exe ]
uses: ./.github/workflows/testCode.yml
with:
runner: macos-12
runner: macos-13
executable: ${{ matrix.executable }}
artifact: test-execs-MacOS
secrets: inherit
### Test Python Interface
Python-Interface-MacOS:
runs-on: macos-12
runs-on: macos-13
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
Expand All @@ -1369,14 +1369,7 @@ jobs:
sudo port select --set python3 python312
- name: Build Galacticus
run: |
export GALACTICUS_EXEC_PATH=`pwd`
export FCCOMPILER=gfortran-11
export CCOMPILER=gcc-11
export CPPCOMPILER=g++-11
export GALACTICUS_FCFLAGS="-fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib"
export GALACTICUS_CFLAGS="-I/usr/local/include -I/opt/local/include"
export GALACTICUS_CPPFLAGS="-I/usr/local/include -I/opt/local/include -I/usr/local/include/libqhullcpp"
make -j3 GALACTICUS_BUILD_OPTION=lib libgalacticus.so
make -j`sysctl -n hw.activecpu` GALACTICUS_BUILD_OPTION=lib libgalacticus.so
mkdir galacticus
mkdir galacticus/lib
mkdir galacticus/python
Expand Down

0 comments on commit fa4b71e

Please sign in to comment.