diff options
author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2020-01-19 18:05:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-19 18:05:10 -0700 |
commit | a16dfb5b397718c5caf32c63f024d1ce3518c5a1 (patch) | |
tree | ea250782aedf825daaabfe05e1645d81bd6645ef | |
parent | eee751e74803c894b39a62d5843334762f53ed6f (diff) | |
parent | 1edb44669f9acddebd92df794ca9731fd92f4e06 (diff) | |
download | numpy-a16dfb5b397718c5caf32c63f024d1ce3518c5a1.tar.gz |
Merge pull request #15279 from mattip/openblas
BUILD: use standard build of OpenBLAS for aarch64, ppc64le, s390x
-rw-r--r-- | .travis.yml | 19 | ||||
-rw-r--r-- | azure-pipelines.yml | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/einsum.c.src | 8 | ||||
-rw-r--r-- | numpy/fft/_pocketfft.c | 10 | ||||
-rw-r--r-- | numpy/random/src/distributions/random_mvhg_count.c | 2 | ||||
-rw-r--r-- | numpy/random/src/distributions/random_mvhg_marginals.c | 2 | ||||
-rw-r--r-- | shippable.yml | 7 | ||||
-rw-r--r-- | tools/openblas_support.py | 38 | ||||
-rwxr-xr-x | tools/travis-before-install.sh | 1 |
9 files changed, 48 insertions, 41 deletions
diff --git a/.travis.yml b/.travis.yml index 73106b4c1..84fdbb8f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: python group: travis_latest os: linux -dist: xenial +dist: bionic # Travis whitelists the installable packages, additions can be requested # https://github.com/travis-ci/apt-package-whitelist @@ -11,6 +11,8 @@ addons: apt: packages: &common_packages - gfortran + - libgfortran5 + - libgfortran3 - libatlas-base-dev # Speedup builds, particularly when USE_CHROOT=1 - eatmydata @@ -27,7 +29,7 @@ stages: env: global: - - OpenBLAS_version=0.3.7 + - OpenBLAS_version=0.3.8 - WHEELHOUSE_UPLOADER_USERNAME=travis.numpy # The following is generated with the command: # travis encrypt -r numpy/numpy WHEELHOUSE_UPLOADER_SECRET=tH3AP1KeY @@ -47,7 +49,6 @@ jobs: - python: 3.7 - python: 3.6 - dist: bionic env: USE_DEBUG=1 addons: apt: @@ -86,6 +87,8 @@ jobs: packages: - gfortran - eatmydata + - libgfortran5 + - libgfortran3 - python: 3.7 env: USE_WHEEL=1 NPY_RELAXED_STRIDES_DEBUG=1 @@ -112,8 +115,18 @@ jobs: arch: s390x env: # use s390x OpenBLAS build, not system ATLAS + - DOWNLOAD_OPENBLAS=1 - ATLAS=None + - python: 3.7 + os: linux + arch: aarch64 + env: + # use ppc64le OpenBLAS build, not system ATLAS + - DOWNLOAD_OPENBLAS=1 + - ATLAS=None + + before_install: - ./tools/travis-before-install.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9a8acc9c1..7bd7a1e1f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,7 +8,7 @@ trigger: variables: # OpenBLAS_version should be updated # to match numpy-wheels repo - OpenBLAS_version: 0.3.7 + OpenBLAS_version: 0.3.8 stages: - stage: InitialTests diff --git a/numpy/core/src/multiarray/einsum.c.src b/numpy/core/src/multiarray/einsum.c.src index 70af3fef9..1cc557825 100644 --- a/numpy/core/src/multiarray/einsum.c.src +++ b/numpy/core/src/multiarray/einsum.c.src @@ -2152,6 +2152,11 @@ get_combined_dims_view(PyArrayObject *op, int iop, char *labels) } /* A repeated label, find the original one and merge them. */ else { +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif int i = icombinemap[idim + label]; icombinemap[idim] = -1; @@ -2164,6 +2169,9 @@ get_combined_dims_view(PyArrayObject *op, int iop, char *labels) return NULL; } new_strides[i] += stride; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif } } diff --git a/numpy/fft/_pocketfft.c b/numpy/fft/_pocketfft.c index de86e36d3..764116a84 100644 --- a/numpy/fft/_pocketfft.c +++ b/numpy/fft/_pocketfft.c @@ -10,6 +10,11 @@ * \author Martin Reinecke */ +#define NPY_NO_DEPRECATED_API NPY_API_VERSION + +#include "Python.h" +#include "numpy/arrayobject.h" + #include <math.h> #include <string.h> #include <stdlib.h> @@ -2184,11 +2189,6 @@ WARN_UNUSED_RESULT static int rfft_forward(rfft_plan plan, double c[], double fc return rfftblue_forward(plan->blueplan,c,fct); } -#define NPY_NO_DEPRECATED_API NPY_API_VERSION - -#include "Python.h" -#include "numpy/arrayobject.h" - static PyObject * execute_complex(PyObject *a1, int is_forward, double fct) { diff --git a/numpy/random/src/distributions/random_mvhg_count.c b/numpy/random/src/distributions/random_mvhg_count.c index 7cbed1f9e..1d4ed978e 100644 --- a/numpy/random/src/distributions/random_mvhg_count.c +++ b/numpy/random/src/distributions/random_mvhg_count.c @@ -1,8 +1,8 @@ +#include "numpy/random/distributions.h" #include <stdint.h> #include <stdlib.h> #include <stdbool.h> -#include "numpy/random/distributions.h" /* * random_multivariate_hypergeometric_count diff --git a/numpy/random/src/distributions/random_mvhg_marginals.c b/numpy/random/src/distributions/random_mvhg_marginals.c index 809d129de..689a85671 100644 --- a/numpy/random/src/distributions/random_mvhg_marginals.c +++ b/numpy/random/src/distributions/random_mvhg_marginals.c @@ -1,9 +1,9 @@ +#include "numpy/random/distributions.h" #include <stdint.h> #include <stddef.h> #include <stdbool.h> #include <math.h> -#include "numpy/random/distributions.h" #include "logfactorial.h" diff --git a/shippable.yml b/shippable.yml index 4313a6de2..bea2a2206 100644 --- a/shippable.yml +++ b/shippable.yml @@ -21,9 +21,10 @@ runtime: build: ci: - # install dependencies + # install dependencies and newer toolchain for gfortran5 + - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - - sudo apt-get install gcc gfortran + - sudo apt-get install gcc gfortran libgfortran5 - target=$(python tools/openblas_support.py) - ls -lR "${target}" - sudo cp -r "${target}"/lib/* /usr/lib @@ -48,7 +49,7 @@ build: - extra_path=$(printf "%s:" "${extra_directories[@]}") - export PATH="${extra_path}${PATH}" # check OpenBLAS version - - python tools/openblas_support.py --check_version 0.3.7 + - python tools/openblas_support.py --check_version 0.3.8 # run the test suite - python runtests.py -n --debug-info --show-build-log -- -rsx --junit-xml=$SHIPPABLE_REPO_DIR/shippable/testresults/tests.xml -n 2 --durations=10 diff --git a/tools/openblas_support.py b/tools/openblas_support.py index 2c1b70d6f..3708033d3 100644 --- a/tools/openblas_support.py +++ b/tools/openblas_support.py @@ -15,11 +15,11 @@ from tempfile import mkstemp, gettempdir import zipfile import tarfile -OPENBLAS_V = 'v0.3.7' -OPENBLAS_LONG = 'v0.3.7' +OPENBLAS_V = 'v0.3.8' +OPENBLAS_LONG = 'v0.3.5-605-gc815b8fb' # the 0.3.5 is misleading BASE_LOC = '' RACKSPACE = 'https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com' -ARCHITECTURES = ['', 'windows', 'darwin', 'arm', 'x86', 'ppc64'] +ARCHITECTURES = ['', 'windows', 'darwin', 'aarch64', 'x86', 'ppc64le', 's390x'] IS_32BIT = sys.maxsize < 2**32 def get_arch(): @@ -27,17 +27,12 @@ def get_arch(): ret = 'windows' elif platform.system() == 'Darwin': ret = 'darwin' - # Python3 returns a named tuple, but Python2 does not, so we are stuck - elif 'arm' in os.uname()[-1]: - ret = 'arm'; - elif 'aarch64' in os.uname()[-1]: - ret = 'arm'; - elif 'x86' in os.uname()[-1]: + elif 'x86' in platform.uname().machine: + # What do 32 bit machines report? + # If they are a docker, they report x86_64 ret = 'x86' - elif 'ppc64' in os.uname()[-1]: - ret = 'ppc64' else: - ret = '' + ret = platform.uname().machine assert ret in ARCHITECTURES return ret @@ -51,21 +46,10 @@ def get_ilp64(): def download_openblas(target, arch, ilp64): fnsuffix = {None: "", "64_": "64_"}[ilp64] filename = '' - if arch == 'arm': - # ARMv8 OpenBLAS built using script available here: - # https://github.com/tylerjereddy/openblas-static-gcc/tree/master/ARMv8 - # build done on GCC compile farm machine named gcc115 - # tarball uploaded manually to an unshared Dropbox location - filename = ('https://www.dropbox.com/s/vdeckao4omss187/' - 'openblas{}-{}-armv8.tar.gz?dl=1'.format(fnsuffix, OPENBLAS_V)) + if arch in ('aarch64', 'ppc64le', 's390x'): + filename = '{0}/openblas{1}-{2}-manylinux2014_{3}.tar.gz'.format( + RACKSPACE, fnsuffix, OPENBLAS_LONG, arch) typ = 'tar.gz' - elif arch == 'ppc64': - # build script for POWER8 OpenBLAS available here: - # https://github.com/tylerjereddy/openblas-static-gcc/blob/master/power8 - # built on GCC compile farm machine named gcc112 - # manually uploaded tarball to an unshared Dropbox location - filename = ('https://www.dropbox.com/s/yt0d2j86x1j8nh1/' - 'openblas{}-{}-ppc64le-power8.tar.gz?dl=1'.format(fnsuffix, OPENBLAS_V)) typ = 'tar.gz' elif arch == 'darwin': filename = '{0}/openblas{1}-{2}-macosx_10_9_x86_64-gf_1becaaa.tar.gz'.format( @@ -78,7 +62,7 @@ def download_openblas(target, arch, ilp64): suffix = 'win_amd64-gcc_7_1_0.zip' filename = '{0}/openblas{1}-{2}-{3}'.format(RACKSPACE, fnsuffix, OPENBLAS_LONG, suffix) typ = 'zip' - elif arch == 'x86': + elif 'x86' in arch: if IS_32BIT: suffix = 'manylinux1_i686.tar.gz' else: diff --git a/tools/travis-before-install.sh b/tools/travis-before-install.sh index 8be8afb10..f53d18611 100755 --- a/tools/travis-before-install.sh +++ b/tools/travis-before-install.sh @@ -33,6 +33,7 @@ fi source venv/bin/activate python -V +gcc --version popd |