-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
218 lines (202 loc) · 6.77 KB
/
azure-pipelines.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
trigger:
- develop
variables:
- group: jfrog-artifactory
strategy:
matrix:
linux-debug:
imageName: 'ubuntu-20.04'
BUILD_CONFIGURATION: Debug
MULTITHREADING: False
DISABLE_LLVM_CONFIG: True
CC: clang # use clang on Linux which is faster to compile
LD: ld.lld # use lld LLVM for linking too
linux-release:
imageName: 'ubuntu-20.04'
BUILD_CONFIGURATION: RelWithDebInfo
MULTITHREADING: False
DISABLE_LLVM_CONFIG: True
CC: clang # use clang on Linux which is faster to compile
LD: ld.lld # use lld LLVM for linking too
# mac-debug:
# imageName: 'macos-10.15'
# BUILD_CONFIGURATION: Debug
# MULTITHREADING: False
# DISABLE_LLVM_CONFIG: True
mac-release:
imageName: 'macos-10.15'
BUILD_CONFIGURATION: RelWithDebInfo
MULTITHREADING: False
DISABLE_LLVM_CONFIG: True
windows-debug:
imageName: 'windows-2022'
BUILD_CONFIGURATION: Debug
MULTITHREADING: False
BUILD_ARCH: x86_64
VSINSTALL: "Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build"
MSVC_PLATFORM: amd64
windows-release:
imageName: 'windows-2022'
BUILD_CONFIGURATION: RelWithDebInfo
MULTITHREADING: False
BUILD_ARCH: x86_64
VSINSTALL: "Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build"
MSVC_PLATFORM: amd64
pool:
vmImage: $(imageName)
steps:
- powershell: gci env:* | sort-object name
- bash: |
mkdir -p $HOME/.inaos/cmake
mkdir -p $HOME/INAOS
echo "INAC_REPOSITORY_LOCAL=$HOME/INAOS" > $HOME/.inaos/cmake/repository.txt
echo "INAC_REPOSITORY_REMOTE=https://inaos.jfrog.io/inaos/libs-release-local/inaos" >> $HOME/.inaos/cmake/repository.txt
echo "INAC_REPOSITORY_USRPWD=licensed:AKCp5bBraH7CasbsYCURsjzkbjXwVwdYcT7u39EiuL6GjnK1VKfKQWCd1E2E64mHokU5YUHku" >> $HOME/.inaos/cmake/repository.txt
git submodule update --init --recursive
displayName: Clone repos
- bash: |
if [ "$AGENT_OS" == "Darwin" ]
then
echo "##vso[task.prependpath]$CONDA/bin"
fi
if [ "$AGENT_OS" == "Windows_NT" ]
then
echo "##vso[task.prependpath]$CONDA/Scripts"
fi
displayName: Add conda to PATH
- bash: |
if [ "$AGENT_OS" == "Darwin" ]
then
sudo chown -R $USER $CONDA
fi
displayName: Take ownership of conda installation
- bash: |
if [ "$AGENT_OS" == "Linux" ]
then
sudo apt install clang lld
fi
displayName: Install clang/lld on Linux
- bash: |
conda update --yes -n base -c defaults conda
conda install -y -c intel mkl-include
conda install -y -c intel mkl-static
conda install -y -c intel icc_rt
# LLVM 13 is necessary for calling int intrinsics, but:
# 1) LLVM 13 from conda-forge is not working for windows yet
# 2) It is not compatible enough with llvmlite
# conda install -y -c conda-forge 'llvmdev>=13'
# So, let's keep using llvmdev in the numba channel, as they maintain compatible versions
conda install -y -c numba 'llvmdev'
displayName: Download dependencies
env:
jfrog_artifactory_uid: $(jfrog_artifactory_uid)
jfrog_artifactory_pwd: $(jfrog_artifactory_pwd)
- bash: |
if [ "$AGENT_OS" != "Windows_NT" ]
then
mkdir cmake-build-$BUILD_CONFIGURATION
cd cmake-build-$BUILD_CONFIGURATION
cmake ../ -DCMAKE_BUILD_TYPE=$BUILD_CONFIGURATION -DMULTITHREADING=$MULTITHREADING -DDISABLE_LLVM_CONFIG=$DISABLE_LLVM_CONFIG -DLLVM_ROOT=$CONDA
make -j 2 # do not use too many parallel jobs or the VM can run out of memory
fi
displayName: Compile
env:
BUILD_CONFIGURATION: $(BUILD_CONFIGURATION)
MULTITHREADING: $(MULTITHREADING)
MKLROOT: $(CONDA)
SVMLROOT: $(CONDA)/lib
- script: |
call "C:\Program Files\%VSINSTALL%\vcvarsall.bat" %MSVC_PLATFORM%
mkdir cmake-build-%BUILD_CONFIGURATION%
cd cmake-build-%BUILD_CONFIGURATION%
cmake -G "NMake Makefiles" ../ -DCMAKE_BUILD_TYPE=%BUILD_CONFIGURATION% -DMULTITHREADING=%MULTITHREADING% -DINAC_TARGET_ARCH=%BUILD_ARCH% -DLLVM_ROOT=%CONDA%/Library
nmake
displayName: Compile
env:
BUILD_CONFIGURATION: $(BUILD_CONFIGURATION)
BUILD_ARCH: $(BUILD_ARCH)
MULTITHREADING: $(MULTITHREADING)
MKLROOT: $(CONDA)/Library
SVMLROOT: $(CONDA)/Library/lib
condition:
eq( variables['Agent.OS'], 'Windows_NT' )
- bash: |
cd cmake-build-$BUILD_CONFIGURATION
./tests
displayName: Execute tests
# condition:
# eq( variables['BUILD_CONFIGURATION'], 'RelWithDebInfo' )
env:
INAC_TRACE: ""
- bash: |
cd cmake-build-$BUILD_CONFIGURATION
if [ "$AGENT_OS" == "Windows_NT" ]
then
for EX in $(ls example_*.exe); do ./$EX; done
else
for EX in $(ls example_*); do ./$EX; done
fi
displayName: Execute examples
condition:
eq( variables['BUILD_CONFIGURATION'], 'RelWithDebInfo' )
env:
INAC_TRACE: ""
# Disable package creation because it takes precious time and blocks
# other possible tasks in the queue
#- bash: |
# cd cmake-build-$BUILD_CONFIGURATION
# if [ "$AGENT_OS" != "Windows_NT" ]
# then
# cpack
# zip -d iarray*.zip */bin/perf*
# zip -d iarray*.zip */doc/*
# zip -d iarray*.zip */include/caterva.h
# zip -d iarray*.zip */lib/*caterva*
# cp iarray*.zip $IA_ARTIFACT_TARGET
# fi
# displayName: Create package
# env:
# IA_ARTIFACT_TARGET: $(Build.ArtifactStagingDirectory)
#
#- script: |
# call "C:\Program Files\%VSINSTALL%\vcvarsall.bat" %MSVC_PLATFORM%
# cd cmake-build-%BUILD_CONFIGURATION%
# call "C:\Program Files\CMake\bin\cpack.exe"
# FOR %%f IN (iarray*.zip) DO (
# 7z d %%f */bin/perf*
# 7z d %%f */doc/* -r
# 7z d %%f */include/caterva.h
# 7z d %%f */lib/*caterva*
# copy %%f %IA_ARTIFACT_TARGET%
# )
# displayName: Create package
# env:
# IA_ARTIFACT_TARGET: $(Build.ArtifactStagingDirectory)
# condition:
# eq( variables['Agent.OS'], 'Windows_NT' )
#
#- task: PublishBuildArtifacts@1
# inputs:
# pathtoPublish: '$(Build.ArtifactStagingDirectory)'
# artifactName: iarray-$(imageName)
#
#- bash: |
# cd cmake-build-$BUILD_CONFIGURATION
# src=`ls iarray*.zip`
# artifact_name=`basename $src`
# if [ "$AGENT_OS" == "Darwin" ]
# then
# artifact_version=`echo $artifact_name | grep -Eo '\d+\.\d+\.\d+'`
# else
# artifact_version=`echo $artifact_name | grep -Po '\d+\.\d+\.\d+'`
# fi
# target=inaos/iarray/$artifact_version/$artifact_name
# url=$jfrog_repository_url/$target
# curl "-u$jfrog_artifactory_uid:$jfrog_artifactory_pwd" "-T" $src $url
# displayName: Upload to artifactory
# env:
# jfrog_artifactory_uid: $(jfrog_artifactory_uid)
# jfrog_artifactory_pwd: $(jfrog_artifactory_pwd)
# jfrog_repository_url: $(jfrog_repository_url)
# condition:
# eq( variables['upload_artifactory'], 'yes' )