Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] GitHub CI: Start working on getting a Windows CI working #176

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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%
93 changes: 93 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
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@master
with:
repository: bluequartzsoftware/bcls
path: ./SDK/bcls
ref: refs/heads/develop
- uses: actions/checkout@master
with:
repository: bluequartzsoftware/clfortran
path: ./SDK/clfortran
ref: refs/heads/develop

- 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}}
# - 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
76 changes: 76 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 26,
"patch": 0
},
"configurePresets": [
{
"name": "ci",
"displayName": "CI build",
"description": "Build configuration for GitHub Actions CI",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
}
},
{
"name": "ci-windows-v142",
"displayName": "ci-windows-v142",
"description": "Build configuration for GitHub Actions CI",
"generator": "NMake Makefiles",
"inherits": "ci",
"cacheVariables": {
}
},
{
"name": "ci-windows-v143",
"displayName": "ci-windows-v143",
"description": "Build configuration for GitHub Actions CI",
"generator": "NMake Makefiles",
"inherits": "ci",
"cacheVariables": {
}
}
],
"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": [
{
"name": "ci-windows-v142",
"displayName": "ci-windows-v142 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v142",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
},
{
"name": "ci-windows-v143",
"displayName": "ci-windows-v143 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v143",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
}
]
}

Loading