Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(macos): add distribution for apple silicon #29

Merged
merged 12 commits into from
Jun 20, 2024
Prev Previous commit
Next Next commit
otool after build
  • Loading branch information
wpbonelli committed Jun 19, 2024
commit 359f5279a51cfce97b32b88fb5288d0bc57254dd
4 changes: 4 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ jobs:
sudo chmod +x modflow6/bin/*
sudo chmod +x modflow6/bin/downloaded/*
fi

- name: Check linked libs (macOS)
if: matrix.os == 'macos-14'
run: find $ostag -perm +111 -type f | xargs -I{} sh -c "otool -L {}"

- name: Upload programs
uses: actions/upload-artifact@v3
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
compiler: ${{ contains(fromJSON('["macos-14"]'), matrix.os) && 'gcc' || 'intel-classic' }}
version: ${{ contains(fromJSON('["macos-14"]'), matrix.os) && 12 || 2021.7 }}

- name: Set LDFLAGS (macOS)
- name: Set LDFLAGS (ARM mac)
if: matrix.os == 'macos-14'
run: |
os_ver=$(sw_vers -productVersion | cut -d'.' -f1)
Expand All @@ -40,15 +40,16 @@ jobs:
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
fi

- name: Hide dylibs (macOS)
- name: Hide dylibs (ARM mac)
if: matrix.os == 'macos-14'
run: |
version="12"
libpath="/opt/homebrew/opt/gcc@$version/lib/gcc/$version"
mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak
mv $libpath/libquadmath.0.dylib $libpath/libquadmath.0.dylib.bak

- uses: maxim-lobanov/setup-xcode@v1
- name: Setup Xcode CLT (mac)
uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: "14.3.1"
Expand All @@ -75,13 +76,28 @@ jobs:
pip install -r requirements.txt
pip list

- name: Get OS tag
id: ostag
run: |
ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
echo "ostag=$ostag" >> $GITHUB_OUTPUT

- name: Build programs
run: python scripts/build_programs.py
run: |
ostag="${{ steps.ostag.outputs.ostag }}"
mkdir $ostag
python scripts/build_programs.py -p $ostag

- name: Build MF6 with optimization=1
- name: Build MF6 with -O1 (ARM mac)
if: matrix.os == 'macos-14'
run: make-program mf6 --zip macarm.zip --fflags='-O1'

- name: Check linked libs (ARM mac)
if: matrix.os == 'macos-14'
run: |
ostag="${{ steps.ostag.outputs.ostag }}"
find $ostag -perm +111 -type f | xargs -I{} sh -c "otool -L {}"

- name: Upload distribution archive
uses: actions/upload-artifact@v3
with:
Expand Down
Loading