Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
multibuild
Commits
2bf2b360
Unverified
Commit
2bf2b360
authored
Jan 29, 2021
by
Matthew Brett
Committed by
GitHub
Jan 29, 2021
Browse files
Merge pull request #384 from isuruf/arm64
MRG: set MACOSX_DEPLOYMENT_TARGET for arm64 build
parents
0d93db54
42799f20
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
8 deletions
+41
-8
README.rst
README.rst
+1
-0
common_utils.sh
common_utils.sh
+6
-0
osx_utils.sh
osx_utils.sh
+34
-8
No files found.
README.rst
View file @
2bf2b360
...
...
@@ -434,6 +434,7 @@ To use these scripts
using Rosetta2 emulation.
There are two ways to build ``universal2`` builds.
1. Build with ``-arch x86_64 -arch arm64``.
These flags instruct the C/C++ compiler to compile twice and create a
fat object/executable/library. This is the easiest, but has several
...
...
common_utils.sh
View file @
2bf2b360
...
...
@@ -329,6 +329,12 @@ function pip_opts {
[ -n "
$MANYLINUX_URL
" ] && echo "
--find-links
$MANYLINUX_URL
"
}
function get_os {
# Report OS as given by uname
# Use any Python that comes to hand.
python -c 'import platform; print(platform.uname()[0])'
}
function get_platform {
# Report platform as given by uname
# Use any Python that comes to hand.
...
...
osx_utils.sh
View file @
2bf2b360
...
...
@@ -424,8 +424,8 @@ function activate_ccache {
echo
"Using C compiler:
$(
which clang
)
"
}
function
macos_intel_build_setup
{
# Setup build for single arch x86_64 wheels
function
macos_intel_
native_
build_setup
{
# Setup
native
build for single arch x86_64 wheels
export
PLAT
=
"x86_64"
export
_PYTHON_HOST_PLATFORM
=
"macosx-
${
MB_PYTHON_OSX_VER
}
-x86_64"
export
CFLAGS+
=
" -arch x86_64"
...
...
@@ -435,8 +435,13 @@ function macos_intel_build_setup {
export
LDFLAGS+
=
" -arch x86_64"
}
function
macos_arm64_build_setup
{
# Setup build for single arch arm_64 wheels
function
macos_intel_cross_build_setup
{
echo
"universal2 builds on arm64 are not supported yet."
exit
1
}
function
macos_arm64_cross_build_setup
{
# Setup cross build for single arch arm_64 wheels
export
PLAT
=
"arm64"
export
BUILD_PREFIX
=
/opt/arm64-builds
sudo mkdir
-p
$BUILD_PREFIX
...
...
@@ -449,11 +454,22 @@ function macos_arm64_build_setup {
export
ARCHFLAGS+
=
" -arch arm64"
export
FCFLAGS+
=
" -arch arm64"
export
FC
=
$FC_ARM64
export
MACOSX_DEPLOYMENT_TARGET
=
"11.0"
export
CROSS_COMPILING
=
1
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
export
host_alias
=
"aarch64-apple-darwin20.0.0"
}
function
macos_arm64_native_build_setup
{
# Setup native build for single arch arm_64 wheels
export
PLAT
=
"arm64"
# We don't want universal2 builds and only want an arm64 build
export
_PYTHON_HOST_PLATFORM
=
"macosx-11.0-arm64"
export
ARCHFLAGS+
=
"-arch arm64"
$@
}
function
fuse_macos_intel_arm64
{
local
wheelhouse
=
$(
abspath
${
WHEEL_SDIR
:-
wheelhouse
}
)
local
py_osx_ver
=
$(
echo
${
MB_PYTHON_OSX_VER
}
|
sed
"s/
\.
/_/g"
)
...
...
@@ -475,12 +491,22 @@ function fuse_macos_intel_arm64 {
function
wrap_wheel_builder
{
if
[[
"
${
PLAT
:-}
"
==
"universal2"
]]
;
then
(
macos_intel_build_setup
&&
$@
)
if
[[
"
$(
uname
-m
)
"
==
"arm64"
]]
;
then
(
macos_intel_cross_build_setup
&&
$@
)
rm
-rf
*
-stamp
(
macos_arm64_native_build_setup
&&
$@
)
else
(
macos_intel_native_build_setup
&&
$@
)
rm
-rf
*
-stamp
(
macos_arm64_build_setup
&&
$@
)
(
macos_arm64_cross_build_setup
&&
$@
)
fi
fuse_macos_intel_arm64
elif
[[
"
${
PLAT
:-}
"
==
"arm64"
]]
;
then
(
macos_arm64_build_setup
&&
$@
)
if
[[
"
$(
uname
-m
)
"
==
"arm64"
]]
;
then
(
macos_arm64_native_build_setup
&&
$@
)
else
(
macos_arm64_cross_build_setup
&&
$@
)
fi
else
$@
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment