diff --git a/.appveyor.yml b/.appveyor.yml index a27a5dd..8b13789 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,186 +1 @@ -# As config was originally based on an example by Olivier Grisel. Thanks! -# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml -clone_depth: 50 -# No reason for us to restrict the number concurrent jobs -max_jobs: 100 - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -environment: - global: - MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin - MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin - OPENBLAS_32: "https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-v0.3.7-win32-gcc_7_1_0.zip" - OPENBLAS_64: "https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-v0.3.7-win_amd64-gcc_7_1_0.zip" - - CYTHON_BUILD_DEP: Cython - TEST_MODE: fast - APPVEYOR_SAVE_CACHE_ON_ERROR: true - APPVEYOR_SKIP_FINALIZE_ON_EXIT: true - WHEELHOUSE_UPLOADER_USERNAME: travis-worker - WHEELHOUSE_UPLOADER_SECRET: - secure: - 9s0gdDGnNnTt7hvyNpn0/ZzOMGPdwPp2SewFTfGzYk7uI+rdAN9rFq2D1gAP4NQh - BUILD_COMMIT: e94cec800304a6a467cf90ce4e7d3e207770b4b4 - DAILY_COMMIT: master - - matrix: - - PYTHON: C:\Python36 - PYTHON_VERSION: 3.6 - PYTHON_ARCH: 32 - - - PYTHON: C:\Python36-x64 - PYTHON_VERSION: 3.6 - PYTHON_ARCH: 64 - - - PYTHON: C:\Python37 - PYTHON_VERSION: 3.7 - PYTHON_ARCH: 32 - - - PYTHON: C:\Python37-x64 - PYTHON_VERSION: 3.7 - PYTHON_ARCH: 64 - - - PYTHON: C:\Python38 - PYTHON_VERSION: 3.8 - PYTHON_ARCH: 32 - - - PYTHON: C:\Python38-x64 - PYTHON_VERSION: 3.8 - PYTHON_ARCH: 64 - - -init: - - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" - - "ECHO \"%APPVEYOR_SCHEDULED_BUILD%\"" - - ps: >- - if ($env:APPVEYOR_REPO_BRANCH -eq "master") { - $env:CONTAINER = "pre-release" - if ($env:DAILY_COMMIT) { $env:BUILD_COMMIT = $env:DAILY_COMMIT } - $env:NPY_RELAXED_STRIDES_DEBUG = 1 - } else { - $env:CONTAINER = "wheels" - $env:UPLOAD_ARGS = "--no-update-index" - } -install: - - cmd: echo "Filesystem root:" - - dir C:\ - - - echo "Installed SDKs:" - - dir "C:/Program Files/Microsoft SDKs/Windows" - - # Get needed submodules - - git submodule update --init - - # Install new Python if necessary - - ps: .\multibuild\install_python.ps1 - - # Prepend required Python to the PATH of this build (this cannot be - # done from inside the powershell script as it would require to restart - # the parent CMD process). - - SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% - - # Check that we have the expected version and architecture for Python - - python --version - - >- - python -c "import sys,platform,struct; - print(sys.platform, platform.machine(), struct.calcsize('P') * 8, )" - - # Download and install static "openblas.a" to PYTHON\lib - - ps: | - $PYTHON_ARCH = $env:PYTHON_ARCH - $PYTHON = $env:PYTHON - If ($PYTHON_ARCH -eq 32) { - $OPENBLAS = $env:OPENBLAS_32 - } Else { - $OPENBLAS = $env:OPENBLAS_64 - } - $clnt = new-object System.Net.WebClient - $file = "$(New-TemporaryFile).zip" - $tmpdir = New-TemporaryFile | %{ rm $_; mkdir $_ } - $destination = "$PYTHON\lib\openblas.a" - echo $file - echo $tmpdir - echo $OPENBLAS - $clnt.DownloadFile($OPENBLAS,$file) - Expand-Archive $file $tmpdir - rm $tmpdir\$PYTHON_ARCH\lib\*.dll.a - $lib = ls $tmpdir\$PYTHON_ARCH\lib\*.a | ForEach { ls $_ } | Select-Object -first 1 - echo $lib - cp $lib $destination - ls $destination - - # Upgrade to the latest pip, setuptools, and wheel. - - python -m pip install -U pip setuptools wheel - - # Install build requirements. - - pip install "%CYTHON_BUILD_DEP%" --install-option="--no-cython-compile" - -build_script: - - cd numpy - - git checkout %BUILD_COMMIT% - # Create _distributor_init.py - - cd .. - - python -c "import openblas_support; openblas_support.make_init('numpy/numpy')" - - cd numpy - # Append license text relevant for the built wheel - - type ..\LICENSE_win32.txt >> LICENSE.txt - - ps: | - $PYTHON_ARCH = $env:PYTHON_ARCH - If ($PYTHON_ARCH -eq 32) { - $MINGW = $env:MINGW_32 - } Else { - $MINGW = $env:MINGW_64 - } - $env:Path += ";$MINGW" - $env:NPY_NUM_BUILD_JOBS = "4" - - python setup.py bdist_wheel - - ps: | - # Upload artifact to Appveyor immediately after build - ls dist -r | Foreach-Object { - appveyor PushArtifact $_.FullName - pip install $_.FullName - } - -test_script: - - pip install pytest - - cd .. - - python check_license.py - - mkdir tmp_for_test - - cd tmp_for_test - - pytest --pyargs numpy - - cd .. - -after_test: - # Upload test results to Appveyor - - ps: | - If (Test-Path .\junit-results.xml) { - (new-object net.webclient).UploadFile( - "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", - (Resolve-Path .\junit-results.xml) - ) - } - $LastExitCode = 0 - # Remove old or huge cache files to hopefully not exceed the 1GB cache limit. - # - # If the cache limit is reached, the cache will not be updated (of not even - # created in the first run). So this is a trade of between keeping the cache - # current and having a cache at all. - # NB: This is done only `on_success` since the cache in uploaded only on - # success anyway. - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete - # Show size of cache - - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache" - -on_success: - # Upload the generated wheel package to Rackspace - - cd numpy - - pip install wheelhouse-uploader certifi - - python -m wheelhouse_uploader upload - --local-folder=dist - %UPLOAD_ARGS% - %CONTAINER% diff --git a/.travis.yml b/.travis.yml index 25702c6..ce5dadb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ env: - BUILD_COMMIT=e94cec800304a6a467cf90ce4e7d3e207770b4b4 - BUILD_DEPENDS=cython - TEST_DEPENDS=pytest - - PLAT=x86_64 - UNICODE_WIDTH=32 - WHEELHOUSE_UPLOADER_USERNAME=travis-worker # Following generated with @@ -19,9 +18,7 @@ env: language: python # Default Python version is usually 2.7 python: 3.6 -sudo: required dist: bionic -services: docker matrix: exclude: @@ -30,6 +27,7 @@ matrix: include: - os: linux env: + - PLAT=x86_64 - MB_PYTHON_VERSION=3.6 - os: linux env: @@ -37,6 +35,7 @@ matrix: - PLAT=i686 - os: linux env: + - PLAT=x86_64 - MB_PYTHON_VERSION=3.7 - os: linux env: @@ -44,6 +43,7 @@ matrix: - PLAT=i686 - os: linux env: + - PLAT=x86_64 - MB_PYTHON_VERSION=3.8 - os: linux env: @@ -53,20 +53,65 @@ matrix: language: generic osx_image: xcode10.1 env: + - PLAT=x86_64 - MB_PYTHON_VERSION=3.6 - MB_PYTHON_OSX_VER=10.9 - os: osx language: generic osx_image: xcode10.1 env: + - PLAT=x86_64 - MB_PYTHON_VERSION=3.7 - MB_PYTHON_OSX_VER=10.9 - os: osx language: generic osx_image: xcode10.1 env: + - PLAT=x86_64 - MB_PYTHON_VERSION=3.8 - MB_PYTHON_OSX_VER=10.9 + - os: linux + arch: arm64 + env: + - PLAT=aarch64 + - MB_ML_VER=2014 + - MB_PYTHON_VERSION=3.6 + - DEBUG_PRINT=1 + - os: linux + arch: s390x + env: + - PLAT=s390x + - MB_ML_VER=2014 + - MB_PYTHON_VERSION=3.6 + - DEBUG_PRINT=1 + - os: linux + arch: ppc64le + env: + - PLAT=ppc64le + - MB_ML_VER=2014 + - MB_PYTHON_VERSION=3.6 + - DEBUG_PRINT=1 + - os: linux + arch: arm64 + env: + - PLAT=aarch64 + - MB_ML_VER=2014 + - MB_PYTHON_VERSION=3.7 + - DEBUG_PRINT=1 + - os: linux + arch: s390x + env: + - PLAT=s390x + - MB_ML_VER=2014 + - MB_PYTHON_VERSION=3.7 + - DEBUG_PRINT=1 + - os: linux + arch: ppc64le + env: + - PLAT=ppc64le + - MB_ML_VER=2014 + - MB_PYTHON_VERSION=3.7 + - DEBUG_PRINT=1 before_install: - if [ "$TRAVIS_BRANCH" == "master" ]; then @@ -79,22 +124,13 @@ before_install: fi # Set DEBUG_PRINT environment variable in settings - if [ -n "${DEBUG_PRINT}" ]; then set -x; fi - - source multibuild/common_utils.sh - - source multibuild/travis_steps.sh - - before_install + - ./travis_before_install.sh install: - # Maybe get and clean and patch source - - clean_code $REPO_DIR $BUILD_COMMIT - - ./patch_code.sh $REPO_DIR - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - export CFLAGS=${CFLAGS}" -Wno-sign-compare -Wno-unused-result\ - -Wno-strict-aliasing"; - fi - - build_wheel $REPO_DIR $PLAT + - ./travis_install.sh script: - - install_run $PLAT + - ./travis_script.sh after_success: # Upload wheels to Rackspace container diff --git a/README.rst b/README.rst index 6c71b8e..e0728f7 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ The wheel-building repository: The resulting wheels are therefore self-contained and do not need any external dynamic libraries apart from those provided as standard by OSX / Linux as -defined by the manylinux1 standard. +defined by the manylinux standard. The ``.travis.yml`` file in this repository has a line containing the API key for the Rackspace container encrypted with an RSA key that is unique to the diff --git a/config.sh b/config.sh index 0329262..c83467e 100644 --- a/config.sh +++ b/config.sh @@ -8,6 +8,8 @@ function build_wheel { if [ -n "$IS_OSX" ]; then install_gfortran fi + echo gcc --version + echo `gcc --version` build_libs $lib_plat # Fix version error for development wheels by using bdist_wheel build_bdist_wheel $@ diff --git a/env_vars.sh b/env_vars.sh index 1ab836c..d7c019f 100644 --- a/env_vars.sh +++ b/env_vars.sh @@ -1,4 +1,6 @@ # Environment variables for build -OPENBLAS_VERSION="v0.3.7" +OPENBLAS_VERSION="v0.3.5-605-gc815b8fb" # the 0.3.5 is misleading, this is 0.3.8dev MACOSX_DEPLOYMENT_TARGET=10.9 -CFLAGS="-std=c99 -fno-strict-aliasing" +# For verbosity: report where each command came from +export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' +set -x diff --git a/gfortran-install b/gfortran-install index e9764d0..d430fe6 160000 --- a/gfortran-install +++ b/gfortran-install @@ -1 +1 @@ -Subproject commit e9764d0a8f4e3adcd385c319e7742177193484c7 +Subproject commit d430fe6e38b6c5149c53f775a4437964e2f7b883 diff --git a/multibuild b/multibuild index 0c4a992..b943f33 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 0c4a9920fa4635419fcea61f10d6dc0cd50e3639 +Subproject commit b943f33a92772fd52c2fa38c03d08aac974c53bd diff --git a/openblas_support.py b/openblas_support.py deleted file mode 100644 index 52d283a..0000000 --- a/openblas_support.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import textwrap - -def make_init(dirname): - ''' - Create a _distributor_init.py file for OpenBlas - ''' - with open(os.path.join(dirname, '_distributor_init.py'), 'wt') as fid: - fid.write(textwrap.dedent(""" - ''' - Helper to preload windows dlls to prevent dll not found errors. - Once a DLL is preloaded, its namespace is made available to any - subsequent DLL. This file originated in the numpy-wheels repo, - and is created as part of the scripts that build the wheel. - ''' - import os - from ctypes import WinDLL - import glob - if os.name == 'nt': - # convention for storing / loading the DLL from - # numpy/.libs/, if present - try: - basedir = os.path.dirname(__file__) - except: - pass - else: - libs_dir = os.path.abspath(os.path.join(basedir, '.libs')) - DLL_filenames = [] - if os.path.isdir(libs_dir): - for filename in glob.glob(os.path.join(libs_dir, - '*openblas*dll')): - # NOTE: would it change behavior to load ALL - # DLLs at this path vs. the name restriction? - WinDLL(os.path.abspath(filename)) - DLL_filenames.append(filename) - if len(DLL_filenames) > 1: - import warnings - warnings.warn("loaded more than 1 DLL from .libs:\\n%s" % - "\\n".join(DLL_filenames), - stacklevel=1) - """)) - diff --git a/travis_before_install.sh b/travis_before_install.sh new file mode 100755 index 0000000..ff4689e --- /dev/null +++ b/travis_before_install.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +source multibuild/common_utils.sh +source multibuild/travis_steps.sh +before_install + diff --git a/travis_install.sh b/travis_install.sh new file mode 100755 index 0000000..7e39026 --- /dev/null +++ b/travis_install.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +source multibuild/common_utils.sh +source multibuild/travis_steps.sh +# Maybe get and clean and patch source +clean_code $REPO_DIR $BUILD_COMMIT +./patch_code.sh $REPO_DIR +if [ "$TRAVIS_OS_NAME" == "linux" ]; then + export CFLAGS=${CFLAGS}" -Wno-sign-compare -Wno-unused-result\ + -Wno-strict-aliasing"; +fi +build_wheel $REPO_DIR $PLAT diff --git a/travis_script.sh b/travis_script.sh new file mode 100755 index 0000000..c6e15f8 --- /dev/null +++ b/travis_script.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source multibuild/common_utils.sh +source multibuild/travis_steps.sh +install_run $PLAT