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/.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/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/multibuild b/multibuild index 452dd2d..24f1446 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 452dd2d1705f6b2375369a6570c415beb3163f70 +Subproject commit 24f1446f6477893b2ef9d721aabcee7a494ca2b1 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" diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 5d8a14f..f87758b 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -1,21 +1,32 @@ # 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 + 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 - source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh - install_gfortran + # 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 # Deployment target set by gfortran_utils echo "Deployment target $MACOSX_DEPLOYMENT_TARGET" @@ -89,7 +100,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} @@ -99,7 +109,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 @@ -155,6 +165,8 @@ 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" + export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} ;; *-i686) local bitness=32 @@ -168,7 +180,10 @@ function do_build_lib { Darwin-arm64) local bitness=64 local target="VORTEX" - CFLAGS="$CFLAGS -ftrapping-math" + 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 @@ -208,7 +223,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 \ 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