This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
config.sh
61 lines (55 loc) · 1.96 KB
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Define custom utilities
# Test for OSX with [ -n "$IS_OSX" ]
# See env_vars.sh for extra environment variables
if [ $(uname) == "Linux" ]; then
IS_LINUX=1
! git config --global --add safe.directory /io/numpy
fi
source gfortran-install/gfortran_utils.sh
function _build_wheel {
build_libs
build_bdist_wheel $@
}
function build_wheel {
if [ -n "$IS_OSX" ]; then
install_gfortran
fi
echo gcc --version
echo `gcc --version`
# Fix version error for development wheels by using bdist_wheel
wrap_wheel_builder _build_wheel $@
}
function build_libs {
# setuptools v49.2.0 is broken
$PYTHON_EXE -mpip install --upgrade "setuptools<49.2.0"
# Use the same incantation as numpy/tools/travis-before-install.sh to
# download and un-tar the openblas libraries. The python call returns
# the un-tar root directory, then the files are copied into /usr/local.
# Could utilize a site.cfg instead to prevent the copy.
$PYTHON_EXE -mpip install urllib3
$PYTHON_EXE -c"import platform; print('platform.uname().machine', platform.uname().machine)"
basedir=$($PYTHON_EXE numpy/tools/openblas_support.py)
$use_sudo cp -r $basedir/lib/* $BUILD_PREFIX/lib
$use_sudo cp $basedir/include/* $BUILD_PREFIX/include
export OPENBLAS=$BUILD_PREFIX
}
function get_test_cmd {
local extra_argv=${1:-$EXTRA_ARGV}
echo "import sys; import numpy; \
sys.exit(not numpy.test('full', \
extra_argv=['-vv', ${extra_argv}]))"
}
function run_tests {
# Runs tests on installed distribution from an empty directory
if [ -n "$IS_LINUX" ]; then
apt-get -y update && apt-get install -y gfortran
fi
$PYTHON_EXE -c "$(get_test_cmd)"
# Check bundled license file
$PYTHON_EXE ../check_license.py
# Test BLAS / LAPACK used
if [ -n "$IS_LINUX" -o -n "$IS_OSX" ]; then
$PYTHON_EXE ../numpy/tools/openblas_support.py --check_version
fi
$PYTHON_EXE -c 'import numpy; numpy.show_config()'
}