From 5c480979affda8c52224ac9c1ed3f632d821b5ab Mon Sep 17 00:00:00 2001 From: mattip Date: Wed, 2 Jul 2025 23:15:21 +0300 Subject: [PATCH 01/12] update to macos-latest --- .github/workflows/posix.yml | 14 +++++++------- gfortran-install | 2 +- pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 93567d2..e567c27 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -23,16 +23,16 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13] + os: [ubuntu-latest, macos-latest] PLAT: [i686, x86_64] INTERFACE64: ['0', '1'] MB_ML_VER: ['2014'] MB_ML_LIBC: ['manylinux'] include: - - os: macos-13 + - os: macos-latest PLAT: arm64 INTERFACE64: '1' - - os: macos-13 + - os: macos-latest PLAT: arm64 INTERFACE64: '0' - os: ubuntu-latest @@ -67,7 +67,7 @@ jobs: exclude: - PLAT: i686 - os: macos-13 + os: macos-latest - PLAT: i686 INTERFACE64: '1' env: @@ -94,9 +94,9 @@ jobs: echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_${{ matrix.PLAT}})" >> $GITHUB_ENV; - uses: maxim-lobanov/setup-xcode@v1.6.0 - if: ${{ matrix.os == 'macos-13' }} + if: ${{ matrix.os == 'macos-latest' }} with: - xcode-version: '14.3' + xcode-version: '15.4' - name: Print some Environment variable run: | @@ -137,7 +137,7 @@ jobs: version=$(cd OpenBLAS && git describe --tags --abbrev=8 | sed -e "s/^v\(.*\)-g.*/\1/" | sed -e "s/-/./g") sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml fi - if [ "macos-13" == "${{ matrix.os }}" ]; then + if [ "macos-latest" == "${{ matrix.os }}" ]; then source tools/build_wheel.sh else libc=${MB_ML_LIBC:-manylinux} diff --git a/gfortran-install b/gfortran-install index 47bb0df..3dd38d9 160000 --- a/gfortran-install +++ b/gfortran-install @@ -1 +1 @@ -Subproject commit 47bb0df1e6f766503f81e4fd3d5d2acadd887393 +Subproject commit 3dd38d9ce78b3890598cb0eff18a7bec50c06f5e diff --git a/pyproject.toml b/pyproject.toml index 842951f..90bc7f9 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.1" +version = "0.3.30.0.2" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md" From bd4afeb46341e35019d87c3a915ea08687b6692e Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 14 Jul 2025 00:26:03 +0300 Subject: [PATCH 02/12] ensure /usr/local/lib exists before installing gfortran --- tools/build_steps.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 5d8a14f..be898c8 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -1,17 +1,16 @@ # Build script for manylinux and OSX BUILD_PREFIX=/usr/local -# OSX gfortran archive -GFORTRAN_DMG="archives/gfortran-4.9.0-Mavericks.dmg" ROOT_DIR=$(dirname $(dirname "${BASH_SOURCE[0]}")) source ${ROOT_DIR}/multibuild/common_utils.sh -source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh MB_PYTHON_VERSION=3.9 function before_build { # Manylinux Python version set in build_lib if [ -n "$IS_OSX" ]; then + sudo mkdir -p /usr/local/lib + sudo chmod 777 /usr/local/lib source ${ROOT_DIR}/multibuild/osx_utils.sh get_macpython_environment ${MB_PYTHON_VERSION} venv source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh @@ -89,7 +88,6 @@ function build_lib { # # Depends on globals # BUILD_PREFIX - install suffix e.g. "/usr/local" - # GFORTRAN_DMG # MB_ML_VER set -x local plat=${1:-$PLAT} From 5bae1d5fc64d4e3c8428234a08cbfc31dfdc0755 Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 14 Jul 2025 09:16:48 +0300 Subject: [PATCH 03/12] update multibuild to latest master --- multibuild | 2 +- tools/build_steps.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/multibuild b/multibuild index 452dd2d..88a0b6f 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 452dd2d1705f6b2375369a6570c415beb3163f70 +Subproject commit 88a0b6f0eb770cf9f95792d66410e7696ce3d384 diff --git a/tools/build_steps.sh b/tools/build_steps.sh index be898c8..fbba67a 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -97,7 +97,7 @@ function build_lib { # Make directory to store built archive if [ -n "$IS_OSX" ]; then # Do build, add gfortran hash to end of name - wrap_wheel_builder do_build_lib "$plat" "gf_${GFORTRAN_SHA:0:7}" "$interface64" "$nightly" + do_build_lib "$plat" "gf_${GFORTRAN_SHA:0:7}" "$interface64" "$nightly" return fi # Manylinux wrapper @@ -166,7 +166,8 @@ function do_build_lib { Darwin-arm64) local bitness=64 local target="VORTEX" - CFLAGS="$CFLAGS -ftrapping-math" + CFLAGS="$CFLAGS -ftrapping-math -mmacosx-version-min=11.0" + MACOSX_DEPLOYMENT_TARGET="11.0" ;; *-s390x) local bitness=64 From b81d02fc01f249b75726e0cb7d294d6648d45ccc Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 14 Jul 2025 10:39:44 +0300 Subject: [PATCH 04/12] update multibuild to latest devel --- multibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multibuild b/multibuild index 88a0b6f..24f1446 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 88a0b6f0eb770cf9f95792d66410e7696ce3d384 +Subproject commit 24f1446f6477893b2ef9d721aabcee7a494ca2b1 From cd2d96f30e52227435f9b50a1806f8d6b6074db2 Mon Sep 17 00:00:00 2001 From: mattip Date: Tue, 15 Jul 2025 07:46:44 +0300 Subject: [PATCH 05/12] add -arch flags for macos x86_64 build --- tools/build_steps.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index fbba67a..33497d3 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -11,6 +11,7 @@ function before_build { if [ -n "$IS_OSX" ]; then sudo mkdir -p /usr/local/lib sudo chmod 777 /usr/local/lib + touch /usr/local/lib/.dir_exists source ${ROOT_DIR}/multibuild/osx_utils.sh get_macpython_environment ${MB_PYTHON_VERSION} venv source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh @@ -153,6 +154,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" ;; *-i686) local bitness=32 From 11b6fa195ea184f59c191602b267926bebecd30a Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 16 Jul 2025 05:22:58 +0300 Subject: [PATCH 06/12] use 'arch -?' to force achitecture selection on macOS --- .gitignore | 1 + tools/build_steps.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 74bbc8c..6f0c81a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ local/scipy_openblas64/include local/scipy_openblas64/*.so local/scipy_openblas64/*.pyd local/scipy_openblas64/*.dylib +objconv/ diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 33497d3..39a88cd 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -15,7 +15,9 @@ function before_build { source ${ROOT_DIR}/multibuild/osx_utils.sh get_macpython_environment ${MB_PYTHON_VERSION} venv source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh - install_gfortran + # Since install_fortran uses `uname -a` to determine arch, + # force the architecture + arch -${PLAT} install_gfortran # Deployment target set by gfortran_utils echo "Deployment target $MACOSX_DEPLOYMENT_TARGET" @@ -209,7 +211,7 @@ function do_build_lib { echo "Due to the qemu versions 7.2 causing utest cases to fail," echo "the utest dsdot:dsdot_n_1 have been temporarily disabled." fi - if [ -v dynamic_list ]; then + if [ -n "$dynamic_list" ]; then CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \ USE_OPENMP=0 NUM_THREADS=64 \ From 821e09e6dfb94ff99e04a914eb86210c2eb8e78b Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 16 Jul 2025 07:29:45 +0300 Subject: [PATCH 07/12] run install_gfortran under arch on macos --- tools/build_steps.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 39a88cd..d160617 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -14,10 +14,12 @@ function before_build { touch /usr/local/lib/.dir_exists source ${ROOT_DIR}/multibuild/osx_utils.sh get_macpython_environment ${MB_PYTHON_VERSION} venv - source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh # Since install_fortran uses `uname -a` to determine arch, # force the architecture - arch -${PLAT} install_gfortran + arch -${PLAT} bash -s << EOF +source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh +install_gfortran +EOF # Deployment target set by gfortran_utils echo "Deployment target $MACOSX_DEPLOYMENT_TARGET" From 07ce265c3b37305867ff8395d27122502943b535 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 16 Jul 2025 08:25:49 +0300 Subject: [PATCH 08/12] make sure SDKROOT is defined --- tools/build_steps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index d160617..612cb5e 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -159,6 +159,7 @@ function do_build_lib { # Pick up the gfortran runtime libraries export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH CFLAGS="$CFLAGS -arch x86_64" + export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} ;; *-i686) local bitness=32 @@ -172,8 +173,9 @@ function do_build_lib { Darwin-arm64) local bitness=64 local target="VORTEX" - CFLAGS="$CFLAGS -ftrapping-math -mmacosx-version-min=11.0" + CFLAGS="$CFLAGS -ftrapping-math -mmacos-version-min=11.0" MACOSX_DEPLOYMENT_TARGET="11.0" + export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} ;; *-s390x) local bitness=64 From 28d38d7abe308597aa392f213c1c524476b7ff5e Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Fri, 18 Jul 2025 00:03:31 +0300 Subject: [PATCH 09/12] make sure /usr/local/include exists --- tools/build_steps.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 612cb5e..886476c 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -12,6 +12,9 @@ function before_build { sudo mkdir -p /usr/local/lib sudo chmod 777 /usr/local/lib touch /usr/local/lib/.dir_exists + sudo mkdir -p /usr/local/include + sudo chmod 777 /usr/local/include + touch /usr/local/include/.dir_exists source ${ROOT_DIR}/multibuild/osx_utils.sh get_macpython_environment ${MB_PYTHON_VERSION} venv # Since install_fortran uses `uname -a` to determine arch, From 0f9690c27c441c51adee0abe7ed04e1143d500eb Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Fri, 18 Jul 2025 17:27:26 +1000 Subject: [PATCH 10/12] add DYLD_LIBRARY_PATH for arm64, specify python3.11 arch type --- tools/build_steps.sh | 17 +++++++++++------ tools/build_wheel.sh | 13 +++++++++---- tools/local_build.sh | 10 ++++------ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 886476c..f87758b 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -9,12 +9,16 @@ MB_PYTHON_VERSION=3.9 function before_build { # Manylinux Python version set in build_lib if [ -n "$IS_OSX" ]; then - sudo mkdir -p /usr/local/lib - sudo chmod 777 /usr/local/lib - touch /usr/local/lib/.dir_exists - sudo mkdir -p /usr/local/include - sudo chmod 777 /usr/local/include - touch /usr/local/include/.dir_exists + if [ ! -e /usr/local/lib ]; then + sudo mkdir -p /usr/local/lib + sudo chmod 777 /usr/local/lib + touch /usr/local/lib/.dir_exists + fi + if [ ! -e /usr/local/include ]; then + sudo mkdir -p /usr/local/include + sudo chmod 777 /usr/local/include + touch /usr/local/include/.dir_exists + fi source ${ROOT_DIR}/multibuild/osx_utils.sh get_macpython_environment ${MB_PYTHON_VERSION} venv # Since install_fortran uses `uname -a` to determine arch, @@ -179,6 +183,7 @@ function do_build_lib { CFLAGS="$CFLAGS -ftrapping-math -mmacos-version-min=11.0" MACOSX_DEPLOYMENT_TARGET="11.0" export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} + export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH ;; *-s390x) local bitness=64 diff --git a/tools/build_wheel.sh b/tools/build_wheel.sh index 4cea54d..1f52141 100644 --- a/tools/build_wheel.sh +++ b/tools/build_wheel.sh @@ -101,10 +101,15 @@ if [ "${PLAT}" == "arm64" ]; then exit 0 fi # Test that the wheel works with a different python +PYTHON=python3.11 +if [ $(uname) == "Darwin" ] -a [ "${PLAT}" == "x86_64" ]; then + which python3.11 + PYTHON="arch -x86_64 python3.11" +fi if [ "${INTERFACE64}" != "1" ]; then - python3.11 -m pip install --no-index --find-links dist scipy_openblas32 - python3.11 -m scipy_openblas32 + $PYTHON -m pip install --no-index --find-links dist scipy_openblas32 + $PYTHON -m scipy_openblas32 else - python3.11 -m pip install --no-index --find-links dist scipy_openblas64 - python3.11 -m scipy_openblas64 + $PYTHON -m pip install --no-index --find-links dist scipy_openblas64 + $PYTHON -m scipy_openblas64 fi diff --git a/tools/local_build.sh b/tools/local_build.sh index af3d323..6139fd3 100644 --- a/tools/local_build.sh +++ b/tools/local_build.sh @@ -4,7 +4,10 @@ set -e # Set extra env -if [[ $(uname -m) == "x86_64" ]]; then +if [[ $(uname) == "Darwin" ]]; then + # Force x86_64 + export PLAT=x86_64 +elif [[ $(uname -m) == "x86_64" ]]; then echo got x86_64 export TRAVIS_OS_NAME=ubuntu-latest export PLAT=x86_64 @@ -64,11 +67,6 @@ function build_openblas { fi # Build OpenBLAS set -xeo pipefail - if [ "$PLAT" == "arm64" ]; then - sudo xcode-select -switch /Applications/Xcode_12.5.1.app - export SDKROOT=/Applications/Xcode_12.5.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk - clang --version - fi source tools/build_steps.sh echo "------ BEFORE BUILD ---------" before_build From 1579d39d848200717fe970c0a47f0e099c57ab88 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Sat, 19 Jul 2025 22:45:04 +1000 Subject: [PATCH 11/12] typo --- tools/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_wheel.sh b/tools/build_wheel.sh index 1f52141..776a3ae 100644 --- a/tools/build_wheel.sh +++ b/tools/build_wheel.sh @@ -102,7 +102,7 @@ if [ "${PLAT}" == "arm64" ]; then fi # Test that the wheel works with a different python PYTHON=python3.11 -if [ $(uname) == "Darwin" ] -a [ "${PLAT}" == "x86_64" ]; then +if [ "$(uname)" == "Darwin" -a "${PLAT}" == "x86_64" ]; then which python3.11 PYTHON="arch -x86_64 python3.11" fi From 8e9a5c5da208c65b8e38a51fd7b4cef78e1aeec5 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Sun, 20 Jul 2025 07:30:25 +1000 Subject: [PATCH 12/12] fix miniconda action warning --- .github/workflows/posix.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index e567c27..2943422 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -159,12 +159,13 @@ jobs: name: openblas-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }} path: libs/openblas*.tar.gz - - uses: conda-incubator/setup-miniconda@v3.1.1 + - uses: conda-incubator/setup-miniconda@v3.2.0 with: channels: conda-forge channel-priority: true activate-environment: upload miniforge-version: latest + conda-remove-defaults: "true" - name: Upload # see https://github.com/marketplace/actions/setup-miniconda for why