Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

WIP: add aarch64, ppc64le, x390x wheels; change build slightly #70

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 0 additions & 185 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -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')"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, there is someone using openblas_support. This should be using the openblas_support from numpy/tools and not a local copy. I think I did it this way since we were building wheels before numpy/tools/openblas_support.py existed, but now we can fix this correctly

- 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%
66 changes: 51 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -30,20 +27,23 @@ matrix:
include:
- os: linux
env:
- PLAT=x86_64
- MB_PYTHON_VERSION=3.6
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
- os: linux
env:
- PLAT=x86_64
- MB_PYTHON_VERSION=3.7
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- PLAT=i686
- os: linux
env:
- PLAT=x86_64
- MB_PYTHON_VERSION=3.8
- os: linux
env:
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
Expand Down
6 changes: 4 additions & 2 deletions env_vars.sh
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the log output quite verbose: it should show for every shell command the file/line/function name used

2 changes: 1 addition & 1 deletion gfortran-install
42 changes: 0 additions & 42 deletions openblas_support.py

This file was deleted.

Loading