8000 Merge pull request #4 from xoviat/openblas · MacPython/numpy-wheels@43b97b4 · GitHub
[go: up one dir, main page]

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

Commit 43b97b4

Browse files
authored
Merge pull request #4 from xoviat/openblas
CI: build with OpenBLAS
2 parents 6ad6dbd + 31bdd33 commit 43b97b4

File tree

1 file changed

+138
-56
lines changed

1 file changed

+138
-56
lines changed

appveyor.yml

Lines changed: 138 additions & 56 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,68 @@
1-
# vim ft=yaml
2-
# CI on Windows via appveyor
3-
# Largely from:
1+
# As config was originally based on an example by Olivier Grisel. Thanks!
42
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
3+
clone_depth: 50
54

6-
os: Visual Studio 2015
5+
# No reason for us to restrict the number concurrent jobs
6+
max_jobs: 100
7+
8+
cache:
9+
- '%LOCALAPPDATA%\pip\Cache'
710

811
environment:
9-
global:
10-
BUILD_COMMIT: v1.13.0rc2
11-
OPENBLAS_COMMIT: 5f998ef_mingwpy
12-
OPENBLAS_ROOT: c:\opt
12+
global:
13+
MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
14+
MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
15+
OPENBLAS_32: https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win32.zip
16+
OPENBLAS_64: https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win64.zip
17+
OPENBLAS_32_SHA256: 0a12804b08d475179a0411936f509b44d7512f084b4a81c2fa3abe8c9ac4ee09
18+
OPENBLAS_64_SHA256: 8f11d8a5a79795a3a1ccb2326c979a0ca426e623eee93f8e35239e3c21e62cd6
19+
CYTHON_BUILD_DEP: Cython==0.26.1
20+
TEST_MODE: fast
21+
APPVEYOR_SAVE_CACHE_ON_ERROR: true
22+
APPVEYOR_SKIP_FINALIZE_ON_EXIT: true
1323
WHEELHOUSE_UPLOADER_USERNAME: travis-worker
1424
WHEELHOUSE_UPLOADER_SECRET:
1525
secure:
1626
9s0gdDGnNnTt7hvyNpn0/ZzOMGPdwPp2SewFTfGzYk7uI+rdAN9rFq2D1gAP4NQh
27+
BUILD_COMMIT: d05fd3032cccabf5ed18840b43513a73499af5d6
1728
DAILY_COMMIT: master
1829

19-
matrix:
30+
matrix:
31+
- PYTHON: C:\Python36
32+
PYTHON_VERSION: 3.6
33+
PYTHON_ARCH: 32
2034

21-
- PYTHON: "C:\\Python27"
22-
- PYTHON: "C:\\Python27-x64"
23-
- PYTHON: "C:\\Python34"
24-
- PYTHON: "C:\\Python34-x64"
25-
- PYTHON: "C:\\Python35"
26-
- PYTHON: "C:\\Python35-x64"
27-
- PYTHON: "C:\\Python36"
28-
- PYTHON: "C:\\Python36-x64"
35+
- PYTHON: C:\Python36-x64
36+
PYTHON_VERSION: 3.6
37+
PYTHON_ARCH: 64
2938

30-
install:
39+
- PYTHON: C:\Python35
40+
PYTHON_VERSION: 3.5
41+
PYTHON_ARCH: 32
42+
43+
- PYTHON: C:\Python35-x64
44+
PYTHON_VERSION: 3.5
45+
PYTHON_ARCH: 64
46+
47+
- PYTHON: C:\Python34
48+
PYTHON_VERSION: 3.4
49+
PYTHON_ARCH: 32
50+
51+
- PYTHON: C:\Python34-x64
52+
PYTHON_VERSION: 3.4
53+
PYTHON_ARCH: 64
54+
55+
- PYTHON: C:\Python27
56+
PYTHON_VERSION: 2.7
57+
PYTHON_ARCH: 32
58+
59+
- PYTHON: C:\Python27-x64
60+
PYTHON_VERSION: 2.7
61+
PYTHON_ARCH: 64
62+
63+
init:
64+
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
65+
- "ECHO \"%APPVEYOR_SCHEDULED_BUILD%\""
3166
- ps: >-
3267
if ($env:APPVEYOR_REPO_BRANCH -eq "daily") {
3368
$env:CONTAINER = "pre-release"
@@ -37,72 +72,119 @@ install:
3772
$env:CONTAINER = "wheels"
3873
$env:UPLOAD_ARGS = "--no-update-index"
3974
}
75+
install:
4076
- cmd: echo "Filesystem root:"
4177
- dir C:\
4278

4379
- echo "Installed SDKs:"
4480
- dir "C:/Program Files/Microsoft SDKs/Windows"
4581

46-
# Get needed submodules
47-
- git submodule update --init
48-
49-
# Install Python 3.6.2 if necessary
50-
- ps: .\windows-wheel-builder\install_python362.ps1
51-
5282
# Prepend newly installed Python to the PATH of this build (this cannot be
5383
# done from inside the powershell script as it would require to restart
5484
# the parent CMD process).
55-
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
56-
57-
# Get Python bitness
58-
# https://stackoverflow.com/questions/1746475/windows-batch-help-in-setting-a-variable-from-command-output#4509885
59-
- set PY_CMD=python -c "import platform; print(platform.architecture()[0][:2])"
60-
- for /f "tokens=1 delims=" %%i in ('%PY_CMD%') do set PYTHON_ARCH=%%i
61-
62-
# Fix MSVC builds for 64-bit Python
63-
# See
64-
# http://stackoverflow.com/questions/32091593/cannot-install-windows-sdk-7-1-on-windows-10
65-
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64/vcvars64.bat"
85+
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
6686

