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
b274b9aa
Commit
b274b9aa
authored
Jan 09, 2021
by
Andrew Murray
Browse files
Added IS_MACOS
parent
67cc9259
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
24 deletions
+24
-24
README.rst
README.rst
+1
-1
common_utils.sh
common_utils.sh
+3
-3
configure_build.sh
configure_build.sh
+3
-3
library_builders.sh
library_builders.sh
+12
-12
tests/test_library_builders.sh
tests/test_library_builders.sh
+3
-3
tests/test_multibuild.sh
tests/test_multibuild.sh
+2
-2
No files found.
README.rst
View file @
b274b9aa
...
...
@@ -372,7 +372,7 @@ To use these scripts
You also need this file to specify how to run your tests::
# Define custom utilities
# Test for macOS with [ -n "$IS_OS
X
" ]
# Test for macOS with [ -n "$IS_
MAC
OS" ]
function pre_build {
# Any stuff that you need to do before you start building the wheels
...
...
common_utils.sh
View file @
b274b9aa
...
...
@@ -22,7 +22,7 @@ GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
# with, so it is passed in when calling "docker run" for tests.
UNICODE_WIDTH
=
${
UNICODE_WIDTH
:-
32
}
if
[
$(
uname
)
==
"Darwin"
]
;
then
IS_OSX
=
1
;
fi
if
[
$(
uname
)
==
"Darwin"
]
;
then
IS_MACOS
=
1
;
IS_OSX
=
1
;
fi
# Work round bug in travis xcode image described at
# https://github.com/direnv/direnv/issues/210
...
...
@@ -164,7 +164,7 @@ function untar {
}
function install_rsync {
if [ -z "
$IS_OS
X
" ]; then
if [ -z "
$IS_
MAC
OS
" ]; then
[[
$(
type
-P
rsync
)
]] || yum_install rsync
fi
}
...
...
@@ -441,7 +441,7 @@ function install_pypy {
local version=
$1
case "
$PLAT
" in
"
x86_64
") if [ -n "
$IS_OS
X
" ]; then
"
x86_64
") if [ -n "
$IS_
MAC
OS
" ]; then
suffix="
osx64
";
else
suffix="
linux64
";
...
...
configure_build.sh
View file @
b274b9aa
# Find, load common utilities
# Defines IS_OS
X
, fetch_unpack
# Defines IS_
MAC
OS, fetch_unpack
MULTIBUILD_DIR
=
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
source
$MULTIBUILD_DIR
/common_utils.sh
...
...
@@ -12,8 +12,8 @@ CONFIGURE_BUILD_SOURCED=1
BUILD_PREFIX
=
"
${
BUILD_PREFIX
:-
/usr/local
}
"
MB_ML_VER
=
${
MB_ML_VER
:-
1
}
# IS_OS
X
is defined in common_utils.sh
if
[
-n
"
$IS_OS
X
"
]
;
then
# IS_
MAC
OS is defined in common_utils.sh
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
# Default compilation flags for OSX
source
$MULTIBUILD_DIR
/osx_utils.sh
PLAT
=
${
PLAT
:-
$(
macpython_arch_for_version
$MB_PYTHON_VERSION
)
}
...
...
library_builders.sh
View file @
b274b9aa
...
...
@@ -117,7 +117,7 @@ function openblas_get {
function
build_openblas
{
if
[
-e
openblas-stamp
]
;
then return
;
fi
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
brew
install
openblas
brew
link
--force
openblas
else
...
...
@@ -131,7 +131,7 @@ function build_openblas {
function
build_zlib
{
# Gives an old but safe version
if
[
-n
"
$IS_OS
X
"
]
;
then return
;
fi
# OSX has zlib already
if
[
-n
"
$IS_
MAC
OS
"
]
;
then return
;
fi
# OSX has zlib already
if
[
-e
zlib-stamp
]
;
then return
;
fi
yum_install zlib-devel
touch
zlib-stamp
...
...
@@ -159,7 +159,7 @@ function build_libpng {
}
function
build_bzip2
{
if
[
-n
"
$IS_OS
X
"
]
;
then return
;
fi
# OSX has bzip2 libs already
if
[
-n
"
$IS_
MAC
OS
"
]
;
then return
;
fi
# OSX has bzip2 libs already
if
[
-e
bzip2-stamp
]
;
then return
;
fi
fetch_unpack https://sourceware.org/pub/bzip2/bzip2-
${
BZIP2_VERSION
}
.tar.gz
(
cd
bzip2-
${
BZIP2_VERSION
}
\
...
...
@@ -178,7 +178,7 @@ function build_tiff {
function
get_modern_cmake
{
# Install cmake >= 2.8
local
cmake
=
cmake
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
brew
install
cmake
>
/dev/null
else
if
[
"
`
yum search cmake |
grep
^cmake28
\.
`
"
]
;
then
...
...
@@ -294,7 +294,7 @@ function build_blosc {
(
cd
c-blosc-
${
BLOSC_VERSION
}
\
&&
$cmake
-DCMAKE_INSTALL_PREFIX
=
$BUILD_PREFIX
.
\
&&
make
install
)
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
# Fix blosc library id bug
for
lib
in
$(
ls
${
BUILD_PREFIX
}
/lib/libblosc
*
.dylib
)
;
do
install_name_tool
-id
$lib
$lib
...
...
@@ -324,7 +324,7 @@ function build_lzf {
function
build_curl
{
if
[
-e
curl-stamp
]
;
then return
;
fi
local
flags
=
"--prefix=
$BUILD_PREFIX
"
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
flags
=
"
$flags
--with-darwinssl"
else
# manylinux
flags
=
"
$flags
--with-ssl"
...
...
@@ -332,7 +332,7 @@ function build_curl {
fi
fetch_unpack https://curl.haxx.se/download/curl-
${
CURL_VERSION
}
.tar.gz
(
cd
curl-
${
CURL_VERSION
}
\
&&
if
[
-z
"
$IS_OS
X
"
]
;
then
\
&&
if
[
-z
"
$IS_
MAC
OS
"
]
;
then
\
LIBS
=
-ldl
./configure
$flags
;
else
\
./configure
$flags
;
fi
\
&&
make
-j4
\
...
...
@@ -346,7 +346,7 @@ function check_sha256sum {
local
sha256
=
$2
if
[
-z
"
$sha256
"
]
;
then
echo
"Need SHA256 hash"
;
exit
1
;
fi
echo
"
${
sha256
}
${
fname
}
"
>
${
fname
}
.sha256
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
shasum
-a
256
-c
${
fname
}
.sha256
else
sha256sum
-c
${
fname
}
.sha256
...
...
@@ -383,7 +383,7 @@ function build_pcre {
function
build_swig
{
if
[
-e
swig-stamp
]
;
then return
;
fi
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
brew
install
swig
>
/dev/null
else
build_pcre
...
...
@@ -394,7 +394,7 @@ function build_swig {
function
build_suitesparse
{
if
[
-e
suitesparse-stamp
]
;
then return
;
fi
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
brew
install
suite-sparse
>
/dev/null
else
yum_install suitesparse-devel
>
/dev/null
...
...
@@ -408,7 +408,7 @@ function build_libtool {
function
build_ragel
{
local
htprefix
=
https
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
# Invalid certificate, when using macOS curl.
# https://security.stackexchange.com/questions/232445/https-connection-to-specific-sites-fail-with-curl-on-macos
# Cert will likely be removed by Safari update in due course.
...
...
@@ -481,7 +481,7 @@ function build_fftw {
function
build_cfitsio
{
if
[
-e
cfitsio-stamp
]
;
then return
;
fi
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
brew
install
cfitsio
else
# cannot use build_simple because cfitsio has no dash between name and version
...
...
tests/test_library_builders.sh
View file @
b274b9aa
...
...
@@ -3,7 +3,7 @@
# The environment
uname
-a
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
# Building on macOS
export
BUILD_PREFIX
=
"
${
PWD
}
/builds"
rm_mkdir
$BUILD_PREFIX
...
...
@@ -43,14 +43,14 @@ suppress build_lcms2
suppress ensure_xz
suppress build_freetype
suppress build_libyaml
if
[
-z
"
$IS_OS
X
"
]
;
then
if
[
-z
"
$IS_
MAC
OS
"
]
;
then
# Gives compiler conformance error on macOS Sierra:
# https://gist.github.com/5e20e137ea51fa8ca9fc443191f9d463
# https://gist.github.com/ad86c474f3c0b7ec74290bb13f9414af
suppress build_lzo
fi
suppress build_ragel
if
[
-z
"
$IS_OS
X
"
]
;
then
if
[
-z
"
$IS_
MAC
OS
"
]
;
then
# already installed in the macOS image, so `brew install cfitsio` fails
suppress build_cfitsio
fi
...
...
tests/test_multibuild.sh
View file @
b274b9aa
...
...
@@ -16,7 +16,7 @@ source tests/test_fill_submodule.sh
# make sure it is set via one of the mechanisms above
unset
PYTHON_EXE
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
source
osx_utils.sh
MB_PYTHON_OSX_VER
=
${
MB_PYTHON_OSX_VER
:-
$(
macpython_sdk_for_version
$MB_PYTHON_VERSION
)
}
PLAT
=
${
PLAT
:-
$(
macpython_arch_for_version
$MB_PYTHON_VERSION
)
}
...
...
@@ -32,7 +32,7 @@ else
fi
if
[
-n
"
$TEST_BUILDS
"
]
;
then
MB_PYTHON_VERSION
=
${
MB_PYTHON_VERSION
:-
3
.7
}
if
[
-n
"
$IS_OS
X
"
]
;
then
if
[
-n
"
$IS_
MAC
OS
"
]
;
then
# This checked in test_library_builders.
# Will be set automatically by docker call in build_multilinux below.
PYTHON_VERSION
=
${
MB_PYTHON_VERSION
}
...
...
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