Skip to content

Commit

Permalink
MAINT: PR 135 revisions
Browse files Browse the repository at this point in the history
* switch to `x86_64` thin wheel builds
for Mac OS Python `3.10` following upstream
changes/releases in multibuild/NumPy that
support this

* point to the new `multibuild` repo and sync
to latest `devel` (for thin MacOS Python 3.10
x86_64 thin wheel support, etc.)

* backport the full set of `master` branch changes
to `config.sh` based on feedback from Isuru
  • Loading branch information
tylerjereddy committed Nov 5, 2021
1 parent 8be5e72 commit fd24270
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url = https://github.com/scipy/scipy.git
[submodule "multibuild"]
path = multibuild
url = https://github.com/matthew-brett/multibuild.git
url = https://github.com/multi-build/multibuild.git
[submodule "gfortran-install"]
path = gfortran-install
url = https://github.com/MacPython/gfortran-install.git
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
osx-Py39:
MB_PYTHON_VERSION: "3.9"
MB_PYTHON_OSX_VER: "10.9"
osx-Py310-universal2:
osx-Py310:
MB_PYTHON_VERSION: "3.10"
MB_PYTHON_OSX_VER: "10.9"
PLAT: universal2
PLAT: x86_64
40 changes: 12 additions & 28 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,24 @@
source gfortran-install/gfortran_utils.sh

function build_wheel {
export FFLAGS="$FFLAGS -fPIC"
if [ -z "$IS_OSX" ]; then
unset FFLAGS
export LDFLAGS="-shared -Wl,-strip-all"
build_libs $PLAT
# Work round build dependencies spec in pyproject.toml
build_bdist_wheel $@
else
export FFLAGS="$FFLAGS -fPIC"
build_osx_wheel $@
install_gfortran
wrap_wheel_builder build_osx_wheel $@
fi
}

function build_libs {
PYTHON_EXE=`which python`
$PYTHON_EXE -c"import platform; print('platform.uname().machine', platform.uname().machine)"
basedir=$($PYTHON_EXE scipy/tools/openblas_support.py)
$use_sudo cp -r $basedir/lib/* /usr/local/lib
$use_sudo cp $basedir/include/* /usr/local/include
}

function set_arch {
local arch=$1
export CC="clang $arch"
export CXX="clang++ $arch"
export CFLAGS="$arch"
export FFLAGS="$arch"
export FARCH="$arch"
export LDFLAGS="$arch"
$use_sudo cp -r $basedir/lib/* $BUILD_PREFIX/lib
$use_sudo cp $basedir/include/* $BUILD_PREFIX/include
export OPENBLAS=$BUILD_PREFIX
}

function build_wheel_with_patch {
Expand All @@ -41,19 +31,12 @@ function build_wheel_with_patch {
}

function build_osx_wheel {
# Build 64-bit wheel
# Standard gfortran won't build dual arch objects.
local repo_dir=${1:-$REPO_DIR}
local py_ld_flags="-Wall -undefined dynamic_lookup -bundle"

install_gfortran
# 64-bit wheel
local arch="-m64"
set_arch $arch
build_libs x86_64
# Build wheel
export LDSHARED="$CC $py_ld_flags"
export LDFLAGS="$arch $py_ld_flags"
if [ ! -z "$FC" ]; then
export F77=$FC
export F90=$FC
fi
build_libs
# Work round build dependencies spec in pyproject.toml
# See e.g.
# https://travis-ci.org/matthew-brett/scipy-wheels/jobs/387794282
Expand Down Expand Up @@ -83,6 +66,7 @@ function run_tests {
function install_run {
# Override multibuild test running command, to preinstall packages
# that have to be installed before TEST_DEPENDS.
set -ex
PIP_CMD="$PYTHON_EXE -m pip"
$PYTHON_EXE -m pip install $(pip_opts) setuptools_scm

Expand Down
2 changes: 1 addition & 1 deletion multibuild

0 comments on commit fd24270

Please sign in to comment.