-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines-windows-steps.yml
95 lines (84 loc) · 3.44 KB
/
azure-pipelines-windows-steps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
steps:
- task: UsePythonVersion@0
- bash: |
set -o errexit
python3 -m pip install --upgrade pip
pip3 install cibuildwheel cython numpy pandas setuptools twine wheel
displayName: Install Python dependencies
- bash: |
curl -O -L https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-$OPENBLAS_ARCH.zip
mkdir OpenBLAS-0.3.21/
cd OpenBLAS-0.3.21/
unzip ../OpenBLAS-0.3.21-$OPENBLAS_ARCH.zip
displayName: 'Download OpenBLAS'
# Configure armadillo
- bash: |
curl -O -L https://files.mlpack.org/armadillo-11.4.1.tar.gz
tar -xvzf armadillo-11.4.1.tar.gz
displayName: 'Download Armadillo'
- powershell: |
$rootdir = $pwd
cd armadillo-11.4.1/
cmake -G "Visual Studio 16 2019" `
-A $env:WIN_ARCH `
-DBLAS_LIBRARY:FILEPATH="$rootdir\OpenBLAS-0.3.21\lib\libopenblas.lib" `
-DLAPACK_LIBRARY:FILEPATH="$rootdir\OpenBLAS-0.3.21\lib\libopenblas.lib" `
-DBUILD_SHARED_LIBS=OFF `
-DCMAKE_BUILD_TYPE=Release .
cmake --build . --target armadillo --config Release
cd ../
displayName: 'Configure and build armadillo'
# Download ensmallen
- bash: |
curl -O -L https://www.ensmallen.org/files/ensmallen-2.19.0.tar.gz
tar -xvzf ensmallen-2.19.0.tar.gz
# No build needed---it's header-only.
displayName: 'Download ensmallen'
- bash: |
curl -O -L https://github.com/USCILab/cereal/archive/refs/tags/v1.3.2.tar.gz
tar -xvzf v1.3.2.tar.gz
displayName: 'Download cereal'
- bash: |
curl -O -L https://www.mlpack.org/files/stb.tar.gz
tar -xvzf stb.tar.gz
displayName: 'Download STB'
- bash: |
git clone https://github.com/mlpack/mlpack
cd mlpack
git checkout $(MLPACK_VERSION)
displayName: Clone mlpack
- powershell: |
$rootdir = $pwd
cd mlpack
mkdir build
cd build
cmake -G "Visual Studio 16 2019" `
-DBLAS_LIBRARIES:FILEPATH="$rootdir\OpenBLAS-0.3.21\lib\libopenblas.lib" `
-DLAPACK_LIBRARIES:FILEPATH="$rootdir\OpenBLAS-0.3.21\lib\libopenblas.lib" `
-DARMADILLO_INCLUDE_DIR="$rootdir\armadillo-11.4.1\tmp\include" `
-DARMADILLO_LIBRARY="$rootdir\armadillo-11.4.1\Release\armadillo.lib" `
-DCEREAL_INCLUDE_DIR="$rootdir\cereal-1.3.2\include" `
-DENSMALLEN_INCLUDE_DIR="$rootdir\ensmallen-2.19.0\include\" `
-DBUILD_JULIA_BINDINGS=OFF `
-DBUILD_PYTHON_BINDINGS=ON `
-DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target python_configured --config Release
displayName: Generate setup.py
- powershell: |
$env:CIBW_REPAIR_WHEEL_COMMAND_WINDOWS = "delvewheel repair --add-path $pwd/OpenBLAS-0.3.21/bin/ -w {dest_dir} {wheel}"
$env:CIBW_BEFORE_BUILD = $env:BUILD_SCRIPT
$env:CIBW_BUILD_VERBOSITY = 1
$env:VS_GENERATOR = "Visual Studio 16 2019"
$env:OPENBLAS_LIB = "$pwd/OpenBLAS-0.3.21/lib/libopenblas.lib"
$env:OPENBLAS_DLL = "$pwd/OpenBLAS-0.3.21/bin/libopenblas.dll"
cibuildwheel --output-dir wheelhouse mlpack/build/src/mlpack/bindings/python/
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
- bash: |
echo "[pypi]" > ~/.pypirc
echo "username = __token__" >> ~/.pypirc
echo "password = $(TWINE_PYPI_TOKEN)" >> ~/.pypirc
twine upload wheelhouse/*.whl
rm -f ~/.pypirc
displayName: Push wheels to PyPI