From c3f2673ceeac059f3b8d42e22c5103c4daa78f6d Mon Sep 17 00:00:00 2001 From: mattip Date: Sat, 25 Oct 2025 20:58:28 +0300 Subject: [PATCH 01/11] update OpenBLAS commit, use macos-15.intel --- .github/workflows/posix.yml | 6 +- .github/workflows/windows-arm.yml | 2 +- .github/workflows/windows.yml | 2 +- .travis.yml | 2 +- pyproject.toml | 2 +- tools/gfortran_utils.sh | 183 ------------------------------ 6 files changed, 7 insertions(+), 190 deletions(-) delete mode 100644 tools/gfortran_utils.sh diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index a6a1cf1..60f98af 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -10,7 +10,7 @@ on: - cron: '0 0 * * 0' env: - OPENBLAS_COMMIT: "v0.3.30" + OPENBLAS_COMMIT: "585e6d06802a0" MACOSX_DEPLOYMENT_TARGET: 10.9 jobs: @@ -28,8 +28,8 @@ jobs: - { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} - { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} - - { os: macos-latest, PLAT: x86_64, INTERFACE64: '0', MB_ML_LIBC: macosx} - - { os: macos-latest, PLAT: x86_64, INTERFACE64: '1', MB_ML_LIBC: macosx} + - { os: macos-intel-15, PLAT: x86_64, INTERFACE64: '0', MB_ML_LIBC: macosx} + - { os: macos-intel-15, PLAT: x86_64, INTERFACE64: '1', MB_ML_LIBC: macosx} - { os: macos-latest, PLAT: arm64, INTERFACE64: '0', MB_ML_LIBC: macosx} - { os: macos-latest, PLAT: arm64, INTERFACE64: '1', MB_ML_LIBC: macosx} diff --git a/.github/workflows/windows-arm.yml b/.github/workflows/windows-arm.yml index e0e5181..24d5b46 100644 --- a/.github/workflows/windows-arm.yml +++ b/.github/workflows/windows-arm.yml @@ -7,7 +7,7 @@ on: branches: [ main ] env: - OPENBLAS_COMMIT: "v0.3.30" + OPENBLAS_COMMIT: "585e6d06802a0" OPENBLAS_ROOT: "c:\\opt" # Preserve working directory for calls into bash # Without this, invoking bash will cd to the home directory diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 69f70ae..6f51c7c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: null env: - OPENBLAS_COMMIT: "v0.3.30" + OPENBLAS_COMMIT: "585e6d06802a0" OPENBLAS_ROOT: "c:\\opt" # Preserve working directory for calls into bash # Without this, invoking bash will cd to the home directory diff --git a/.travis.yml b/.travis.yml index 327d9eb..7a26f1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ env: global: # The archive that gets built has name from ``git describe`` on this # commit. - - OPENBLAS_COMMIT: "v0.3.30" + - OPENBLAS_COMMIT: "585e6d06802a0" dist: jammy services: docker diff --git a/pyproject.toml b/pyproject.toml index a2a3b4d..99375dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "scipy-openblas64" # v0.3.30 -version = "0.3.30.0.5" +version = "v0.3.30-317.0" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md" diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh deleted file mode 100644 index b7127f5..0000000 --- a/tools/gfortran_utils.sh +++ /dev/null @@ -1,183 +0,0 @@ -# this file come from https://github.com/MacPython/gfortran-install -# Follow the license below - - -# gfortran-install license -# Copyright 2016-2021 Matthew Brett, Isuru Fernando, Matti Picus - -# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -# Bash utilities for use with gfortran - -ARCHIVE_SDIR="${ARCHIVE_SDIR:-archives}" - -GF_UTIL_DIR=$(dirname "${BASH_SOURCE[0]}") - -function get_distutils_platform { - # Report platform as in form of distutils get_platform. - # This is like the platform tag that pip will use. - # Modify fat architecture tags on macOS to reflect compiled architecture - - # Deprecate this function once get_distutils_platform_ex is used in all - # downstream projects - local plat=$1 - case $plat in - i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le) ;; - *) echo Did not recognize plat $plat; return 1 ;; - esac - local uname=${2:-$(uname)} - if [ "$uname" != "Darwin" ]; then - if [ "$plat" == "intel" ]; then - echo plat=intel not allowed for Manylinux - return 1 - fi - echo "manylinux1_$plat" - return - fi - # macOS 32-bit arch is i386 - [ "$plat" == "i686" ] && plat="i386" - local target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _) - echo "macosx_${target}_${plat}" -} - -function get_distutils_platform_ex { - # Report platform as in form of distutils get_platform. - # This is like the platform tag that pip will use. - # Modify fat architecture tags on macOS to reflect compiled architecture - # For non-darwin, report manylinux version - local plat=$1 - local mb_ml_ver=${MB_ML_VER:-1} - case $plat in - i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le) ;; - *) echo Did not recognize plat $plat; return 1 ;; - esac - local uname=${2:-$(uname)} - if [ "$uname" != "Darwin" ]; then - if [ "$plat" == "intel" ]; then - echo plat=intel not allowed for Manylinux - return 1 - fi - echo "manylinux${mb_ml_ver}_${plat}" - return - fi - # macOS 32-bit arch is i386 - [ "$plat" == "i686" ] && plat="i386" - local target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _) - echo "macosx_${target}_${plat}" -} - -function get_macosx_target { - # Report MACOSX_DEPLOYMENT_TARGET as given by distutils get_platform. - python3 -c "import sysconfig as s; print(s.get_config_vars()['MACOSX_DEPLOYMENT_TARGET'])" -} - -function check_gfortran { - # Check that gfortran exists on the path - if [ -z "$(which gfortran)" ]; then - echo Missing gfortran - exit 1 - fi -} - -function get_gf_lib_for_suf { - local suffix=$1 - local prefix=$2 - local plat=${3:-$PLAT} - local uname=${4:-$(uname)} - if [ -z "$prefix" ]; then echo Prefix not defined; exit 1; fi - local plat_tag=$(get_distutils_platform_ex $plat $uname) - if [ -n "$suffix" ]; then suffix="-$suffix"; fi - local fname="$prefix-${plat_tag}${suffix}.tar.gz" - local out_fname="${ARCHIVE_SDIR}/$fname" - [ -s $out_fname ] || (echo "$out_fname is empty"; exit 24) - echo "$out_fname" -} - -if [ "$(uname)" == "Darwin" ]; then - mac_target=${MACOSX_DEPLOYMENT_TARGET:-$(get_macosx_target)} - export MACOSX_DEPLOYMENT_TARGET=$mac_target - # Keep this for now as some builds might depend on this being - # available before install_gfortran is called - export GFORTRAN_SHA=c469a420d2d003112749dcdcbe3c684eef42127e - # Set SDKROOT env variable if not set - export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} - - function download_and_unpack_gfortran { - local arch=$1 - local type=$2 - curl -L -O https://github.com/isuruf/gcc/releases/download/gcc-11.3.0-2/gfortran-darwin-${arch}-${type}.tar.gz - case ${arch}-${type} in - arm64-native) - export GFORTRAN_SHA=0d5c118e5966d0fb9e7ddb49321f63cac1397ce8 - ;; - arm64-cross) - export GFORTRAN_SHA=527232845abc5af21f21ceacc46fb19c190fe804 - ;; - x86_64-native) - export GFORTRAN_SHA=c469a420d2d003112749dcdcbe3c684eef42127e - ;; - x86_64-cross) - export GFORTRAN_SHA=107604e57db97a0ae3e7ca7f5dd722959752f0b3 - ;; - esac - if [[ "$(shasum gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then - echo "shasum mismatch for gfortran-darwin-${arch}-${type}" - exit 1 - fi - sudo mkdir -p /opt/ - sudo cp "gfortran-darwin-${arch}-${type}.tar.gz" /opt/gfortran-darwin-${arch}-${type}.tar.gz - pushd /opt - sudo tar -xvf gfortran-darwin-${arch}-${type}.tar.gz - sudo rm gfortran-darwin-${arch}-${type}.tar.gz - popd - if [[ "${type}" == "native" ]]; then - # Link these into /usr/local so that there's no need to add rpath or -L - for f in libgfortran.dylib libgfortran.5.dylib libgcc_s.1.dylib libgcc_s.1.1.dylib libquadmath.dylib libquadmath.0.dylib; do - ln -sf /opt/gfortran-darwin-${arch}-${type}/lib/$f /usr/local/lib/$f - done - # Add it to PATH - ln -sf /opt/gfortran-darwin-${arch}-${type}/bin/gfortran /usr/local/bin/gfortran - fi - } - - function install_arm64_cross_gfortran { - download_and_unpack_gfortran arm64 cross - export FC_ARM64="$(find /opt/gfortran-darwin-arm64-cross/bin -name "*-gfortran")" - local libgfortran="$(find /opt/gfortran-darwin-arm64-cross/lib -name libgfortran.dylib)" - local libdir=$(dirname $libgfortran) - - export FC_ARM64_LDFLAGS="-L$libdir -Wl,-rpath,$libdir" - if [[ "${PLAT:-}" == "arm64" ]]; then - export FC=$FC_ARM64 - fi - } - function install_gfortran { - download_and_unpack_gfortran $(uname -m) native - check_gfortran - if [[ "${PLAT:-}" == "universal2" || "${PLAT:-}" == "arm64" ]]; then - install_arm64_cross_gfortran - fi - } - - function get_gf_lib { - # Get lib with gfortran suffix - get_gf_lib_for_suf "gf_${GFORTRAN_SHA:0:7}" $@ - } -else - function install_gfortran { - # No-op - already installed on manylinux image - check_gfortran - } - - function get_gf_lib { - # Get library with no suffix - get_gf_lib_for_suf "" $@ - } -fi From 05959c26804b7fd4928915ed6da4f46dda93cdac Mon Sep 17 00:00:00 2001 From: mattip Date: Sat, 25 Oct 2025 21:05:20 +0300 Subject: [PATCH 02/11] remove patch --- patches/0001-backout-PR-4741.patch | 61 ------------------------------ 1 file changed, 61 deletions(-) delete mode 100644 patches/0001-backout-PR-4741.patch diff --git a/patches/0001-backout-PR-4741.patch b/patches/0001-backout-PR-4741.patch deleted file mode 100644 index fa08d49..0000000 --- a/patches/0001-backout-PR-4741.patch +++ /dev/null @@ -1,61 +0,0 @@ -From fe2f02876134dcfdd75860c622226b6913eef93e Mon Sep 17 00:00:00 2001 -From: mattip -Date: Wed, 22 Oct 2025 14:40:01 +0300 -Subject: [PATCH] backout PR 4741 - ---- - driver/level3/level3_thread.c | 24 ++++++++++++------------ - 1 file changed, 12 insertions(+), 12 deletions(-) - -diff --git a/driver/level3/level3_thread.c b/driver/level3/level3_thread.c -index 22f27975b..0832db58b 100644 ---- a/driver/level3/level3_thread.c -+++ b/driver/level3/level3_thread.c -@@ -588,8 +588,8 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG - InitializeCriticalSection((PCRITICAL_SECTION)&level3_lock); - #else - static pthread_mutex_t level3_lock = PTHREAD_MUTEX_INITIALIZER; -- static pthread_cond_t level3_wakeup = PTHREAD_COND_INITIALIZER; -- volatile static BLASLONG CPU_AVAILABLE = MAX_CPU_NUMBER; -+ // static pthread_cond_t level3_wakeup = PTHREAD_COND_INITIALIZER; -+ // volatile static BLASLONG CPU_AVAILABLE = MAX_CPU_NUMBER; - #endif - - blas_arg_t newarg; -@@ -659,12 +659,12 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG - EnterCriticalSection((PCRITICAL_SECTION)&level3_lock); - #else - pthread_mutex_lock(&level3_lock); -- while(CPU_AVAILABLE < nthreads) { -- pthread_cond_wait(&level3_wakeup, &level3_lock); -- } -- CPU_AVAILABLE -= nthreads; -- WMB; -- pthread_mutex_unlock(&level3_lock); -+ // while(CPU_AVAILABLE < nthreads) { -+ // pthread_cond_wait(&level3_wakeup, &level3_lock); -+ // } -+ // CPU_AVAILABLE -= nthreads; -+ // WMB; -+ // pthread_mutex_unlock(&level3_lock); - #endif - - #ifdef USE_ALLOC_HEAP -@@ -816,10 +816,10 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG - #elif defined(OS_WINDOWS) - LeaveCriticalSection((PCRITICAL_SECTION)&level3_lock); - #else -- pthread_mutex_lock(&level3_lock); -- CPU_AVAILABLE += nthreads; -- WMB; -- pthread_cond_signal(&level3_wakeup); -+ // pthread_mutex_lock(&level3_lock); -+ // CPU_AVAILABLE += nthreads; -+ // WMB; -+ // pthread_cond_signal(&level3_wakeup); - pthread_mutex_unlock(&level3_lock); - #endif - --- -2.43.0 - From 123c415069c23389024ecfbe6986b26dba9fcff3 Mon Sep 17 00:00:00 2001 From: mattip Date: Sat, 25 Oct 2025 21:43:52 +0300 Subject: [PATCH 03/11] typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 99375dd..e563e64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "scipy-openblas64" # v0.3.30 -version = "v0.3.30-317.0" +version = "0.3.30-317.0" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md" From 7cbbb0ff7501e6217427dd410cae9955bde9534b Mon Sep 17 00:00:00 2001 From: mattip Date: Sun, 26 Oct 2025 07:11:14 +0200 Subject: [PATCH 04/11] typo --- .github/workflows/posix.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 60f98af..c2ab9f2 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -28,8 +28,8 @@ jobs: - { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} - { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} - - { os: macos-intel-15, PLAT: x86_64, INTERFACE64: '0', MB_ML_LIBC: macosx} - - { os: macos-intel-15, PLAT: x86_64, INTERFACE64: '1', MB_ML_LIBC: macosx} + - { os: macos-15-intel, PLAT: x86_64, INTERFACE64: '0', MB_ML_LIBC: macosx} + - { os: macos-15-intel, PLAT: x86_64, INTERFACE64: '1', MB_ML_LIBC: macosx} - { os: macos-latest, PLAT: arm64, INTERFACE64: '0', MB_ML_LIBC: macosx} - { os: macos-latest, PLAT: arm64, INTERFACE64: '1', MB_ML_LIBC: macosx} diff --git a/pyproject.toml b/pyproject.toml index e563e64..32903d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "scipy-openblas64" # v0.3.30 -version = "0.3.30-317.0" +version = "0.3.30.317.0" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md" From 1933ebdbfcef54396b3b5a07db1cb564c6edb507 Mon Sep 17 00:00:00 2001 From: mattip Date: Sun, 26 Oct 2025 12:21:32 +0200 Subject: [PATCH 05/11] quiet some warnings on macos-x86_64 --- tools/build_steps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index b651c82..dc6207c 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -152,7 +152,7 @@ function do_build_lib { local target="CORE2" # Pick up the gfortran runtime libraries export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH - CFLAGS="$CFLAGS -arch x86_64" + CFLAGS="$CFLAGS -arch x86_64 -Wno-shift-op-parentheses -Wno-logical-op-parentheses -Wno-deprecated-declarations" export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} ;; *-i686) From 69a876eca4a3647d1e68129497026bfc7f44384b Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Sun, 26 Oct 2025 16:03:43 +0200 Subject: [PATCH 06/11] show gfortran version --- tools/build_objconv.sh | 2 +- tools/build_steps.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/build_objconv.sh b/tools/build_objconv.sh index 5f42508..47c98e9 100644 --- a/tools/build_objconv.sh +++ b/tools/build_objconv.sh @@ -1,4 +1,4 @@ echo "Building objconv..." set -e -x unzip source.zip -g++ -O1 -o objconv *.cpp +g++ -O1 -Wno-deprecated-declarations -o objconv *.cpp diff --git a/tools/build_steps.sh b/tools/build_steps.sh index dc6207c..4c89b53 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -40,6 +40,9 @@ function before_build { python3.9 -m venv venv source venv/bin/activate alias gfortran=gfortran-15 + echo "gfortran --version" + which gfortran + gfortran --version # Deployment target set by gfortran_utils echo "Deployment target $MACOSX_DEPLOYMENT_TARGET" @@ -152,7 +155,7 @@ function do_build_lib { local target="CORE2" # Pick up the gfortran runtime libraries export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH - CFLAGS="$CFLAGS -arch x86_64 -Wno-shift-op-parentheses -Wno-logical-op-parentheses -Wno-deprecated-declarations" + export CFLAGS="$CFLAGS -arch x86_64 -Wno-shift-op-parentheses -Wno-logical-op-parentheses -Wno-deprecated-declarations" export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} ;; *-i686) @@ -212,14 +215,14 @@ function do_build_lib { fi if [ -n "$dynamic_list" ]; then CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ - make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \ + make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=0 \ USE_OPENMP=0 NUM_THREADS=64 \ DYNAMIC_LIST="$dynamic_list" \ BINARY="$bitness" $interface_flags \ TARGET="$target" else CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ - make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \ + make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=0 \ USE_OPENMP=0 NUM_THREADS=64 \ BINARY="$bitness" $interface_flags \ TARGET="$target" From 30fa56aec2975d75a1242eb70bfce03037e80dd9 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Sun, 26 Oct 2025 16:14:07 +0200 Subject: [PATCH 07/11] try harder to find gfortran --- tools/build_steps.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 4c89b53..979ec5b 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -39,10 +39,15 @@ function before_build { # get_macpython_environment ${MB_PYTHON_VERSION} venv python3.9 -m venv venv source venv/bin/activate - alias gfortran=gfortran-15 - echo "gfortran --version" + + # Link to gfortran, see https://github.com/actions/runner-images/issues/3371 + sudo ln -fs /opt/homebrew/bin/gfortran-${GCC_V} /usr/local/bin/gfortran + sudo mkdir -p /usr/local/gfortran + sudo ln -sf /opt/homebrew/Cellar/gcc@${GCC_V}/*/lib/gcc/${GCC_V} /usr/local/gfortran/lib + echo GFORTRAN which gfortran gfortran --version + echo -------- # Deployment target set by gfortran_utils echo "Deployment target $MACOSX_DEPLOYMENT_TARGET" From b821701e51ba4a11ab988f01093a540bdd730796 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Sun, 26 Oct 2025 16:18:33 +0200 Subject: [PATCH 08/11] typo --- tools/build_steps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 979ec5b..f91bb3d 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -41,6 +41,7 @@ function before_build { source venv/bin/activate # Link to gfortran, see https://github.com/actions/runner-images/issues/3371 + GCC_V=15 sudo ln -fs /opt/homebrew/bin/gfortran-${GCC_V} /usr/local/bin/gfortran sudo mkdir -p /usr/local/gfortran sudo ln -sf /opt/homebrew/Cellar/gcc@${GCC_V}/*/lib/gcc/${GCC_V} /usr/local/gfortran/lib From 83870a1ca0f2d4493ec33cf7a14da8420779e7af Mon Sep 17 00:00:00 2001 From: mattip Date: Wed, 29 Oct 2025 11:38:27 +0200 Subject: [PATCH 09/11] use gfortran-11 on macos --- .gitmodules | 3 +++ tools/build_steps.sh | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitmodules b/.gitmodules index 546361d..1e7eec7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "OpenBLAS"] path = OpenBLAS url = https://github.com/xianyi/OpenBLAS.git +[submodule "gfortran-install"] + path = gfortran-install + url = https://github.com/MacPython/gfortran-install.git diff --git a/tools/build_steps.sh b/tools/build_steps.sh index f91bb3d..d07b8e0 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -39,12 +39,13 @@ function before_build { # get_macpython_environment ${MB_PYTHON_VERSION} venv python3.9 -m venv venv source venv/bin/activate + # Since install_fortran uses `uname -a` to determine arch, + # force the architecture + arch -${PLAT} bash -s << EOF +source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh +install_gfortran +EOF - # Link to gfortran, see https://github.com/actions/runner-images/issues/3371 - GCC_V=15 - sudo ln -fs /opt/homebrew/bin/gfortran-${GCC_V} /usr/local/bin/gfortran - sudo mkdir -p /usr/local/gfortran - sudo ln -sf /opt/homebrew/Cellar/gcc@${GCC_V}/*/lib/gcc/${GCC_V} /usr/local/gfortran/lib echo GFORTRAN which gfortran gfortran --version @@ -67,7 +68,7 @@ function clean_code { echo after git fetch origin git checkout $build_commit echo after git checkout $build_commit - git clean -fxd + git clean -fxd echo after git clean git submodule update --init --recursive echo after git submodule update @@ -221,14 +222,14 @@ function do_build_lib { fi if [ -n "$dynamic_list" ]; then CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ - make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=0 \ + make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \ USE_OPENMP=0 NUM_THREADS=64 \ DYNAMIC_LIST="$dynamic_list" \ BINARY="$bitness" $interface_flags \ TARGET="$target" else CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ - make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=0 \ + make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \ USE_OPENMP=0 NUM_THREADS=64 \ BINARY="$bitness" $interface_flags \ TARGET="$target" From 40b6d4b74d651d89eeb8ae46915e3a25c02af505 Mon Sep 17 00:00:00 2001 From: mattip Date: Wed, 29 Oct 2025 12:01:37 +0200 Subject: [PATCH 10/11] update git submodules in top repo --- tools/build_steps.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index d07b8e0..73c0a5b 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -60,9 +60,9 @@ EOF function clean_code { set -ex - # Copied from common_utils.sh, with added debugging local build_commit=$1 [ -z "$build_commit" ] && echo "build_commit not defined" && exit 1 + git submodule update --init --recursive pushd OpenBLAS git fetch origin --tags echo after git fetch origin @@ -70,8 +70,6 @@ function clean_code { echo after git checkout $build_commit git clean -fxd echo after git clean - git submodule update --init --recursive - echo after git submodule update popd } From a350d51e0e596288e7e3bc70eb56e507eacfda1e Mon Sep 17 00:00:00 2001 From: mattip Date: Wed, 29 Oct 2025 12:14:12 +0200 Subject: [PATCH 11/11] add back gfortran-install submodule --- .gitmodules | 4 ++-- gfortran-install | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 160000 gfortran-install diff --git a/.gitmodules b/.gitmodules index 1e7eec7..7b8f5ca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,5 +2,5 @@ path = OpenBLAS url = https://github.com/xianyi/OpenBLAS.git [submodule "gfortran-install"] - path = gfortran-install - url = https://github.com/MacPython/gfortran-install.git + path = gfortran-install + url = https://github.com/MacPython/gfortran-install.git diff --git a/gfortran-install b/gfortran-install new file mode 160000 index 0000000..3dd38d9 --- /dev/null +++ b/gfortran-install @@ -0,0 +1 @@ +Subproject commit 3dd38d9ce78b3890598cb0eff18a7bec50c06f5e