summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-04-20 22:39:24 +0300
committermattip <matti.picus@gmail.com>2019-04-21 11:07:01 +0300
commitf402a691a9c99e0ba2e090d4f8269ea81aac1a50 (patch)
tree5b3a1991f9ff5820e1a392fefe87a9646ef88c66
parenta641ef245a9f8d320fac5cdea5632649db5fab4a (diff)
downloadnumpy-f402a691a9c99e0ba2e090d4f8269ea81aac1a50.tar.gz
MAINT: use openblas, gfortran, tweak azure and comment mro (from review)
-rw-r--r--.gitignore2
-rw-r--r--azure-pipelines.yml2
-rw-r--r--numpy/core/_internal.py2
-rwxr-xr-xtools/pypy-test.sh52
4 files changed, 52 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index e706ad680..a31d6ea44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -176,5 +176,3 @@ benchmarks/numpy
cythonize.dat
numpy/random/mtrand/mtrand.c
numpy/random/mtrand/randint_helpers.pxi
-# CI run of PyPy
-pypy3
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 31e548360..94c4158e2 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -217,7 +217,9 @@ jobs:
steps:
- script: source tools/pypy-test.sh
displayName: 'Run PyPy3 Build / Tests'
+ continueOnError: true
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for PyPy3'
+ failTaskOnFailedTests: true
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 1100fbf0e..ab5a64a1a 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -869,8 +869,10 @@ def npy_ctypes_check(cls):
# ctypes class are new-style, so have an __mro__. This probably fails
# for ctypes classes with multiple inheritance.
if IS_PYPY:
+ # (..., _ctypes.basics._CData, Bufferable, object)
ctype_base = cls.__mro__[-3]
else:
+ # # (..., _ctypes._CData, object)
ctype_base = cls.__mro__[-2]
# right now, they're part of the _ctypes module
return 'ctypes' in ctype_base.__module__
diff --git a/tools/pypy-test.sh b/tools/pypy-test.sh
index 3dd3b439f..61a09cd85 100755
--- a/tools/pypy-test.sh
+++ b/tools/pypy-test.sh
@@ -1,15 +1,59 @@
#!/usr/bin/env bash
-apt-get -yq update
-apt-get -yq install libatlas-dev libatlas-base-dev liblapack-dev
-wget http://buildbot.pypy.org/nightly/py3.6/pypy-c-jit-latest-linux64.tar.bz2 -O pypy.tar.bz2
+# Exit if a command fails
+set -e
+set -o pipefail
+# Print expanded commands
+set -x
+
+sudo apt-get -yq update
+sudo apt-get -yq install libatlas-base-dev liblapack-dev gfortran-5
+F77=gfortran-5 F90=gfortran-5 \
+
+# Download the proper OpenBLAS x64 precompiled library
+OPENBLAS=openblas-v0.3.5-manylinux1_x86_64.tar.gz
+echo getting $OPENBLAS
+wget -q https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/$OPENBLAS -O openblas.tar.gz
+mkdir -p openblas
+(cd openblas; tar -xf ../openblas.tar.gz)
+export LD_LIBRARY_PATH=$PWD/openblas/usr/local/lib
+export LIB=$PWD/openblas/usr/local/lib
+export INCLUDE=$PWD/openblas/usr/local/include
+
+# Use a site.cfg to build with local openblas
+cat << EOF > site.cfg
+[openblas]
+libraries = openblas
+library_dirs = $PWD/openblas/usr/local/lib:$LIB
+include_dirs = $PWD/openblas/usr/local/lib:$LIB
+runtime_library_dirs = $PWD/openblas/usr/local/lib
+EOF
+
+echo getting PyPy 3.6 nightly
+wget -q http://buildbot.pypy.org/nightly/py3.6/pypy-c-jit-latest-linux64.tar.bz2 -O pypy.tar.bz2
mkdir -p pypy3
(cd pypy3; tar --strip-components=1 -xf ../pypy.tar.bz2)
pypy3/bin/pypy3 -mensurepip
pypy3/bin/pypy3 -m pip install --upgrade pip setuptools
pypy3/bin/pypy3 -m pip install --user cython==0.29.0 pytest pytz --no-warn-script-location
+
echo
echo pypy3 version
pypy3/bin/pypy3 -c "import sys; print(sys.version)"
echo
-pypy3/bin/pypy3 runtests.py -- -rsx --junitxml=junit/test-results.xml --durations 10
+
+pypy3/bin/pypy3 runtests.py --show-build-log -- -rsx \
+ --junitxml=junit/test-results.xml --durations 10
+
+echo Make sure the correct openblas has been linked in
+# rework after merging PR #12790 or alternative
+TEST_GET_CONFIG="import numpy, ctypes, os
+dll = ctypes.CDLL(numpy.core._multiarray_umath.__file__)
+get_config = dll.openblas_get_config
+get_config.restype=ctypes.c_char_p
+res = get_config()
+print('OpenBLAS get_config returned', str(res))
+assert b'OpenBLAS 0.3.5' in res"
+
+pypy3/bin/pip install .
+(cd pypy3; bin/pypy3 -c "$TEST_GET_CONFIG")