Skip to content

Commit a177c3a

Browse files
authored
Merge pull request #180 from JohanMabille/azure
Migrated from travisci to azure pipelines
2 parents 15a2cf2 + 4ffbe0c commit a177c3a

File tree

9 files changed

+279
-229
lines changed

9 files changed

+279
-229
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
jobs:
2+
- job: 'Linux_0'
3+
strategy:
4+
matrix:
5+
clang_4:
6+
llvm_version: '4.0'
7+
blas: 'OpenBLAS'
8+
clang_5:
9+
llvm_version: '5.0'
10+
blas: 'OpenBLAS'
11+
clang_6:
12+
llvm_version: '6.0'
13+
blas: 'OpenBLAS'
14+
clang_7:
15+
llvm_version: '7'
16+
blas: 'OpenBLAS'
17+
clang_8:
18+
llvm_version: '8'
19+
blas: 'OpenBLAS'
20+
clang_9:
21+
llvm_version: '9'
22+
blas: 'OpenBLAS'
23+
clang_10:
24+
llvm_version: '10'
25+
blas: 'OpenBLAS'
26+
pool:
27+
vmImage: ubuntu-16.04
28+
variables:
29+
CC: clang-$(llvm_version)
30+
CXX: clang++-$(llvm_version)
31+
timeoutInMinutes: 360
32+
steps:
33+
34+
- script: |
35+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
36+
if [[ $(llvm_version) == '4.0' || $(llvm_version) == '5.0' ]]; then
37+
sudo apt-get update
38+
sudo apt-get --no-install-suggests --no-install-recommends install gcc-4.9 clang-$(llvm_version)
39+
else
40+
LLVM_VERSION=$(llvm_version)
41+
get -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
42+
sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$LLVM_VERSION main"
43+
sudo apt-get update
44+
sudo apt-get --no-install-suggests --no-install-recommends install clang-$(llvm_version)
45+
fi
46+
displayName: Install build toolchain
47+
48+
- bash: echo "##vso[task.prependpath]$CONDA/bin"
49+
displayName: Add conda to PATH
50+
51+
- template: unix-build.yml
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
jobs:
2+
- job: 'Linux_1'
3+
strategy:
4+
matrix:
5+
gcc_4_OpenBLAS:
6+
gcc_version: '4.9'
7+
blas: 'OpenBLAS'
8+
gcc_5_OpenBLAS:
9+
gcc_version: '5'
10+
blas: 'OpenBLAS'
11+
gcc_6_OpenBLAS:
12+
gcc_version: '5'
13+
blas: 'OpenBLAS'
14+
gcc_6_bound_checks:
15+
gcc_version: '6'
16+
blas: 'OpenBLAS'
17+
bound_checks: 1
18+
gcc_7_OpenBLAS:
19+
gcc_version: '7'
20+
blas: 'OpenBLAS'
21+
gcc_8_OpenBLAS:
22+
gcc_version: '8'
23+
blas: 'OpenBLAS'
24+
gcc_9_OpenBLAS:
25+
gcc_version: '9'
26+
blas: 'OpenBLAS'
27+
gcc_4_mkl:
28+
gcc_version: '4.9'
29+
blas: 'mkl'
30+
gcc_5_mkl:
31+
gcc_version: '5'
32+
blas: 'mkl'
33+
gcc_6_mkl:
34+
gcc_version: '6'
35+
blas: 'mkl'
36+
gcc_7_mkl:
37+
gcc_version: '7'
38+
blas: 'mkl'
39+
gcc_8_mkl:
40+
gcc_version: '8'
41+
blas: 'mkl'
42+
gcc_9_mkl:
43+
gcc_version: '9'
44+
blas: 'mkl'
45+
pool:
46+
vmImage: ubuntu-16.04
47+
variables:
48+
CC: gcc-$(gcc_version)
49+
CXX: g++-$(gcc_version)
50+
timeoutInMinutes: 360
51+
steps:
52+
53+
- script: |
54+
if [[ $(gcc_version) == '4.9' || $(gcc_version) == '6' ]]; then
55+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
56+
sudo apt-get update
57+
sudo apt-get --no-install-suggests --no-install-recommends install g++-$(gcc_version)
58+
fi
59+
displayName: Install build toolchain
60+
61+
- bash: echo "##vso[task.prependpath]$CONDA/bin"
62+
displayName: Add conda to PATH
63+
64+
- template: unix-build.yml
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
jobs:
2+
- job: 'OSX'
3+
strategy:
4+
matrix:
5+
macOS_10_14:
6+
image_name: 'macOS-10.14'
7+
blas: 'mkl'
8+
macOS_10_15:
9+
image_name: 'macOS-10.15'
10+
blas: 'mkl'
11+
pool:
12+
vmImage: $(image_name)
13+
variables:
14+
CC: clang
15+
CXX: clang++
16+
timeoutInMinutes: 360
17+
steps:
18+
- script: |
19+
echo "Removing homebrew for Azure to avoid conflicts with conda"
20+
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew
21+
chmod +x ~/uninstall_homebrew
22+
~/uninstall_homebrew -f -q
23+
displayName: Remove homebrew
24+
25+
- bash: |
26+
echo "##vso[task.prependpath]$CONDA/bin"
27+
sudo chown -R $USER $CONDA
28+
displayName: Add conda to PATH
29+
30+
- template: unix-build.yml
31+
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
jobs:
2+
- job: 'build'
3+
pool:
4+
vmImage: 'vs2017-win2016'
5+
timeoutInMinutes: 360
6+
steps:
7+
8+
# Install Chocolatey (https://chocolatey.org/install#install-with-powershellexe)
9+
- powershell: |
10+
Set-ExecutionPolicy Bypass -Scope Process -Force
11+
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
12+
Write-Host "##vso[task.setvariable variable=PATH]$env:PATH"
13+
choco --version
14+
displayName: "Install Chocolatey"
15+
16+
# Install Miniconda
17+
- script: |
18+
choco install miniconda3 --yes
19+
set PATH=C:\tools\miniconda3\Scripts;C:\tools\miniconda3;C:\tools\miniconda3\Library\bin;%PATH%
20+
echo '##vso[task.setvariable variable=PATH]%PATH%'
21+
set LIB=C:\tools\miniconda3\Library\lib;%LIB%
22+
echo '##vso[task.setvariable variable=LIB]%LIB%'
23+
conda --version
24+
displayName: "Install Miniconda"
25+
26+
# Configure Miniconda
27+
- script: |
28+
conda config --set always_yes yes
29+
conda config --append channels conda-forge
30+
conda info
31+
displayName: "Configure Miniconda"
32+
33+
# Create conda enviroment
34+
# Note: conda activate doesn't work here, because it creates a new shell!
35+
- script: |
36+
conda install cmake==3.14.0 ^
37+
mkl-devel ^
38+
ninja ^
39+
xtensor=0.22.0 ^
40+
python=3.6
41+
conda list
42+
displayName: "Install conda packages"
43+
44+
# Install LLVM
45+
# Note: LLVM distributed by conda is too old
46+
- script: |
47+
choco install llvm --yes
48+
set PATH=C:\Program Files\LLVM\bin;%PATH%
49+
echo '##vso[task.setvariable variable=PATH]%PATH%'
50+
clang-cl --version
51+
displayName: "Install LLVM"
52+
53+
# Configure
54+
- script: |
55+
setlocal EnableDelayedExpansion
56+
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
57+
mkdir build & cd build
58+
cmake -G Ninja ^
59+
-DCMAKE_BUILD_TYPE=Release ^
60+
-DCMAKE_C_COMPILER=clang-cl ^
61+
-DCMAKE_CXX_COMPILER=clang-cl ^
62+
-DBUILD_TESTS=ON ^
63+
-DDOWNLOAD_GTEST=ON ^
64+
$(Build.SourcesDirectory)
65+
displayName: "Configure xtensor-blas"
66+
workingDirectory: $(Build.BinariesDirectory)
67+
68+
# Build
69+
- script: |
70+
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
71+
cmake --build . ^
72+
--config Release ^
73+
--target test_xtensor_blas ^
74+
-- -v
75+
displayName: "Build xtensor-blas"
76+
workingDirectory: $(Build.BinariesDirectory)/build
77+
78+
# Test
79+
- script: |
80+
setlocal EnableDelayedExpansion
81+
cd test
82+
.\test_xtensor_blas
83+
displayName: "Test xtensor-blas"
84+
workingDirectory: $(Build.BinariesDirectory)/build/test

