Skip to content

Commit

Permalink
GitHub CI: Start working on getting a Windows CI working
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information
imikejackson committed May 22, 2024
1 parent d4f6f91 commit 9c817a8
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/scripts/build_windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
REM SPDX-FileCopyrightText: 2022 Intel Corporation
REM
REM SPDX-License-Identifier: MIT

set LANGUAGE=%1
set VS_VER=%2
set SAMPLES_TAG=%3

IF "%VS_VER%"=="2017_build_tools" (
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
) ELSE (
IF "%VS_VER%"=="2019_build_tools" (
@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
) ELSE (
@call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat" %VS_VER%
)
)

for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\compiler\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f"
@call "C:\Program Files (x86)\Intel\oneAPI\compiler\%LATEST_VERSION%\env\vars.bat"

git clone --depth 1 --branch %SAMPLES_TAG% https://github.com/oneapi-src/oneAPI-samples.git

if "%LANGUAGE%" == "c++" goto cpp
if "%LANGUAGE%" == "fortran" goto fortran
if "%LANGUAGE%" == "dpc++" goto dpcpp
goto exit


:fortran
cd oneAPI-samples\DirectProgramming\Fortran\CombinationalLogic\openmp-primes
ifort -O2 -fpp /Qopenmp src\openmp_sample.f90
openmp_sample.exe
set RESULT=%ERRORLEVEL%
ifx -O2 -fpp /Qopenmp src\openmp_sample.f90
openmp_sample.exe
set /a RESULT=%RESULT%+%ERRORLEVEL%
goto exit



:exit
exit /b %RESULT%
15 changes: 15 additions & 0 deletions .github/scripts/cache_exclude_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

#shellcheck disable=SC2010
LATEST_VERSION=$(ls -1 "C:\Program Files (x86)\Intel\oneAPI\compiler" | grep -v latest | sort | tail -1)

rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\compiler\lib\ia32_win"
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\bin\intel64_ia32"
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\emu"
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\oclfpga"
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\ocloc"
rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\x86"
18 changes: 18 additions & 0 deletions .github/scripts/install_windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
REM SPDX-FileCopyrightText: 2022 Intel Corporation
REM
REM SPDX-License-Identifier: MIT

set URL=%1
set COMPONENTS=%2

curl.exe --output %TEMP%\webimage.exe --url %URL% --retry 5 --retry-delay 5
start /b /wait %TEMP%\webimage.exe -s -x -f webimage_extracted --log extract.log
del %TEMP%\webimage.exe
if "%COMPONENTS%"=="" (
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=.
) else (
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=.
)
set installer_exit_code=%ERRORLEVEL%
rd /s/q "webimage_extracted"
exit /b %installer_exit_code%
82 changes: 82 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: windows

on:
pull_request:
branches:
- develop
- master
push:
branches:
- develop
- master

jobs:
build:
env:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
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
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
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
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
LINUX_AIKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0414ef18-5b64-47f2-9b2e-ae94860272b9/l_AITools.2024.1.0.9.sh
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
WINDOWS_CPP_COMPONENTS: intel.oneapi.win.cpp-dpcpp-common
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler
WINDOWS_DPCPP_COMPONENTS: intel.oneapi.win.cpp-dpcpp-common
LINUX_CPP_COMPONENTS: intel-oneapi-dpcpp-cpp-compiler
LINUX_FORTRAN_COMPONENTS: intel-oneapi-compiler-fortran
LINUX_DPCPP_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp
LINUX_CPP_COMPONENTS_WEB: intel.oneapi.lin.dpcpp-cpp-compiler
LINUX_FORTRAN_COMPONENTS_WEB: intel.oneapi.lin.ifort-compiler
LINUX_DPCPP_COMPONENTS_WEB: intel.oneapi.lin.dpcpp-cpp-compiler
MACOS_CPP_COMPONENTS: intel.oneapi.mac.cpp-compiler
MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler
CACHE_NUMBER: 6
SAMPLES_TAG: 2024.1.0
COMPILER_VERSION: 2024.1.0
TBB_VERSION: 2021.12.0
VS_VER: vs2022
strategy:
fail-fast: false
matrix:
os:
- windows-2022
toolset:
- v142
- v143
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v2
- name: cache install
id: cache-install
uses: actions/cache@v2
with:
path: |
C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat
C:\Program Files (x86)\Intel\oneAPI\compiler
key: install-${{ env.CACHE_NUMBER }}-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler-${{ hashFiles('**/scripts/cache_exclude_windows.sh') }}
- name: install
if: steps.cache-install.outputs.cache-hit != 'true'
run: .github/scripts/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS
- name: Configure
run: |
cmake --preset ci-windows-${{matrix.toolset}} ${{github.workspace}} -T ${{matrix.toolset}}
# - name: build
# run: .github/scripts/build_windows.bat fortran $VS_VER $SAMPLES_TAG
- name: exclude unused files from cache
if: steps.cache-install.outputs.cache-hit != 'true'
shell: bash
run: .github/scripts/cache_exclude_windows.sh

# Delete the following if you don't want to save install logs
- name: Saving install logs
if: steps.cache-install.outputs.cache-hit != 'true'
uses: actions/upload-artifact@v2
with:
name: InstallLogs_${{ github.job }}
path: |
extract.log
bootstrapper*
installer*
retention-days: 7
64 changes: 64 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 24,
"patch": 0
},
"configurePresets":[
{
"name": "ci",
"displayName": "CI build",
"description": "Build configuration for GitHub Actions CI",
"generator": "NMake Makefiles",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
},
"bcls_DIR": {
"type": "PATH",
"value": "C:/Unknown"
},
"CLFORTRAN_DIR": {
"type": "PATH",
"value": "C:/Unknown"
},
"EIGEN_INSTALL": {
"type": "PATH",
"value": "C:/Unknown"
},
"FFTW3_INSTALL": {
"type": "PATH",
"value": "C:/Unknown"
},
"HDF5_DIR": {
"type": "PATH",
"value": "C:/Unknown"
},
"JSONFORTRAN_DIR": {
"type": "PATH",
"value": "C:/Unknown"
}
}
}
],
"buildPresets": [
{
"name": "ci-windows-v142",
"displayName": "ci-windows-v142 Release build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v142",
"configuration": "Release"
},
{
"name": "ci-windows-v143",
"displayName": "ci-windows-v143 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v143",
"configuration": "Release"
}
],
"testPresets": []
}

0 comments on commit 9c817a8

Please sign in to comment.