Skip to content

Commit 5b89b1b

Browse files
committed
ci:windows:oneapi add
ci:oneapi: mpi also needs cache
1 parent c59215e commit 5b89b1b

File tree

4 files changed

+134
-0
lines changed

4 files changed

+134
-0
lines changed

.github/workflows/oneapi-windows.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# https://oneapi-src.github.io/oneapi-ci/
2+
3+
name: oneapi-windows
4+
5+
env:
6+
CMAKE_GENERATOR: "MinGW Makefiles"
7+
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18674/w_BaseKit_p_2022.2.0.252_offline.exe
8+
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18680/w_HPCKit_p_2022.2.0.173_offline.exe
9+
WINDOWS_CPP_COMPONENTS: intel.oneapi.win.cpp-compiler
10+
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler
11+
WINDOWS_MKL_COMPONENTS: intel.oneapi.win.mkl.devel
12+
WINDOWS_MPI_COMPONENTS: intel.oneapi.win.mpi.devel
13+
CC: icx
14+
CXX: icx
15+
FC: ifx
16+
CMAKE_BUILD_TYPE: Release
17+
# Release is necessary to avoid ITERATOR_DEBUG_LEVEL mismatch with libstdc++
18+
19+
on:
20+
push:
21+
paths:
22+
- "**.bat"
23+
- "**/*.cpp"
24+
- "**.f90"
25+
- "**.F90"
26+
- "**.cmake"
27+
- "**/CMakeLists.txt"
28+
- ".github/workflows/oneapi-windows.yml"
29+
- ".github/workflows/oneapi_install_windows.bat"
30+
- ".github/workflows/oneapi_run_windows.bat"
31+
- ".github/workflows/oneapi_cache_exclude_windows.bat"
32+
33+
jobs:
34+
35+
windows-oneapi:
36+
timeout-minutes: 60
37+
runs-on: windows-latest
38+
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- name: cache install oneAPI
43+
timeout-minutes: 10
44+
id: cache-install
45+
uses: actions/cache@v3
46+
with:
47+
path: |
48+
C:\Program Files (x86)\Intel\oneAPI\setvars.bat
49+
C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat
50+
C:\Program Files (x86)\Intel\oneAPI\compiler
51+
C:\Program Files (x86)\Intel\oneAPI\mpi
52+
key: install-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_CPP_COMPONENTS }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-${{ env.WINDOWS_MPI_COMPONENTS }}
53+
54+
- name: no-cache install oneAPI
55+
timeout-minutes: 40
56+
if: steps.cache-install.outputs.cache-hit != 'true'
57+
run: |
58+
./.github/workflows/oneapi_install_windows.bat ${{ env.WINDOWS_HPCKIT_URL }} "${{ env.WINDOWS_CPP_COMPONENTS }}:${{ env.WINDOWS_FORTRAN_COMPONENTS }}:${{ env.WINDOWS_MPI_COMPONENTS }}"
59+
60+
- name: "Batch workaround: config, build, test"
61+
shell: cmd
62+
run: ".github\\workflows\\oneapi_run_windows.bat"
63+
64+
- name: exclude unused files from cache
65+
if: steps.cache-install.outputs.cache-hit != 'true'
66+
run: .github/workflows/oneapi_cache_exclude_windows.ps1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-FileCopyrightText: 2020 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
$LATEST_VERSION=Get-ChildItem -Path "C:\Program Files (x86)\Intel\oneAPI\compiler\" -Name | Select-String -NotMatch latest | %{$_.Line} | Sort-Object | Select-Object -Last 1
6+
7+
Remove-Item "C:\Program Files (x86)\Intel\oneAPI\compiler\$LATEST_VERSION\windows\compiler\lib\ia32_win" -Force -Recurse -ErrorAction SilentlyContinue
8+
Remove-Item "C:\Program Files (x86)\Intel\oneAPI\compiler\$LATEST_VERSION\windows\bin\intel64_ia32" -Force -Recurse -ErrorAction SilentlyContinue
9+
Remove-Item "C:\Program Files (x86)\Intel\oneAPI\compiler\$LATEST_VERSION\windows\lib\emu" -Force -Recurse -ErrorAction SilentlyContinue
10+
Remove-Item "C:\Program Files (x86)\Intel\oneAPI\compiler\$LATEST_VERSION\windows\lib\oclfpga" -Force -Recurse -ErrorAction SilentlyContinue
11+
Remove-Item "C:\Program Files (x86)\Intel\oneAPI\compiler\$LATEST_VERSION\windows\lib\ocloc" -Force -Recurse -ErrorAction SilentlyContinue
12+
Remove-Item "C:\Program Files (x86)\Intel\oneAPI\compiler\$LATEST_VERSION\windows\lib\x86" -Force -Recurse -ErrorAction SilentlyContinue
13+
14+
exit 0
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
REM SPDX-FileCopyrightText: 2022 Intel Corporation
2+
REM
3+
REM SPDX-License-Identifier: MIT
4+
5+
set URL=%1
6+
set COMPONENTS=%2
7+
8+
curl.exe --output %TEMP%\webimage.exe --url %URL% --retry 5 --retry-delay 5
9+
start /b /wait %TEMP%\webimage.exe -s -x -f webimage_extracted --log extract.log
10+
del %TEMP%\webimage.exe
11+
if "%COMPONENTS%"=="" (
12+
webimage_extracted\bootstrapper.exe -s --action install --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=.
13+
) else (
14+
webimage_extracted\bootstrapper.exe -s --action install --components=%COMPONENTS% --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=.
15+
)
16+
if %errorlevel% neq 0 exit /b %errorlevel%
17+
rd /s/q "webimage_extracted"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
REM batch file since Github Actions doesn't support shell cmd well,
2+
REM and cmd is needed for oneAPI Windows
3+
4+
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
5+
if %errorlevel% neq 0 exit /b %errorlevel%
6+
7+
echo "I_MPI_ROOT: %I_MPI_ROOT%"
8+
9+
echo "configure"
10+
cmake -B build -DCMAKE_INSTALL_PREFIX=%RUNNER_TEMP%
11+
if %errorlevel% neq 0 (
12+
type build\CMakeFiles\CMakeError.log & exit /b %errorlevel%
13+
)
14+
15+
echo "build"
16+
cmake --build build --parallel
17+
if %errorlevel% neq 0 exit /b %errorlevel%
18+
19+
echo "Run tests"
20+
ctest --test-dir build --preset default -V
21+
if %errorlevel% neq 0 exit /b %errorlevel%
22+
23+
echo "install project"
24+
cmake --install build
25+
if %errorlevel% neq 0 exit /b %errorlevel%
26+
27+
echo "Example config"
28+
cmake -B example/build -S example -DCMAKE_PREFIX_PATH=%RUNNER_TEMP%
29+
if %errorlevel% neq 0 exit /b %errorlevel%
30+
31+
echo "Example build"
32+
cmake --build example/build
33+
if %errorlevel% neq 0 exit /b %errorlevel%
34+
35+
echo "Example test"
36+
ctest --test-dir example/build -V
37+
if %errorlevel% neq 0 exit /b %errorlevel%

0 commit comments

Comments
 (0)