6787
# Check that we have the expected version and architecture for Python
6888
- python --version
69-
- python -c "import struct; print(struct.calcsize('P') * 8)"
89+
- >-
90+
python -c "import sys,platform,struct;
91+
print(sys.platform, platform.machine(), struct.calcsize('P') * 8, )"
92+
# Get needed submodules
93+
- git submodule update --init
94+
95+
# Download and install static "openblas.a" to PYTHON\lib
96+
- ps: |
97+
$PYTHON_ARCH = $env:PYTHON_ARCH
98+
$PYTHON = $env:PYTHON
99+
If ($PYTHON_ARCH -eq 32) {
100+
$OPENBLAS = $env:OPENBLAS_32
101+
$OPENBLAS_SHA256 = $env:OPENBLAS_32_SHA256
102+
} Else {
103+
$OPENBLAS = $env:OPENBLAS_64
104+
$OPENBLAS_SHA256 = $env:OPENBLAS_64_SHA256
105+
}
106+
$clnt = new-object System.Net.WebClient
107+
$file = "$(New-TemporaryFile).zip"
108+
$tmpdir = New-TemporaryFile | %{ rm $_; mkdir $_ }
109+
$destination = "$PYTHON\lib\openblas.a"
110+
echo $file
111+
echo $tmpdir
112+
echo $OPENBLAS
113+
$clnt.DownloadFile($OPENBLAS,$file)
114+
$downloaded_hash = Get-FileHash -Algorithm SHA256 $file
115+
if ($downloaded_hash.hash -ne $OPENBLAS_SHA256) {
116+
$downloaded_hash | Format-List
117+
echo $OPENBLAS_SHA256
118+
throw "Downloaded OPENBLAS zip SHA256 does not match."
119+
}
120+
Expand-Archive $file $tmpdir
121+
rm $tmpdir\$PYTHON_ARCH\lib\*.dll.a
122+
$lib = ls $tmpdir\$PYTHON_ARCH\lib\*.a | ForEach { ls $_ } | Select-Object -first 1
123+
echo $lib
124+
cp $lib $destination
125+
ls $destination
126+
# Upgrade to the latest pip and setuptools.
127+
- python -m pip install -U pip setuptools
70128

71-
# Install requirements
72-
- pip install -r windows-wheel-builder\requirements.txt
73-
- python -m pip install --upgrade pip
74129
# Pin wheel to 0.26 to avoid Windows ABI tag for built wheel
75-
- pip install wheel==0.26
76-
- pip install "cython>=0.25"
77-
# Download built openblas libraries
78-
- cmd /c windows-wheel-builder\unpack_openblas.bat
130+
- pip install "wheel==0.26"
131+
132+
# Install build requirements.
133+
- pip install "%CYTHON_BUILD_DEP%"
79134

80135
build_script:
81-
# Build and install the wheel
82136
- cd numpy
83137
- git checkout %BUILD_COMMIT%
84-
- python ..\windows-wheel-builder\build_numpy.py . %PYTHON_ARCH% %OPENBLAS_ROOT%
85-
- cd dist
86-
- pip install --pre --no-index -f . numpy
87-
- pip install nose
138+
- ps: |
139+
$PYTHON_ARCH = $env:PYTHON_ARCH
140+
If ($PYTHON_ARCH -eq 32) {
141+
$MINGW = $env:MINGW_32
142+
} Else {
143+
$MINGW = $env:MINGW_64
144+
}
145+
$env:Path += ";$MINGW"
146+
$env:NPY_NUM_BUILD_JOBS = "4"
147+
- python setup.py bdist_wheel
148+
- ps: |
149+
# Upload artifact to Appveyor immediately after build
150+
ls dist -r | Foreach-Object {
151+
appveyor PushArtifact $_.FullName
152+
pip install $_.FullName
153+
}
88154
89155
test_script:
90-
# Run the project tests
91-
- python -c "import numpy; numpy.test(verbose=3)"
156+
- pip install nose
92157
- cd ..
158+
- python -c "import numpy; numpy.test(verbose=3)"
93159

94160
after_test:
95-
# If tests are successful, create binary packages for the project.
96-
- dir dist
97-
98-
artifacts:
99-
# Archive the generated packages in the ci.appveyor.com build report.
100-
- path: numpy\dist\*.*
161+
# Upload test results to Appveyor
162+
- ps: |
163+
If (Test-Path .\junit-results.xml) {
164+
(new-object net.webclient).UploadFile(
165+
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
166+
(Resolve-Path .\junit-results.xml)
167+
)
168+
}
169+
$LastExitCode = 0
170+
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
171+
#
172+
# If the cache limit is reached, the cache will not be updated (of not even
173+
# created in the first run). So this is a trade of between keeping the cache
174+
# current and having a cache at all.
175+
# NB: This is done only `on_success` since the cache in uploaded only on
176+
# success anyway.
177+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
178+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
179+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
180+
# Show size of cache
181+
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"
101182

102183
on_success:
103184
# Upload the generated wheel package to Rackspace
104185
# On Windows, Apache Libcloud cannot find a standard CA cert bundle so we
105186
# disable the ssl checks.
187+
- cd numpy
106188
- pip install wheelhouse-uploader
107189
- python -m wheelhouse_uploader upload
108190
--no-ssl-check --local-folder=dist

0 commit comments

Comments
 (0)
0