Skip to content

Commit

Permalink
Enable universal2 wheels
Browse files Browse the repository at this point in the history
Changes ported from `numpy-wheels`  found at:
- MacPython/numpy-wheels#104
- MacPython/numpy-wheels#115
  • Loading branch information
judahrand committed Jun 28, 2021
1 parent d3609de commit ef2d728
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
10 changes: 9 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ jobs:
- template: azure-posix.yml
parameters:
name: macOS
vmImage: macOS-10.14
vmImage: macOS-10.15
matrix:
osx-Py37:
MB_PYTHON_VERSION: "3.7"
osx-Py38:
MB_PYTHON_VERSION: "3.8"
MB_PYTHON_OSX_VER: "10.9"
osx-Py38-universal2:
MB_PYTHON_VERSION: "3.8"
MB_PYTHON_OSX_VER: "10.9"
PLAT: universal2
osx-Py39:
MB_PYTHON_VERSION: "3.9"
MB_PYTHON_OSX_VER: "10.9"
osx-Py39-universal2:
MB_PYTHON_VERSION: "3.9"
MB_PYTHON_OSX_VER: "10.9"
PLAT: universal2
3 changes: 2 additions & 1 deletion azure-posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ jobs:
displayName: Define build env variables
- bash: |
set -e
set -ex
echo building for commit "$BUILD_COMMIT"
pip install --upgrade virtualenv wheel setuptools
BUILD_DEPENDS="wheel oldest-supported-numpy Cython>=0.29.18 pybind11>=2.4.3 pythran"
Expand Down
21 changes: 19 additions & 2 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,29 @@ function build_wheel {
fi
}

# TODO: Remove once https://github.com/matthew-brett/multibuild/pull/409 lands
function pyinst_fname_for_version {
# echo filename for OSX installer file given Python and minimum
# macOS versions
# Parameters
# $py_version (Python version in major.minor.extra format)
# $py_osx_ver: {major.minor | not defined}
# if defined, the minimum macOS SDK version that Python is
# built for, eg: "10.6" or "10.9", if not defined, infers
# this from $py_version using macpython_sdk_for_version
local py_version=$1
local py_osx_ver=${2:-$(macpython_sdk_for_version $py_version)}
local inst_ext=$(pyinst_ext_for_version $py_version)
echo "python-${py_version}-macosx${py_osx_ver}.${inst_ext}"
}

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
$use_sudo cp -r $basedir/lib/* $BUILD_PREFIX/lib
$use_sudo cp $basedir/include/* $BUILD_PREFIX/include
export OPENBLAS=$BUILD_PREFIX
}

function set_arch {
Expand Down
2 changes: 1 addition & 1 deletion gfortran-install

0 comments on commit ef2d728

Please sign in to comment.