Skip to content

Commit 37878bf

Browse files
committed
TST: appveyor: Enable OpenBLAS via MinGW Gfortran
1 parent d6d7278 commit 37878bf

File tree

2 files changed

+176
-19
lines changed

2 files changed

+176
-19
lines changed

appveyor.yml

Lines changed: 170 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,181 @@
1-
skip_tags: true
2-
clone_depth: 1
1+
# As config was originally based on an example by Olivier Grisel. Thanks!
2+
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
3+
clone_depth: 50
34

4-
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'
510

611
environment:
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+
APPVEYOR_SAVE_CACHE_ON_ERROR: true
18+
APPVEYOR_SKIP_FINALIZE_ON_EXIT: true
19+
TEST_TIMEOUT: 1000
20+
721
matrix:
8-
- PY_MAJOR_VER: 2
9-
PYTHON_ARCH: "x86"
10-
- PY_MAJOR_VER: 3
11-
PYTHON_ARCH: "x86_64"
12-
- PY_MAJOR_VER: 3
13-
PYTHON_ARCH: "x86"
22+
- PYTHON: C:\Python36
23+
PYTHON_VERSION: 3.6
24+
PYTHON_ARCH: 32
25+
TEST_MODE: fast
1426

15-
build_script:
16-
# If there's a newer build queued for the same PR, cancel this one
27+
- PYTHON: C:\Python27-x64
28+
PYTHON_VERSION: 2.7
29+
PYTHON_ARCH: 64
30+
TEST_MODE: fast
31+
32+
- PYTHON: C:\Python34-x64
33+
PYTHON_VERSION: 3.4
34+
PYTHON_ARCH: 64
35+
TEST_MODE: fast
36+
37+
- PYTHON: C:\Python36-x64
38+
PYTHON_VERSION: 3.6
39+
PYTHON_ARCH: 64
40+
TEST_MODE: full
41+
42+
- PYTHON: C:\Python27
43+
PYTHON_VERSION: 2.7
44+
PYTHON_ARCH: 32
45+
SKIP_NOTAG: true
46+
TEST_MODE: full
47+
48+
- PYTHON: C:\Python34
49+
PYTHON_VERSION: 3.4
50+
PYTHON_ARCH: 32
51+
SKIP_NOTAG: true
52+
TEST_MODE: full
53+
54+
- PYTHON: C:\Python35-x64
55+
PYTHON_VERSION: 3.5
56+
PYTHON_ARCH: 64
57+
SKIP_NOTAG: true
58+
TEST_MODE: full
59+
60+
- PYTHON: C:\Python35
61+
PYTHON_VERSION: 3.5
62+
PYTHON_ARCH: 32
63+
SKIP_NOTAG: true
64+
TEST_MODE: full
65+
66+
init:
67+
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
68+
- "ECHO \"%APPVEYOR_SCHEDULED_BUILD%\""
69+
# If there is a newer build queued for the same PR, cancel this one.
70+
# The AppVeyor 'rollout builds' option is supposed to serve the same
71+
# purpose but it is problematic because it tends to cancel builds pushed
72+
# directly to master instead of just PR builds (or the converse).
73+
# credits: JuliaLang developers.
1774
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
1875
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
1976
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
20-
throw "There are newer queued builds for this pull request, failing early." }
21-
- ps: Start-FileDownload "https://repo.continuum.io/miniconda/Miniconda$env:PY_MAJOR_VER-latest-Windows-$env:PYTHON_ARCH.exe" C:\Miniconda.exe; echo "Finished downloading miniconda"
22-
- cmd: C:\Miniconda.exe /S /D=C:\Py
23-
- SET PATH=C:\Py;C:\Py\Scripts;C:\Py\Library\bin;%PATH%
24-
- conda config --set always_yes yes
25-
- conda update conda
26-
- conda install cython nose pytz
27-
- pip install . -vvv
77+
Write-Host "There are newer queued builds for this pull request, skipping build."
78+
Exit-AppveyorBuild
79+
}
80+
- ps: |
81+
If (($env:SKIP_NOTAG -eq "true") -and ($env:APPVEYOR_REPO_TAG -ne "true")) {
82+
Write-Host "Skipping build, not at a tag."
83+
Exit-AppveyorBuild
84+
}
85+
86+
install:
87+
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"
88+
# Prepend newly installed Python to the PATH of this build (this cannot be
89+
# done from inside the powershell script as it would require to restart
90+
# the parent CMD process).
91+
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
92+
93+
# Check that we have the expected version and architecture for Python
94+
- python --version
95+
- >-
96+
%CMD_IN_ENV%
97+
python -c "import sys,platform,struct;
98+
print(sys.platform, platform.machine(), struct.calcsize('P') * 8, )"
99+
100+
# Install the BLAS library
101+
# - install "openblas.lib" to PYTHON\lib
102+
# - install OpenBLAS.dll to MINGW\bin
103+
- ps: |
104+
$PYTHON_ARCH = $env:PYTHON_ARCH
105+
$PYTHON = $env:PYTHON
106+
If ($PYTHON_ARCH -eq 32) {
107+
$OPENBLAS = $env:OPENBLAS_32
108+
} Else {
109+
$OPENBLAS = $env:OPENBLAS_64
110+
}
111+
$clnt = new-object System.Net.WebClient
112+
$file = "$(New-TemporaryFile).zip"
113+
$tmpdir = New-TemporaryFile | %{ rm $_; mkdir $_ }
114+
$destination = "$PYTHON\lib\openblas.a"
115+
116+
echo $file
117+
echo $tmpdir
118+
echo $OPENBLAS
119+
120+
$clnt.DownloadFile($OPENBLAS,$file)
121+
Get-FileHash $file | Format-List
122+
123+
Expand-Archive $file $tmpdir
124+
125+
rm $tmpdir\$PYTHON_ARCH\lib\*.dll.a
126+
$lib = ls $tmpdir\$PYTHON_ARCH\lib\*.a | ForEach { ls $_ } | Select-Object -first 1
127+
echo $lib
128+
129+
cp $lib $destination
130+
ls $destination
131+
132+
# Upgrade to the latest pip.
133+
- '%CMD_IN_ENV% python -m pip install -U pip setuptools wheel'
134+
135+
# Install the scipy test dependencies.
136+
- '%CMD_IN_ENV% pip install -U --timeout 5 --retries 2 -r tools/ci/appveyor/requirements.txt'
137+
138+
build_script:
139+
- ps: |
140+
$PYTHON_ARCH = $env:PYTHON_ARCH
141+
If ($PYTHON_ARCH -eq 32) {
142+
$MINGW = $env:MINGW_32
143+
} Else {
144+
$MINGW = $env:MINGW_64
145+
}
146+
$env:Path += ";$MINGW"
147+
$env:NPY_NUM_BUILD_JOBS = "4"
148+
mkdir dist
149+
pip wheel -v -v -v --wheel-dir=dist .
150+
151+
ls dist -r | Foreach-Object {
152+
appveyor PushArtifact $_.FullName
153+
pip install $_.FullName
154+
}
28155
29156
test_script:
30157
- python runtests.py -v -n
158+
159+
after_build:
160+
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
161+
#
162+
# If the cache limit is reached, the cache will not be updated (of not even
163+
# created in the first run). So this is a trade of between keeping the cache
164+
# current and having a cache at all.
165+
# NB: This is done only `on_success` since the cache in uploaded only on
166+
# success anyway.
167+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
168+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
169+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
170+
# Show size of cache
171+
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"
172+
173+
on_finish:
174+
- ps: |
175+
If (Test-Path .\junit-results.xml) {
176+
(new-object net.webclient).UploadFile(
177+
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
178+
(Resolve-Path .\junit-results.xml)
179+
)
180+
}
181+
$LastExitCode = 0

tools/ci/appveyor/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cython
2+
nose
3+
pytest-timeout
4+
pytest-xdist
5+
pytest-env
6+
pytest-faulthandler

0 commit comments

Comments
 (0)