From 44521660131a3dc8e698d3b7639a2a4593ed58e8 Mon Sep 17 00:00:00 2001 From: hg Date: Tue, 25 Jun 2024 12:36:01 +0200 Subject: [PATCH 01/18] Add platform macosx-arm64 to cpython --- .github/workflows/cpython.yml | 4 ++++ pom.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/workflows/cpython.yml b/.github/workflows/cpython.yml index a64ea8a021..d2a8d75663 100644 --- a/.github/workflows/cpython.yml +++ b/.github/workflows/cpython.yml @@ -45,6 +45,10 @@ jobs: runs-on: macos-12 steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions + macosx-arm64: + runs-on: macos-14 + steps: + - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions # windows-x86: # runs-on: windows-2019 # steps: diff --git a/pom.xml b/pom.xml index b4275c0d37..e9c8dec5cb 100644 --- a/pom.xml +++ b/pom.xml @@ -1471,6 +1471,7 @@ tesseract pytorch sentencepiece + cpython From 4e0b2dab44a3b1eac2f8b57f8e8181576abc8142 Mon Sep 17 00:00:00 2001 From: hg Date: Tue, 25 Jun 2024 13:04:40 +0200 Subject: [PATCH 02/18] Fix brew path in install_name_tool --- .github/workflows/cpython.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpython.yml b/.github/workflows/cpython.yml index d2a8d75663..5bb5c0eeb5 100644 --- a/.github/workflows/cpython.yml +++ b/.github/workflows/cpython.yml @@ -48,7 +48,7 @@ jobs: macosx-arm64: runs-on: macos-14 steps: - - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions + - uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@cpython-macosx-arm64 # windows-x86: # runs-on: windows-2019 # steps: From 77f34d77278a9fdb15394e2a0b3c4bc6256b1976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Thu, 27 Jun 2024 14:19:07 +0200 Subject: [PATCH 03/18] Add platform macosx-arm64 to numpy --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index e9c8dec5cb..b4275c0d37 100644 --- a/pom.xml +++ b/pom.xml @@ -1471,7 +1471,6 @@ tesseract pytorch sentencepiece - cpython From 0910424b25fe4ef2d07c22945d680f0318aab575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Thu, 27 Jun 2024 14:43:58 +0200 Subject: [PATCH 04/18] Add platform macosx-arm64 to scipy --- .github/workflows/cpython.yml | 4 ---- .github/workflows/scipy.yml | 4 ++++ pom.xml | 1 + scipy/platform/pom.xml | 9 ++++++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cpython.yml b/.github/workflows/cpython.yml index 5bb5c0eeb5..a64ea8a021 100644 --- a/.github/workflows/cpython.yml +++ b/.github/workflows/cpython.yml @@ -45,10 +45,6 @@ jobs: runs-on: macos-12 steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions - macosx-arm64: - runs-on: macos-14 - steps: - - uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@cpython-macosx-arm64 # windows-x86: # runs-on: windows-2019 # steps: diff --git a/.github/workflows/scipy.yml b/.github/workflows/scipy.yml index 7b647faf29..aef9a7de39 100644 --- a/.github/workflows/scipy.yml +++ b/.github/workflows/scipy.yml @@ -38,6 +38,10 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions + macosx-arm64: + runs-on: macos-14 + steps: + - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions macosx-x86_64: runs-on: macos-12 steps: diff --git a/pom.xml b/pom.xml index b4275c0d37..1a30b3b26b 100644 --- a/pom.xml +++ b/pom.xml @@ -1463,6 +1463,7 @@ openblas cpython numpy + scipy llvm libffi libpostal diff --git a/scipy/platform/pom.xml b/scipy/platform/pom.xml index 68a5cd2cce..1ec945be98 100644 --- a/scipy/platform/pom.xml +++ b/scipy/platform/pom.xml @@ -60,6 +60,12 @@ ${project.version} ${javacpp.platform.linux-x86_64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.macosx-arm64} + ${project.groupId} ${javacpp.moduleId} @@ -90,7 +96,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -140,6 +146,7 @@ // requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; // requires static org.bytedeco.${javacpp.moduleId}.linux.x86; requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; + requires static org.bytedeco.${javacpp.moduleId}.macosx.arm64; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; // requires static org.bytedeco.${javacpp.moduleId}.windows.x86; requires static org.bytedeco.${javacpp.moduleId}.windows.x86_64; From 27731f26b0bbff7263f0ea5fabb76a208047f9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Sun, 30 Jun 2024 16:03:57 +0200 Subject: [PATCH 05/18] Use clang on macos and msvc on windows --- .github/workflows/scipy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/scipy.yml b/.github/workflows/scipy.yml index aef9a7de39..0dae4cc8cd 100644 --- a/.github/workflows/scipy.yml +++ b/.github/workflows/scipy.yml @@ -10,7 +10,6 @@ on: - .github/workflows/scipy.yml workflow_dispatch: env: - CI_DEPLOY_NEED_GCC: 1 CI_DEPLOY_MODULE: ${{ github.workflow }} CI_DEPLOY_PLATFORM: ${{ github.job }} CI_DEPLOY_SETTINGS: ${{ secrets.CI_DEPLOY_SETTINGS }} From 2d38a2e04fa49bb44e0c5aaeccbc437c991c3a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Sun, 30 Jun 2024 17:08:17 +0200 Subject: [PATCH 06/18] Use gcc. Add gcc@10 on macos-14 runner --- .github/actions/deploy-macosx/action.yml | 2 +- .github/workflows/scipy.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index 690321c6aa..44a6aacecf 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -25,7 +25,7 @@ runs: fi brew uninstall --force --ignore-dependencies gcc gcc@7 gcc@8 gcc@9 gcc@10 gcc@11 gcc@12 gcc@13 little-cms2 maven openblas r - brew install boost ccache swig autoconf-archive automake cmake libomp libtool libusb ant nasm xz pkg-config sdl2 gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr geoip pcre ssdeep yajl + brew install boost ccache swig autoconf-archive automake cmake gcc@10 libomp libtool libusb ant nasm xz pkg-config sdl2 gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr geoip pcre ssdeep yajl brew link --force libomp # echo Installing an older less buggy version of CMake diff --git a/.github/workflows/scipy.yml b/.github/workflows/scipy.yml index 0dae4cc8cd..a26fa479ed 100644 --- a/.github/workflows/scipy.yml +++ b/.github/workflows/scipy.yml @@ -10,6 +10,7 @@ on: - .github/workflows/scipy.yml workflow_dispatch: env: + CI_DEPLOY_NEED_GCC: 1 CI_DEPLOY_MODULE: ${{ github.workflow }} CI_DEPLOY_PLATFORM: ${{ github.job }} CI_DEPLOY_SETTINGS: ${{ secrets.CI_DEPLOY_SETTINGS }} @@ -40,11 +41,11 @@ jobs: macosx-arm64: runs-on: macos-14 steps: - - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions + - uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@scipy-macosx-arm64 macosx-x86_64: runs-on: macos-12 steps: - - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions + - uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@scipy-macosx-arm64 # windows-x86: # runs-on: windows-2019 # steps: From dbcda4c46b35754df01ea360d44046b98be10485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Sun, 30 Jun 2024 17:49:31 +0200 Subject: [PATCH 07/18] Use gcc 13 on macosx arm64 --- .github/actions/deploy-macosx/action.yml | 42 +++++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index 44a6aacecf..abb6538147 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -25,7 +25,7 @@ runs: fi brew uninstall --force --ignore-dependencies gcc gcc@7 gcc@8 gcc@9 gcc@10 gcc@11 gcc@12 gcc@13 little-cms2 maven openblas r - brew install boost ccache swig autoconf-archive automake cmake gcc@10 libomp libtool libusb ant nasm xz pkg-config sdl2 gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr geoip pcre ssdeep yajl + brew install boost ccache swig autoconf-archive automake cmake libomp libtool libusb ant nasm xz pkg-config sdl2 gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr geoip pcre ssdeep yajl brew link --force libomp # echo Installing an older less buggy version of CMake @@ -34,25 +34,27 @@ runs: # brew install cmake.rb if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then - echo Installing an older less buggy version of GCC - brew install gcc@10 - brew link --overwrite gcc@10 - - echo Removing "fixed" header files that are actually broken - sudo rm -Rf $(find /usr/local/Cellar/gcc@10/ -iname include-fixed) - - echo Fixing up some binaries to support rpath - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgomp.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libstdc++.6.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgfortran.5.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgcc_s.1.dylib - sudo install_name_tool -change $(otool -L /usr/local/lib/gcc/10/libgfortran.5.dylib | grep /usr/local/Cellar/gcc@10/ | cut -f1 -d ' ') @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib - otool -L /usr/local/lib/gcc/10/*.dylib + if [ $(arch) = "arm64" ]; then + brew install gcc@13 + brew link --overwrite gcc@13 + else + brew install gcc@10 + brew link --overwrite gcc@10 + echo Removing "fixed" header files that are actually broken + sudo rm -Rf $(find /usr/local/Cellar/gcc@10/ -iname include-fixed) + echo Fixing up some binaries to support rpath + sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgomp.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib + sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libstdc++.6.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib + sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgfortran.5.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib + sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib + sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgcc_s.1.dylib + sudo install_name_tool -change $(otool -L /usr/local/lib/gcc/10/libgfortran.5.dylib | grep /usr/local/Cellar/gcc@10/ | cut -f1 -d ' ') @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib + sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib + sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib + sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib + sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib + otool -L /usr/local/lib/gcc/10/*.dylib + fi fi sudo install_name_tool -add_rpath @loader_path/. -id @rpath/libomp.dylib `brew ls libomp|grep libomp.dylib` From 646fd1d6114f9b8133f308144c42d717bfc7a1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Sun, 30 Jun 2024 22:10:38 +0200 Subject: [PATCH 08/18] Fix path of gcc on macosx-arm64 --- scipy/cppbuild.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scipy/cppbuild.sh b/scipy/cppbuild.sh index 8757b6ef0e..ecaf1f7f0e 100755 --- a/scipy/cppbuild.sh +++ b/scipy/cppbuild.sh @@ -169,7 +169,18 @@ case $PLATFORM in ATLAS=None CC="gcc -m64 -D__STDC_NO_THREADS__" FFLAGS="-m64 -fPIC" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH --config-settings=builddir=build strip $(find ../ -iname *.so) ;; - macosx-*) + macosx-arm64) + export F77="$(brew ls gfortran | grep bin/gfortran | head -n 1)" + export F90="$F77" + export LDFLAGS="-L/usr/lib/" + ATLAS=None FC="$F77" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH --config-settings=builddir=build + # need to add RPATH so it can find MKL in cache + for f in $(find ../ -iname *.so); do + install_name_tool -add_rpath @loader_path/../../../ -add_rpath @loader_path/../../../../ $f || true; + codesign --force -s - $f + done + ;; + macosx-x86_64) export F77="$(ls -1 /usr/local/bin/gfortran-* | head -n 1)" export F90="$F77" export LDFLAGS="-L/usr/lib/" From 4852ae8eef80cfe306c116a0a7f22a400bccba53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Sun, 30 Jun 2024 22:58:36 +0200 Subject: [PATCH 09/18] Fix gfortran detection --- scipy/cppbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scipy/cppbuild.sh b/scipy/cppbuild.sh index ecaf1f7f0e..4e9fad63b6 100755 --- a/scipy/cppbuild.sh +++ b/scipy/cppbuild.sh @@ -170,7 +170,7 @@ case $PLATFORM in strip $(find ../ -iname *.so) ;; macosx-arm64) - export F77="$(brew ls gfortran | grep bin/gfortran | head -n 1)" + export F77="$(brew ls gcc | grep bin/gfortran | head -n 1)" export F90="$F77" export LDFLAGS="-L/usr/lib/" ATLAS=None FC="$F77" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH --config-settings=builddir=build From 479528873a5cef386379d31333c36d03fdfd1f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Sun, 30 Jun 2024 23:17:01 +0200 Subject: [PATCH 10/18] Fix gfortran detection --- scipy/cppbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scipy/cppbuild.sh b/scipy/cppbuild.sh index 4e9fad63b6..c9b62868e0 100755 --- a/scipy/cppbuild.sh +++ b/scipy/cppbuild.sh @@ -170,7 +170,7 @@ case $PLATFORM in strip $(find ../ -iname *.so) ;; macosx-arm64) - export F77="$(brew ls gcc | grep bin/gfortran | head -n 1)" + export F77="$(brew ls gcc@13 | grep bin/gfortran | head -n 1)" export F90="$F77" export LDFLAGS="-L/usr/lib/" ATLAS=None FC="$F77" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH --config-settings=builddir=build From e104ee5e5959f15c056eea8d344ec887a15b65d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Mon, 1 Jul 2024 09:06:44 +0200 Subject: [PATCH 11/18] Patch rpath for gcc@13 --- .github/actions/deploy-macosx/action.yml | 34 +++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index abb6538147..7ded7c9c55 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -33,33 +33,41 @@ runs: # brew unlink cmake # brew install cmake.rb + FORMULAE=() if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then if [ $(arch) = "arm64" ]; then brew install gcc@13 brew link --overwrite gcc@13 + echo Removing "fixed" header files that are actually broken + rm -Rf $(find /opt/homebrew/Cellar/gcc@13/ -iname include-fixed) + FORMULAE+="gcc@13" else brew install gcc@10 brew link --overwrite gcc@10 echo Removing "fixed" header files that are actually broken sudo rm -Rf $(find /usr/local/Cellar/gcc@10/ -iname include-fixed) + FORMULAE+="gcc@10" + echo Fixing up some binaries to support rpath - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgomp.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libstdc++.6.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgfortran.5.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib - sudo install_name_tool -add_rpath /usr/local/lib/gcc/10/ -add_rpath @loader_path/. -id @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgcc_s.1.dylib - sudo install_name_tool -change $(otool -L /usr/local/lib/gcc/10/libgfortran.5.dylib | grep /usr/local/Cellar/gcc@10/ | cut -f1 -d ' ') @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - sudo install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib + install_name_tool -change $(otool -L /usr/local/lib/gcc/10/libgfortran.5.dylib | grep /usr/local/Cellar/gcc@10/ | cut -f1 -d ' ') @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib + install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib + install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib + install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib + install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib otool -L /usr/local/lib/gcc/10/*.dylib fi fi - sudo install_name_tool -add_rpath @loader_path/. -id @rpath/libomp.dylib `brew ls libomp|grep libomp.dylib` - sudo install_name_tool -add_rpath @loader_path/. -id @rpath/libSDL2-2.0.0.dylib `brew ls sdl2|grep libSDL2-2.0.0.dylib` - sudo install_name_tool -add_rpath @loader_path/. -id @rpath/libusb-1.0.0.dylib `brew ls libusb|grep libusb-1.0.0.dylib` + # Change rpath and resign all brew libraries that could be bundled in presets + FORMULAE+=("libomp" "sdl2" "libusb") + for i in $FORMULAE; do + for l in $(brew ls $i|grep .dylib); do + if [ ! -L $l ]; then + install_name_tool -add_rpath @loader_path/. -id @rpath/$(basename $l) $l + codesign --force -s - $l + fi + done + done curl -LO https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz sudo tar -xzf apache-maven-3.6.3-bin.tar.gz -C /usr/local/opt From 752a74062c86c8f9b69ba38625f6f150f0d37662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Mon, 1 Jul 2024 09:13:55 +0200 Subject: [PATCH 12/18] Fix dylib filtering --- .github/actions/deploy-macosx/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index 7ded7c9c55..bb13cd36ea 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -61,7 +61,7 @@ runs: # Change rpath and resign all brew libraries that could be bundled in presets FORMULAE+=("libomp" "sdl2" "libusb") for i in $FORMULAE; do - for l in $(brew ls $i|grep .dylib); do + for l in $(brew ls $i|grep -e ".dylib$"); do if [ ! -L $l ]; then install_name_tool -add_rpath @loader_path/. -id @rpath/$(basename $l) $l codesign --force -s - $l From dd03079fff811490e2888f3e7e4153585d1edd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Mon, 1 Jul 2024 09:33:54 +0200 Subject: [PATCH 13/18] Version-agnostic detection of gfortran --- scipy/cppbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scipy/cppbuild.sh b/scipy/cppbuild.sh index c9b62868e0..2ad9c89483 100755 --- a/scipy/cppbuild.sh +++ b/scipy/cppbuild.sh @@ -170,7 +170,7 @@ case $PLATFORM in strip $(find ../ -iname *.so) ;; macosx-arm64) - export F77="$(brew ls gcc@13 | grep bin/gfortran | head -n 1)" + export F77=$(which -m "gfortran*") export F90="$F77" export LDFLAGS="-L/usr/lib/" ATLAS=None FC="$F77" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH --config-settings=builddir=build From cf8e6867ab60b8c6a51d31015080d455721f251b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Mon, 1 Jul 2024 10:35:31 +0200 Subject: [PATCH 14/18] Fix version-agnostic detection of gfortran --- scipy/cppbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scipy/cppbuild.sh b/scipy/cppbuild.sh index 2ad9c89483..cb971781ff 100755 --- a/scipy/cppbuild.sh +++ b/scipy/cppbuild.sh @@ -170,7 +170,7 @@ case $PLATFORM in strip $(find ../ -iname *.so) ;; macosx-arm64) - export F77=$(which -m "gfortran*") + export F77=$(whence -m "gfortran*") export F90="$F77" export LDFLAGS="-L/usr/lib/" ATLAS=None FC="$F77" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH --config-settings=builddir=build From a669b8a66b1539d92fa37d3427c066ca1473eaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Mon, 1 Jul 2024 11:08:32 +0200 Subject: [PATCH 15/18] Use gcc@13 on both macosx arch --- .github/actions/deploy-macosx/action.yml | 29 +++++++----------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index bb13cd36ea..39611fc4e4 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -24,7 +24,7 @@ runs: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/MacOSX10* fi - brew uninstall --force --ignore-dependencies gcc gcc@7 gcc@8 gcc@9 gcc@10 gcc@11 gcc@12 gcc@13 little-cms2 maven openblas r + brew uninstall --force --ignore-dependencies gcc gcc@7 gcc@8 gcc@9 gcc@10 gcc@11 gcc@12 gcc@13 gcc@14 little-cms2 maven openblas r brew install boost ccache swig autoconf-archive automake cmake libomp libtool libusb ant nasm xz pkg-config sdl2 gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr geoip pcre ssdeep yajl brew link --force libomp @@ -35,27 +35,11 @@ runs: FORMULAE=() if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then - if [ $(arch) = "arm64" ]; then brew install gcc@13 brew link --overwrite gcc@13 echo Removing "fixed" header files that are actually broken rm -Rf $(find /opt/homebrew/Cellar/gcc@13/ -iname include-fixed) FORMULAE+="gcc@13" - else - brew install gcc@10 - brew link --overwrite gcc@10 - echo Removing "fixed" header files that are actually broken - sudo rm -Rf $(find /usr/local/Cellar/gcc@10/ -iname include-fixed) - FORMULAE+="gcc@10" - - echo Fixing up some binaries to support rpath - install_name_tool -change $(otool -L /usr/local/lib/gcc/10/libgfortran.5.dylib | grep /usr/local/Cellar/gcc@10/ | cut -f1 -d ' ') @rpath/libquadmath.0.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgomp.1.dylib - install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libstdc++.6.dylib - install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgfortran.5.dylib - install_name_tool -change /usr/local/lib/gcc/10/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/10/libquadmath.0.dylib - otool -L /usr/local/lib/gcc/10/*.dylib - fi fi # Change rpath and resign all brew libraries that could be bundled in presets @@ -68,6 +52,7 @@ runs: fi done done + otool -L $(brew ls gcc@13|grep -e ".dylib$"); curl -LO https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz sudo tar -xzf apache-maven-3.6.3-bin.tar.gz -C /usr/local/opt @@ -113,10 +98,12 @@ runs: - name: Build project shell: bash run: | - export LIBRARY_PATH="/usr/local/lib/gcc/10/" - export LD_LIBRARY_PATH="$LIBRARY_PATH" - export DYLD_LIBRARY_PATH="$LIBRARY_PATH" - export DYLD_FALLBACK_LIBRARY_PATH="$LIBRARY_PATH" + if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then + export LIBRARY_PATH="$(brew --prefix)/lib/gcc/13/" + export LD_LIBRARY_PATH="$LIBRARY_PATH" + export DYLD_LIBRARY_PATH="$LIBRARY_PATH" + export DYLD_FALLBACK_LIBRARY_PATH="$LIBRARY_PATH" + fi # Change default JVM on macos-14 runner if [[ -n ${JAVA_HOME_17_arm64:-} ]]; then From 4db72e6a00c3fd99f5735f947f5db90f2b7a745e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Mon, 1 Jul 2024 11:21:29 +0200 Subject: [PATCH 16/18] Fix gfortran detection --- scipy/cppbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scipy/cppbuild.sh b/scipy/cppbuild.sh index cb971781ff..fc559df6b5 100755 --- a/scipy/cppbuild.sh +++ b/scipy/cppbuild.sh @@ -170,7 +170,7 @@ case $PLATFORM in strip $(find ../ -iname *.so) ;; macosx-arm64) - export F77=$(whence -m "gfortran*") + export F77=$(compgen -cX '!gfortran*') export F90="$F77" export LDFLAGS="-L/usr/lib/" ATLAS=None FC="$F77" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH --config-settings=builddir=build From 24f305cf9f920b818b08d3eb2ba3282128270daf Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Fri, 5 Jul 2024 09:31:31 +0900 Subject: [PATCH 17/18] Update CHANGELOG.md and fix nits --- .github/actions/deploy-macosx/action.yml | 5 +++-- .github/workflows/scipy.yml | 6 +++--- CHANGELOG.md | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index 39611fc4e4..83b30eec0d 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -35,10 +35,11 @@ runs: FORMULAE=() if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then + echo Installing an older less buggy version of GCC brew install gcc@13 brew link --overwrite gcc@13 echo Removing "fixed" header files that are actually broken - rm -Rf $(find /opt/homebrew/Cellar/gcc@13/ -iname include-fixed) + rm -Rf $(find /opt/homebrew/Cellar/gcc@13/ -iname include-fixed) FORMULAE+="gcc@13" fi @@ -46,7 +47,7 @@ runs: FORMULAE+=("libomp" "sdl2" "libusb") for i in $FORMULAE; do for l in $(brew ls $i|grep -e ".dylib$"); do - if [ ! -L $l ]; then + if [ ! -L $l ]; then install_name_tool -add_rpath @loader_path/. -id @rpath/$(basename $l) $l codesign --force -s - $l fi diff --git a/.github/workflows/scipy.yml b/.github/workflows/scipy.yml index a26fa479ed..767256d06f 100644 --- a/.github/workflows/scipy.yml +++ b/.github/workflows/scipy.yml @@ -41,11 +41,11 @@ jobs: macosx-arm64: runs-on: macos-14 steps: - - uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@scipy-macosx-arm64 + - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions macosx-x86_64: runs-on: macos-12 steps: - - uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@scipy-macosx-arm64 + - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions # windows-x86: # runs-on: windows-2019 # steps: @@ -55,7 +55,7 @@ jobs: steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions redeploy: - needs: [linux-x86_64, macosx-x86_64, windows-x86_64] + needs: [linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64] # needs: [linux-armhf, linux-arm64, linux-ppc64le, linux-x86, linux-x86_64, macosx-x86_64, windows-x86, windows-x86_64] runs-on: ubuntu-20.04 steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 63639a30f5..e9d4eeba6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ - * Introduce `macosx-arm64` builds for CPython ([pull #1511](https://github.com/bytedeco/javacpp-presets/pull/1511)), NumPy ([pull #1515](https://github.com/bytedeco/javacpp-presets/pull/1515)) + * Introduce `macosx-arm64` builds for CPython ([pull #1511](https://github.com/bytedeco/javacpp-presets/pull/1511)), NumPy ([pull #1515](https://github.com/bytedeco/javacpp-presets/pull/1515)), SciPy ([pull #1516](https://github.com/bytedeco/javacpp-presets/pull/1516)) * Update and fix the sample code of the presets for LLVM ([pull #1501](https://github.com/bytedeco/javacpp-presets/pull/1501)) * Fix Vulkan GPU acceleration for FFmpeg ([pull #1497](https://github.com/bytedeco/javacpp-presets/pull/1497)) * Build FFmpeg with zimg to enable zscale filter ([pull #1481](https://github.com/bytedeco/javacpp-presets/pull/1481)) From f358e84864ba875470385e72de2949dda4999c45 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Fri, 5 Jul 2024 10:20:36 +0900 Subject: [PATCH 18/18] Fix nits --- .github/actions/deploy-macosx/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index 83b30eec0d..57252db529 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -35,12 +35,12 @@ runs: FORMULAE=() if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then - echo Installing an older less buggy version of GCC - brew install gcc@13 - brew link --overwrite gcc@13 - echo Removing "fixed" header files that are actually broken - rm -Rf $(find /opt/homebrew/Cellar/gcc@13/ -iname include-fixed) - FORMULAE+="gcc@13" + echo Installing an older less buggy version of GCC + brew install gcc@13 + brew link --overwrite gcc@13 + echo Removing "fixed" header files that are actually broken + rm -Rf $(find /opt/homebrew/Cellar/gcc@13/ -iname include-fixed) + FORMULAE+="gcc@13" fi # Change rpath and resign all brew libraries that could be bundled in presets