@@ -43,10 +43,19 @@ jobs:
43
43
pool :
44
44
vmImage : ' windows-latest'
45
45
steps :
46
+ - task : Cache@2
47
+ inputs :
48
+ path : C:\Program Files (x86)\Intel\oneAPI\compiler
49
+ key : ' "install" | "$(WINDOWS_HPCKIT_URL)" | "$(WINDOWS_CPP_COMPONENTS)" | compiler | scripts/cache_exclude_windows.sh'
50
+ cacheHitVar : CACHE_RESTORED
46
51
- script : scripts/install_windows.bat $(WINDOWS_HPCKIT_URL) $(WINDOWS_CPP_COMPONENTS)
47
52
displayName : install
53
+ condition : ne(variables.CACHE_RESTORED, 'true')
48
54
- script : scripts/build_windows.bat c++
49
55
displayName : build
56
+ - bash : scripts/cache_exclude_windows.sh
57
+ displayName : exclude unused files from cache
58
+ condition : ne(variables.CACHE_RESTORED, 'true')
50
59
51
60
# Delete the following if you don't want to save install logs
52
61
- task : CopyFiles@2
@@ -68,10 +77,19 @@ jobs:
68
77
pool :
69
78
vmImage : ' windows-latest'
70
79
steps :
80
+ - task : Cache@2
81
+ inputs :
82
+ path : C:\Program Files (x86)\Intel\oneAPI\compiler
83
+ key : ' "install" | "$(WINDOWS_HPCKIT_URL)" | "$(WINDOWS_FORTRAN_COMPONENTS)" | "compiler" | scripts/cache_exclude_windows.sh'
84
+ cacheHitVar : CACHE_RESTORED
71
85
- script : scripts/install_windows.bat $(WINDOWS_HPCKIT_URL) $(WINDOWS_FORTRAN_COMPONENTS)
72
86
displayName : install
87
+ condition : ne(variables.CACHE_RESTORED, 'true')
73
88
- script : scripts/build_windows.bat fortran
74
89
displayName : build
90
+ - bash : scripts/cache_exclude_windows.sh
91
+ displayName : exclude unused files from cache
92
+ condition : ne(variables.CACHE_RESTORED, 'true')
75
93
76
94
# Delete the following if you don't want to save install logs
77
95
- task : CopyFiles@2
@@ -93,10 +111,35 @@ jobs:
93
111
pool :
94
112
vmImage : ' windows-latest'
95
113
steps :
114
+ - task : Cache@2 # multiple paths per cache not supported yet. See https://github.com/microsoft/azure-pipelines-agent/pull/2834
115
+ inputs :
116
+ path : C:\Program Files (x86)\Intel\oneAPI\compiler
117
+ key : ' "install" | "$(WINDOWS_BASEKIT_URL)" | "$(WINDOWS_DPCPP_COMPONENTS)" | "compiler" | scripts/cache_exclude_windows.sh'
118
+ - task : Cache@2
119
+ inputs :
120
+ path : C:\Program Files (x86)\Intel\oneAPI\tbb
121
+ key : ' "install" | "$(WINDOWS_BASEKIT_URL)" | "$(WINDOWS_DPCPP_COMPONENTS)" | "tbb" | scripts/cache_exclude_windows.sh'
122
+ - task : Cache@2
123
+ inputs :
124
+ path : opencl # caching of individual files is not supported, caching OpenCL.dll in a folder as a workaround.
125
+ key : ' "install" | "$(WINDOWS_BASEKIT_URL)" | "$(WINDOWS_DPCPP_COMPONENTS)" | "opencl_folder" | scripts/cache_exclude_windows.sh'
126
+ cacheHitVar : CACHE_RESTORED
96
127
- script : scripts/install_windows.bat $(WINDOWS_BASEKIT_URL) $(WINDOWS_DPCPP_COMPONENTS)
97
128
displayName : install
129
+ condition : ne(variables.CACHE_RESTORED, 'true')
130
+ - bash : cp opencl/OpenCL.dll C:/Windows/System32/
131
+ displayName : restore OpenCL.dll from cache
132
+ condition : eq(variables.CACHE_RESTORED, 'true')
98
133
- script : scripts/build_windows.bat dpc++
99
134
displayName : build
135
+ - bash : scripts/cache_exclude_windows.sh
136
+ displayName : exclude unused files from cache
137
+ condition : ne(variables.CACHE_RESTORED, 'true')
138
+ - bash : |
139
+ mkdir -p opencl
140
+ cp C:/Windows/System32/OpenCL.dll opencl/
141
+ displayName: copy OpenCL.dll to a folder for caching
142
+ condition: ne(variables.CACHE_RESTORED, 'true')
100
143
101
144
# Delete the following if you don't want to save install logs
102
145
- task : CopyFiles@2
@@ -120,32 +163,69 @@ jobs:
120
163
steps :
121
164
- script : scripts/setup_apt_repo_linux.sh
122
165
displayName : setup apt repo
166
+ - script : scripts/apt_depends.sh $LINUX_CPP_COMPONENTS | tee depends.txt
167
+ displayName : collect versioned dependencies of apt packages
168
+ - task : Cache@2
169
+ inputs :
170
+ path : /opt/intel/oneapi/compiler
171
+ key : ' "install" | "$(LINUX_CPP_COMPONENTS)" | depends.txt | "compiler" | scripts/cache_exclude_linux.sh'
172
+ cacheHitVar : CACHE_RESTORED
123
173
- script : scripts/install_linux_apt.sh $(LINUX_CPP_COMPONENTS)
124
174
displayName : install
175
+ condition : ne(variables.CACHE_RESTORED, 'true')
125
176
- script : scripts/build_linux.sh c++
126
177
displayName : build
178
+ - bash : scripts/cache_exclude_linux.sh
179
+ displayName : exclude unused files from cache
180
+ condition : ne(variables.CACHE_RESTORED, 'true')
127
181
128
182
- job : build_linux_apt_fortran
129
183
pool :
130
184
vmImage : ' ubuntu-latest'
131
185
steps :
132
186
- script : scripts/setup_apt_repo_linux.sh
133
187
displayName : setup apt repo
188
+ - script : scripts/apt_depends.sh $LINUX_CPP_COMPONENTS | tee depends.txt
189
+ displayName : collect versioned dependencies of apt packages
190
+ - task : Cache@2
191
+ inputs :
192
+ path : /opt/intel/oneapi/compiler
193
+ key : ' "install" | "$(LINUX_FORTRAN_COMPONENTS)" | depends.txt | "compiler" | scripts/cache_exclude_linux.sh'
194
+ cacheHitVar : CACHE_RESTORED
134
195
- script : scripts/install_linux_apt.sh $(LINUX_FORTRAN_COMPONENTS)
135
196
displayName : install
197
+ condition : ne(variables.CACHE_RESTORED, 'true')
136
198
- script : scripts/build_linux.sh fortran
137
199
displayName : build
200
+ - bash : scripts/cache_exclude_linux.sh
201
+ displayName : exclude unused files from cache
202
+ condition : ne(variables.CACHE_RESTORED, 'true')
138
203
139
204
- job : build_linux_apt_dpcpp
140
205
pool :
141
206
vmImage : ' ubuntu-latest'
142
207
steps :
143
208
- script : scripts/setup_apt_repo_linux.sh
144
209
displayName : setup apt repo
210
+ - script : scripts/apt_depends.sh $LINUX_CPP_COMPONENTS | tee depends.txt
211
+ displayName : collect versioned dependencies of apt packages
212
+ - task : Cache@2
213
+ inputs :
214
+ path : /opt/intel/oneapi/compiler
215
+ key : ' "install" | "$(LINUX_DPCPP_COMPONENTS)" | depends.txt | "compiler" | scripts/cache_exclude_linux.sh'
216
+ - task : Cache@2
217
+ inputs :
218
+ path : /opt/intel/oneapi/tbb
219
+ key : ' "install" | "$(LINUX_DPCPP_COMPONENTS)" | depends.txt | "tbb" | scripts/cache_exclude_linux.sh'
220
+ cacheHitVar : CACHE_RESTORED
145
221
- script : scripts/install_linux_apt.sh $(LINUX_DPCPP_COMPONENTS)
146
222
displayName : install
223
+ condition : ne(variables.CACHE_RESTORED, 'true')
147
224
- script : scripts/build_linux.sh dpc++
148
225
displayName : build
226
+ - bash : scripts/cache_exclude_linux.sh
227
+ displayName : exclude unused files from cache
228
+ condition : ne(variables.CACHE_RESTORED, 'true')
149
229
150
230
- job : build_linux_container_cpp
151
231
pool :
@@ -181,8 +261,18 @@ jobs:
181
261
pool :
182
262
vmImage : ' macOS-latest'
183
263
steps :
264
+ - script : |
265
+ sudo mkdir -p /opt/intel
266
+ sudo chown $USER /opt/intel
267
+ displayName: prepare for cache restore
268
+ - task : Cache@2
269
+ inputs :
270
+ path : /opt/intel/oneapi
271
+ key : ' "install" | "$(MACOS_HPCKIT_URL)" | "$(MACOS_CPP_COMPONENTS)"'
272
+ cacheHitVar : CACHE_RESTORED
184
273
- script : scripts/install_macos.sh $(MACOS_HPCKIT_URL) $(MACOS_CPP_COMPONENTS)
185
274
displayName : install
275
+ condition : ne(variables.CACHE_RESTORED, 'true')
186
276
- script : scripts/build_macos.sh c++
187
277
displayName : build
188
278
@@ -205,8 +295,18 @@ jobs:
205
295
pool :
206
296
vmImage : ' macOS-latest'
207
297
steps :
298
+ - script : |
299
+ sudo mkdir -p /opt/intel
300
+ sudo chown $USER /opt/intel
301
+ displayName: prepare for cache restore
302
+ - task : Cache@2
303
+ inputs :
304
+ path : /opt/intel/oneapi
305
+ key : ' "install" | "$(MACOS_HPCKIT_URL)" | "$(MACOS_FORTRAN_COMPONENTS)"'
306
+ cacheHitVar : CACHE_RESTORED
208
307
- script : scripts/install_macos.sh $(MACOS_HPCKIT_URL) $(MACOS_FORTRAN_COMPONENTS)
209
308
displayName : install
309
+ condition : ne(variables.CACHE_RESTORED, 'true')
210
310
- script : scripts/build_macos.sh fortran
211
311
displayName : build
212
312
0 commit comments