.azure-pipelines/unix-build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
steps:
2+
- script: |
3+
conda config --set always_yes yes --set changeps1 no
4+
conda update -q conda
5+
conda env create --file environment-dev.yml
6+
source activate xtensor-blas
7+
echo $(blas)
8+
if [[ $(blas) == 'mkl' ]]; then
9+
conda install mkl
10+
else
11+
conda install openblas==0.3.7 "blas * openblas" -c conda-forge;
12+
fi
13+
displayName: Install dependencies
14+
15+
- script: |
16+
source activate xtensor-blas
17+
mkdir build
18+
cd build
19+
if [[ $(bound_checks) == 1 ]]; then
20+
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DXTENSOR_ENABLE_ASSERT=ON";
21+
fi
22+
cmake -DDOWNLOAD_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib $CMAKE_EXTRA_ARGS $(Build.SourcesDirectory);
23+
displayName: Configure xtensor-blas
24+
workingDirectory: $(Build.BinariesDirectory)
25+
26+
- script: |
27+
source activate xtensor-blas
28+
make -j2 test_xtensor_blas
29+
displayName: Build xtensor-blas
30+
workingDirectory: $(Build.BinariesDirectory)/build
31+
32+
- script: |
33+
source activate xtensor-blas
34+
cd test
35+
./test_xtensor_blas
36+
displayName: Test xtensor-blas
37+
workingDirectory: $(Build.BinariesDirectory)/build/test

0 commit comments

Comments
 (0)