@@ -10,7 +10,6 @@ concurrency:
1010
1111env :
1212 ADAPTIVECPP_TAG : v25.10.0
13- LLVM_MINGW_VERSION : " 20231128"
1413
1514jobs :
1615 build-sycl :
4847 ${{ runner.temp }}/AdaptiveCpp
4948 ${{ runner.temp }}/AdaptiveCpp-build
5049 ${{ runner.temp }}/adaptivecpp-install
51- ${{ runner.temp }}/llvm
52- ${{ runner.temp }}/boost_1_87_0
5350 ${{ runner.temp }}/ninja_install
5451 ${{ runner.temp }}/archives
55- key : sycl-toolchain-${{ matrix.platform }}-${{ env.ADAPTIVECPP_TAG }}-${{ env.LLVM_MINGW_VERSION }}-v1
52+ key : sycl-toolchain-${{ matrix.platform }}-${{ env.ADAPTIVECPP_TAG }}-v2
5653
5754 - name : Setup MSVC environment
5855 if : runner.os == 'Windows'
@@ -135,9 +132,7 @@ jobs:
135132 shell : pwsh
136133 run : |
137134 $archiveDir = Join-Path $env:RUNNER_TEMP 'archives'
138- $llvmDir = Join-Path $env:RUNNER_TEMP 'llvm'
139135 $ninjaDir = Join-Path $env:RUNNER_TEMP 'ninja_install'
140- $boostDir = Join-Path $env:RUNNER_TEMP 'boost_1_87_0'
141136 $sourceDir = Join-Path $env:RUNNER_TEMP 'AdaptiveCpp'
142137 $buildDir = Join-Path $env:RUNNER_TEMP 'AdaptiveCpp-build'
143138 $installDir = Join-Path $env:RUNNER_TEMP 'adaptivecpp-install'
@@ -153,33 +148,35 @@ jobs:
153148 Expand-Archive $ninjaArchive -DestinationPath $ninjaDir
154149 }
155150
156- $llvmArchive = Join-Path $archiveDir "llvm-mingw-$env:LLVM_MINGW_VERSION.zip"
157- if (-not (Test-Path (Join-Path $llvmDir 'bin/clang++.exe'))) {
158- if (-not (Test-Path $llvmArchive)) {
159- Invoke-WebRequest "https://github.com/mstorsjo/llvm-mingw/releases/download/$env:LLVM_MINGW_VERSION/llvm-mingw-$env:LLVM_MINGW_VERSION-msvcrt-x86_64.zip" -OutFile $llvmArchive
151+ $clangCl = Get-Command clang-cl.exe -ErrorAction SilentlyContinue
152+ if (-not $clangCl -and $env:ProgramFiles) {
153+ $programFilesClang = Join-Path $env:ProgramFiles 'LLVM/bin/clang-cl.exe'
154+ if (Test-Path $programFilesClang) {
155+ $clangCl = Get-Item $programFilesClang
160156 }
161- Remove-Item $llvmDir -Recurse -Force -ErrorAction SilentlyContinue
162- Expand-Archive $llvmArchive -DestinationPath $env:RUNNER_TEMP
163- $extractedLlvm = Get-ChildItem $env:RUNNER_TEMP -Directory | Where-Object { $_.Name -like 'llvm-mingw-*-msvcrt-x86_64' } | Select-Object -First 1
164- Move-Item $extractedLlvm.FullName $llvmDir
165157 }
166-
167- $env:PATH = "$($llvmDir)\bin;$ninjaDir;$env:PATH"
168-
169- if (-not (Test-Path (Join-Path $boostDir 'stage/lib'))) {
170- $boostArchive = Join-Path $archiveDir 'boost_1_87_0.zip'
171- if (-not (Test-Path $boostArchive)) {
172- Invoke-WebRequest 'https://archives.boost.io/release/1.87.0/source/boost_1_87_0.zip' -OutFile $boostArchive
158+ if (-not $clangCl -and $env:VCToolsInstallDir) {
159+ $vcToolsRoot = Resolve-Path (Join-Path $env:VCToolsInstallDir '../..')
160+ $vsClang = Join-Path $vcToolsRoot 'Llvm/x64/bin/clang-cl.exe'
161+ if (Test-Path $vsClang) {
162+ $clangCl = Get-Item $vsClang
173163 }
174- Remove-Item $boostDir -Recurse -Force -ErrorAction SilentlyContinue
175- Expand-Archive $boostArchive -DestinationPath $env:RUNNER_TEMP
176- Push-Location $boostDir
177- cmd /c bootstrap.bat clang | Out-Host
178- cmd /c 'b2.exe --with-context --with-fiber --with-atomic --with-filesystem --with-test toolset=clang address-model=64 variant=release --build-type=complete stage' | Out-Host
179- Pop-Location
180164 }
165+ if (-not $clangCl) {
166+ throw 'clang-cl.exe was not found. Install the Visual Studio LLVM/Clang toolset on the Windows runner.'
167+ }
168+ $clangClPath = $clangCl.Source
169+ if (-not $clangClPath) {
170+ $clangClPath = $clangCl.FullName
171+ }
172+ $clangBin = Split-Path $clangClPath -Parent
173+ $clangCxxPath = Join-Path $clangBin 'clang++.exe'
174+ if (-not (Test-Path $clangCxxPath)) {
175+ throw "clang++.exe was not found next to $clangClPath. Install the Visual Studio LLVM/Clang toolset on the Windows runner."
176+ }
177+ $env:PATH = "$clangBin;$ninjaDir;$env:PATH"
181178
182- $acppConfig = Join-Path $installDir 'lib/cmake/AdaptiveCpp/AdaptiveCppConfig .cmake'
179+ $acppConfig = Join-Path $installDir 'lib/cmake/AdaptiveCpp/adaptivecpp-config .cmake'
183180 $adaptiveCppArchive = Join-Path $archiveDir "AdaptiveCpp-$env:ADAPTIVECPP_TAG.tar.gz"
184181 if (-not (Test-Path $adaptiveCppArchive)) {
185182 Invoke-WebRequest "https://github.com/AdaptiveCpp/AdaptiveCpp/archive/refs/tags/$env:ADAPTIVECPP_TAG.tar.gz" -OutFile $adaptiveCppArchive
@@ -198,11 +195,8 @@ jobs:
198195 '-G', 'Ninja',
199196 '-DCMAKE_BUILD_TYPE=Release',
200197 "-DCMAKE_INSTALL_PREFIX=$installDir",
201- "-DCMAKE_C_COMPILER=$llvmDir/bin/clang.exe",
202- "-DCMAKE_CXX_COMPILER=$llvmDir/bin/clang++.exe",
203- "-DBOOST_ROOT=$boostDir",
204- '-DBoost_COMPILER=-clang17',
205- '-DBoost_ARCHITECTURE=-x64'
198+ "-DCMAKE_C_COMPILER=$clangClPath",
199+ "-DCMAKE_CXX_COMPILER=$clangClPath"
206200 )
207201 if (Get-Command ccache -ErrorAction SilentlyContinue) {
208202 $cmakeArgs += '-DCMAKE_C_COMPILER_LAUNCHER=ccache'
@@ -214,17 +208,13 @@ jobs:
214208 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
215209 }
216210
217- $projectCc = Join-Path $llvmDir 'bin/clang-cl.exe'
218- if (-not (Test-Path $projectCc)) {
219- $projectCc = 'clang-cl.exe'
220- }
221- "ITLABAI_CC=$projectCc" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
222- "ITLABAI_CXX=$projectCc" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
211+ "ITLABAI_CC=$clangClPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
212+ "ITLABAI_CXX=$clangClPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
213+ "ITLABAI_ACPP_CPU_CXX=$clangCxxPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
223214 "ITLABAI_CMAKE_PREFIX_PATH=$installDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
224- "ITLABAI_OPENMP_ROOT=$llvmDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
225215 'ACPP_TARGETS=omp.library-only' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
226216 "$installDir\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
227- "$llvmDir\bin " | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
217+ "$clangBin " | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
228218 "$ninjaDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
229219
230220 - name : Configure, build and test
@@ -273,7 +263,8 @@ jobs:
273263 "-DCMAKE_CXX_COMPILER=$env:ITLABAI_CXX",
274264 "-DCMAKE_PREFIX_PATH=$env:ITLABAI_CMAKE_PREFIX_PATH",
275265 '-DITLABAI_ENABLE_SYCL=ON',
276- "-DACPP_TARGETS=$env:ACPP_TARGETS"
266+ "-DACPP_TARGETS=$env:ACPP_TARGETS",
267+ "-DACPP_CPU_CXX=$env:ITLABAI_ACPP_CPU_CXX"
277268 )
278269 if ($env:ITLABAI_OPENMP_ROOT) {
279270 $cmakeArgs += "-DOpenMP_ROOT=$env:ITLABAI_OPENMP_ROOT"
0 commit comments