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

macOS big_sur -> monterey #995

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions scripts/build_osx_universal_gmpfr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ set -e
# Assumes that the user has enough rights to run brew fetch

# Downloading
SED_PGM='s/^Downloaded to: |^Already downloaded: //p'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because we are doing in gudhi-devel/.github/workflows/pip-build-osx.yml:

          brew install boost eigen gmp mpfr cgal || true
     ...
          ./scripts/build_osx_universal_gmpfr.sh

I am ok with the regular expression

mkdir deps-amd64
cd deps-amd64
tar xf "`brew fetch --bottle-tag=big_sur gmp | sed -ne 's/^Downloaded to: //p'`"
tar xf "`brew fetch --bottle-tag=big_sur mpfr | sed -ne 's/^Downloaded to: //p'`"
tar xf "`brew fetch --bottle-tag=x86_64_monterey gmp | grep -F bottle.tar.gz | sed -Ene "$SED_PGM"`"
tar xf "`brew fetch --bottle-tag=x86_64_monterey mpfr | grep -F bottle.tar.gz | sed -Ene "$SED_PGM"`"
cd ..
mkdir deps-arm64
cd deps-arm64
tar xf "`brew fetch --bottle-tag=arm64_big_sur gmp | sed -ne 's/^Downloaded to: //p'`"
tar xf "`brew fetch --bottle-tag=arm64_big_sur mpfr | sed -ne 's/^Downloaded to: //p'`"
tar xf "`brew fetch --bottle-tag=arm64_monterey gmp | grep -F bottle.tar.gz | sed -Ene "$SED_PGM"`"
tar xf "`brew fetch --bottle-tag=arm64_monterey mpfr | grep -F bottle.tar.gz | sed -Ene "$SED_PGM"`"
cd ..

# Merging
Expand All @@ -33,9 +34,10 @@ install_name_tool -id $PWD/deps-uni/lib/$GMP deps-uni/lib/$GMP
install_name_tool -id $PWD/deps-uni/lib/$GMPXX deps-uni/lib/$GMPXX
install_name_tool -id $PWD/deps-uni/lib/$MPFR deps-uni/lib/$MPFR
# Also fix dependencies
BADGMP=`otool -L deps-uni/lib/$MPFR|sed -ne 's/[[:space:]]*\(.*libgmp\..*dylib\).*/\1/p'`
# otool gives twice the same dependency, keep only one (a loop would be safer...)
BADGMP=`otool -L deps-uni/lib/$MPFR|sed -ne 's/[[:space:]]*\(.*libgmp\..*dylib\).*/\1/p'|uniq`
install_name_tool -change $BADGMP $PWD/deps-uni/lib/$GMP deps-uni/lib/$MPFR
BADGMP=`otool -L deps-uni/lib/$GMPXX|sed -ne 's/[[:space:]]*\(.*libgmp\..*dylib\).*/\1/p'`
BADGMP=`otool -L deps-uni/lib/$GMPXX|sed -ne 's/[[:space:]]*\(.*libgmp\..*dylib\).*/\1/p'|uniq`
install_name_tool -change $BADGMP $PWD/deps-uni/lib/$GMP deps-uni/lib/$GMPXX

ln -s $GMP deps-uni/lib/libgmp.dylib
Expand Down