Commit 5924b59c authored by Isuru Fernando's avatar Isuru Fernando
Browse files

Merge branch 'devel' of github.com:matthew-brett/multibuild into master

parents dcf9ab43 0d93db54
...@@ -444,7 +444,7 @@ To use these scripts ...@@ -444,7 +444,7 @@ To use these scripts
not be identical which is required when building the wheel as a ``universal2`` not be identical which is required when building the wheel as a ``universal2``
wheel. If you are using Fortran, ``gfortran`` doesn't support fat binaries. wheel. If you are using Fortran, ``gfortran`` doesn't support fat binaries.
2. Build ``arm64`` and ``x86_64`` wheels seperately and fuse them. 2. Build ``arm64`` and ``x86_64`` wheels separately and fuse them.
For this to work, we need to build the C/C++ libraries twice. Therefore, For this to work, we need to build the C/C++ libraries twice. Therefore,
the library building is once called with ``BUILD_PREFIX=${BUILD_PREFIX:-/usr/local}`` the library building is once called with ``BUILD_PREFIX=${BUILD_PREFIX:-/usr/local}``
for ``x86_64`` and then called again with ``BUILD_PREFIX=/opt/arm64-builds``. for ``x86_64`` and then called again with ``BUILD_PREFIX=/opt/arm64-builds``.
......
...@@ -271,7 +271,7 @@ function bdist_wheel_cmd { ...@@ -271,7 +271,7 @@ function bdist_wheel_cmd {
} }
function wrap_wheel_builder { function wrap_wheel_builder {
# Wrapper for build command, overwritten by macOS for universal2 wheel building # Wrapper for build commands, overwritten by macOS for universal2 or arm64 wheel building
$@ $@
} }
......
...@@ -27,7 +27,7 @@ if [ -n "$IS_MACOS" ]; then ...@@ -27,7 +27,7 @@ if [ -n "$IS_MACOS" ]; then
# Do nothing as we are going with fusing wheels # Do nothing as we are going with fusing wheels
ARCH_FLAGS=${ARCH_FLAGS:-} ARCH_FLAGS=${ARCH_FLAGS:-}
else else
echo "invalid platform = '$PLAT', supported values are 'intel' or 'x86_64' or 'arm64' or 'universal2'" echo "Invalid platform = '$PLAT'. Supported values are 'intel', 'x86_64', 'arm64' or 'universal2'"
exit 1 exit 1
fi fi
# Only set CFLAGS, FFLAGS if they are not already defined. Build functions # Only set CFLAGS, FFLAGS if they are not already defined. Build functions
......
...@@ -424,8 +424,8 @@ function activate_ccache { ...@@ -424,8 +424,8 @@ function activate_ccache {
echo "Using C compiler: $(which clang)" echo "Using C compiler: $(which clang)"
} }
function macos_intel_build_wrap { function macos_intel_build_setup {
# Wrap build for single arch x86_64 wheels # Setup build for single arch x86_64 wheels
export PLAT="x86_64" export PLAT="x86_64"
export _PYTHON_HOST_PLATFORM="macosx-${MB_PYTHON_OSX_VER}-x86_64" export _PYTHON_HOST_PLATFORM="macosx-${MB_PYTHON_OSX_VER}-x86_64"
export CFLAGS+=" -arch x86_64" export CFLAGS+=" -arch x86_64"
...@@ -433,11 +433,10 @@ function macos_intel_build_wrap { ...@@ -433,11 +433,10 @@ function macos_intel_build_wrap {
export ARCHFLAGS+=" -arch x86_64" export ARCHFLAGS+=" -arch x86_64"
export CPPFLAGS+=" -arch x86_64" export CPPFLAGS+=" -arch x86_64"
export LDFLAGS+=" -arch x86_64" export LDFLAGS+=" -arch x86_64"
$@
} }
function macos_arm64_build_wrap { function macos_arm64_build_setup {
# Wrap build for single arch arm_64 wheels # Setup build for single arch arm_64 wheels
export PLAT="arm64" export PLAT="arm64"
export BUILD_PREFIX=/opt/arm64-builds export BUILD_PREFIX=/opt/arm64-builds
sudo mkdir -p $BUILD_PREFIX sudo mkdir -p $BUILD_PREFIX
...@@ -455,7 +454,6 @@ function macos_arm64_build_wrap { ...@@ -455,7 +454,6 @@ function macos_arm64_build_wrap {
export LDFLAGS+=" -arch arm64 -L$BUILD_PREFIX/lib -Wl,-rpath,$BUILD_PREFIX/lib ${FC_ARM64_LDFLAGS:-}" export LDFLAGS+=" -arch arm64 -L$BUILD_PREFIX/lib -Wl,-rpath,$BUILD_PREFIX/lib ${FC_ARM64_LDFLAGS:-}"
# This would automatically let autoconf know that we are cross compiling for arm64 darwin # This would automatically let autoconf know that we are cross compiling for arm64 darwin
export host_alias="aarch64-apple-darwin20.0.0" export host_alias="aarch64-apple-darwin20.0.0"
$@
} }
function fuse_macos_intel_arm64 { function fuse_macos_intel_arm64 {
...@@ -479,12 +477,12 @@ function fuse_macos_intel_arm64 { ...@@ -479,12 +477,12 @@ function fuse_macos_intel_arm64 {
function wrap_wheel_builder { function wrap_wheel_builder {
if [[ "${PLAT:-}" == "universal2" ]]; then if [[ "${PLAT:-}" == "universal2" ]]; then
(macos_intel_build_wrap $@) (macos_intel_build_setup && $@)
rm -rf *-stamp rm -rf *-stamp
(macos_arm64_build_wrap $@) (macos_arm64_build_setup && $@)
fuse_macos_intel_arm64 $@ fuse_macos_intel_arm64
elif [[ "${PLAT:-}" == "arm64" && "$(uname -m)" != "arm64" ]]; then elif [[ "${PLAT:-}" == "arm64" && "(uname -m)" != "arm64" ]]; then
(macos_arm64_build_wrap $@) (macos_arm64_build_setup && $@)
else else
$@ $@
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment