Skip to content

Commit 1719a3e

Browse files
committed
GitHub CI: Start working on getting a Windows CI working
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent d4f6f91 commit 1719a3e

5 files changed

Lines changed: 245 additions & 0 deletions

File tree

.github/scripts/build_windows.bat

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
REM SPDX-FileCopyrightText: 2022 Intel Corporation
2+
REM
3+
REM SPDX-License-Identifier: MIT
4+
5+
set LANGUAGE=%1
6+
set VS_VER=%2
7+
set SAMPLES_TAG=%3
8+
9+
IF "%VS_VER%"=="2017_build_tools" (
10+
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
11+
) ELSE (
12+
IF "%VS_VER%"=="2019_build_tools" (
13+
@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
14+
) ELSE (
15+
@call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat" %VS_VER%
16+
)
17+
)
18+
19+
for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\compiler\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f"
20+
@call "C:\Program Files (x86)\Intel\oneAPI\compiler\%LATEST_VERSION%\env\vars.bat"
21+
22+
git clone --depth 1 --branch %SAMPLES_TAG% https://github.com/oneapi-src/oneAPI-samples.git
23+
24+
if "%LANGUAGE%" == "c++" goto cpp
25+
if "%LANGUAGE%" == "fortran" goto fortran
26+
if "%LANGUAGE%" == "dpc++" goto dpcpp
27+
goto exit
28+
29+
30+
:fortran
31+
cd oneAPI-samples\DirectProgramming\Fortran\CombinationalLogic\openmp-primes
32+
ifort -O2 -fpp /Qopenmp src\openmp_sample.f90
33+
openmp_sample.exe
34+
set RESULT=%ERRORLEVEL%
35+
ifx -O2 -fpp /Qopenmp src\openmp_sample.f90
36+
openmp_sample.exe
37+
set /a RESULT=%RESULT%+%ERRORLEVEL%
38+
goto exit
39+
40+
41+
42+
:exit
43+
exit /b %RESULT%
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: 2020 Intel Corporation
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
#shellcheck disable=SC2010
8+
LATEST_VERSION=$(ls -1 "C:\Program Files (x86)\Intel\oneAPI\compiler" | grep -v latest | sort | tail -1)
9+
10+
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\compiler\lib\ia32_win"
11+
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\bin\intel64_ia32"
12+
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\emu"
13+
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\oclfpga"
14+
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\ocloc"
15+
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\x86"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
set installer_exit_code=%ERRORLEVEL%
17+
rd /s/q "webimage_extracted"
18+
exit /b %installer_exit_code%

.github/workflows/windows.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: windows
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- master
8+
push:
9+
branches:
10+
- develop
11+
- master
12+
13+
jobs:
14+
build:
15+
env:
16+
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
17+
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7dff44ba-e3af-4448-841c-0d616c8da6e7/w_BaseKit_p_2024.1.0.595_offline.exe
18+
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/c95a3b26-fc45-496c-833b-df08b10297b9/w_HPCKit_p_2024.1.0.561_offline.exe
19+
LINUX_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/fdc7a2bc-b7a8-47eb-8876-de6201297144/l_BaseKit_p_2024.1.0.596_offline.sh
20+
LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7f096850-dc7b-4c35-90b5-36c12abd9eaa/l_HPCKit_p_2024.1.0.560_offline.sh
21+
LINUX_AIKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0414ef18-5b64-47f2-9b2e-ae94860272b9/l_AITools.2024.1.0.9.sh
22+
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/c112cca6-12cf-4a0c-9e5e-d0d50d3b0f8b/m_RenderKit_p_2024.1.0.744_offline.dmg
23+
WINDOWS_CPP_COMPONENTS: intel.oneapi.win.cpp-dpcpp-common
24+
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler
25+
WINDOWS_DPCPP_COMPONENTS: intel.oneapi.win.cpp-dpcpp-common
26+
LINUX_CPP_COMPONENTS: intel-oneapi-dpcpp-cpp-compiler
27+
LINUX_FORTRAN_COMPONENTS: intel-oneapi-compiler-fortran
28+
LINUX_DPCPP_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp
29+
LINUX_CPP_COMPONENTS_WEB: intel.oneapi.lin.dpcpp-cpp-compiler
30+
LINUX_FORTRAN_COMPONENTS_WEB: intel.oneapi.lin.ifort-compiler
31+
LINUX_DPCPP_COMPONENTS_WEB: intel.oneapi.lin.dpcpp-cpp-compiler
32+
MACOS_CPP_COMPONENTS: intel.oneapi.mac.cpp-compiler
33+
MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler
34+
CACHE_NUMBER: 6
35+
SAMPLES_TAG: 2024.1.0
36+
COMPILER_VERSION: 2024.1.0
37+
TBB_VERSION: 2021.12.0
38+
VS_VER: vs2022
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os:
43+
- windows-2022
44+
toolset:
45+
- v142
46+
- v143
47+
runs-on: ${{matrix.os}}
48+
49+
steps:
50+
- uses: actions/checkout@master
51+
with:
52+
repository: bluequartzsoftware/bcls
53+
path: ./SDK/bcls
54+
ref: refs/heads/develop
55+
- uses: actions/checkout@master
56+
with:
57+
repository: bluequartzsoftware/clfortran
58+
path: ./SDK/clfortran
59+
ref: refs/heads/develop
60+
61+
- uses: actions/checkout@v2
62+
- name: cache install
63+
id: cache-install
64+
uses: actions/cache@v2
65+
with:
66+
path: |
67+
C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat
68+
C:\Program Files (x86)\Intel\oneAPI\compiler
69+
key: install-${{ env.CACHE_NUMBER }}-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler-${{ hashFiles('**/scripts/cache_exclude_windows.sh') }}
70+
- name: install
71+
if: steps.cache-install.outputs.cache-hit != 'true'
72+
run: .github/scripts/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS
73+
- name: Configure
74+
run: |
75+
cmake --preset ci-windows-${{matrix.toolset}} ${{github.workspace}}
76+
# - name: build
77+
# run: .github/scripts/build_windows.bat fortran $VS_VER $SAMPLES_TAG
78+
- name: exclude unused files from cache
79+
if: steps.cache-install.outputs.cache-hit != 'true'
80+
shell: bash
81+
run: .github/scripts/cache_exclude_windows.sh
82+
83+
# Delete the following if you don't want to save install logs
84+
- name: Saving install logs
85+
if: steps.cache-install.outputs.cache-hit != 'true'
86+
uses: actions/upload-artifact@v2
87+
with:
88+
name: InstallLogs_${{ github.job }}
89+
path: |
90+
extract.log
91+
bootstrapper*
92+
installer*
93+
retention-days: 7

CMakePresets.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"version": 3,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 26,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "ci",
11+
"displayName": "CI build",
12+
"description": "Build configuration for GitHub Actions CI",
13+
"generator": "Ninja",
14+
"binaryDir": "${sourceDir}/build",
15+
"cacheVariables": {
16+
}
17+
},
18+
{
19+
"name": "ci-windows-v142",
20+
"displayName": "ci-windows-v142",
21+
"description": "Build configuration for GitHub Actions CI",
22+
"generator": "NMake Makefiles",
23+
"inherits": "ci",
24+
"cacheVariables": {
25+
}
26+
},
27+
{
28+
"name": "ci-windows-v143",
29+
"displayName": "ci-windows-v143",
30+
"description": "Build configuration for GitHub Actions CI",
31+
"generator": "NMake Makefiles",
32+
"inherits": "ci",
33+
"cacheVariables": {
34+
}
35+
}
36+
],
37+
"buildPresets": [
38+
{
39+
"name": "ci-windows-v142",
40+
"displayName": "ci-windows-v142 Release build",
41+
"description": "Build configuration for GitHub actions CI",
42+
"configurePreset": "ci-windows-v142",
43+
"configuration": "Release"
44+
},
45+
{
46+
"name": "ci-windows-v143",
47+
"displayName": "ci-windows-v143 CI build",
48+
"description": "Build configuration for GitHub actions CI",
49+
"configurePreset": "ci-windows-v143",
50+
"configuration": "Release"
51+
}
52+
],
53+
"testPresets": [
54+
{
55+
"name": "ci-windows-v142",
56+
"displayName": "ci-windows-v142 CI build",
57+
"description": "Build configuration for GitHub actions CI",
58+
"configurePreset": "ci-windows-v142",
59+
"configuration": "Release",
60+
"output": {
61+
"outputOnFailure": true
62+
}
63+
},
64+
{
65+
"name": "ci-windows-v143",
66+
"displayName": "ci-windows-v143 CI build",
67+
"description": "Build configuration for GitHub actions CI",
68+
"configurePreset": "ci-windows-v143",
69+
"configuration": "Release",
70+
"output": {
71+
"outputOnFailure": true
72+
}
73+
}
74+
]
75+
}
76+

0 commit comments

Comments
 (0)