blob: 16e10047d50d56dda2c44dc3de6076afe3f8dc43 [file]
name: Windows
on: [push, pull_request]
jobs:
build-mingw:
name: ${{matrix.sys}}-${{matrix.env}}-${{matrix.build_type}}-${{matrix.lib}}
runs-on: windows-2025
defaults:
run:
shell: msys2 {0}
env:
CCACHE_DIR: ${{github.workspace}}/ccache
strategy:
fail-fast: true
matrix:
build_type: [Release]
sys: [ucrt64]
lib: [shared, static]
include:
- sys: ucrt64
env: ucrt-x86_64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Dependencies
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: >-
mingw-w64-${{matrix.env}}-ccache
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-eigen3
mingw-w64-${{matrix.env}}-gcc
${{matrix.sys == 'ucrt64' && format('mingw-w64-{0}-metis', matrix.env) || ''}}
mingw-w64-${{matrix.env}}-ninja
mingw-w64-${{matrix.env}}-suitesparse
- name: Cache Build
id: cache-build
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: ${{runner.os}}-${{matrix.sys}}-${{matrix.env}}-${{matrix.build_type}}-${{matrix.lib}}-ccache-${{github.run_id}}
restore-keys: ${{runner.os}}-${{matrix.sys}}-${{matrix.env}}-${{matrix.build_type}}-${{matrix.lib}}-ccache-
- name: Configure
run: |
cmake -S . -B build_${{matrix.build_type}}/ \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_C_COMPILER_LAUNCHER:FILEPATH=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER:FILEPATH=ccache \
-DWITH_SUITESPARSE=ON \
-G Ninja
- name: Build
run: |
cmake --build build_${{matrix.build_type}}/ \
--config ${{matrix.build_type}}
- name: Test
run: |
cd build_${{matrix.build_type}}/
ctest --build-config ${{matrix.build_type}} \
--output-on-failure \
-j$(nproc)
- name: Install
run: |
cmake --build build_${{matrix.build_type}}/ \
--config ${{matrix.build_type}} \
--target install
build-msvc:
name: ${{matrix.msvc}}-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.gpu}}
runs-on: ${{matrix.os}}
defaults:
run:
shell: powershell
env:
CCACHE_DIR: ${{github.workspace}}/ccache
CMAKE_GENERATOR: ${{matrix.generator}}
CMAKE_GENERATOR_PLATFORM: ${{matrix.arch}}
strategy:
fail-fast: true
matrix:
arch:
- x64
build_type:
- Release
msvc:
- VS-18-2026
lib:
- shared
gpu:
- cuda
- no-cuda
include:
- msvc: VS-18-2026
os: windows-2025-vs2026
generator: 'Visual Studio 18 2026'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache CUDA toolkit
if: matrix.gpu == 'cuda'
id: cache-cuda
uses: actions/cache@v4
with:
path: |
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.5
C:/Program Files/Microsoft Visual Studio/18/Enterprise/MSBuild/Microsoft/VC/v180/BuildCustomizations
key: ${{runner.os}}-${{matrix.msvc}}-cuda-13.5.0-v1
- name: Download and install CUDA toolkit
if: matrix.gpu == 'cuda' && steps.cache-cuda.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest https://developer.download.nvidia.com/compute/cuda/13.5.0/network_installers/cuda_13.5.0_windows_x86_64_network.exe -OutFile cuda_toolkit_windows.exe
Start-Process -Wait -FilePath .\cuda_toolkit_windows.exe -ArgumentList "-s crt_13.5 cusolver_dev_13.5 cusparse_dev_13.5 cublas_dev_13.5 cccl_13.5 nvcc_13.5 nvvm_13.5 cudart_13.5 nvrtc_dev_13.5 visual_studio_integration_13.5"
Remove-Item .\cuda_toolkit_windows.exe
- name: Setup CUDA environment
if: matrix.gpu == 'cuda'
run: |
$CUDA_PATH = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.5"
echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CUDA_PATH_V13_5=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$CUDA_PATH/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Cache cuDSS
if: matrix.gpu == 'cuda'
id: cache-cudss
uses: actions/cache@v4
with:
path: ${{github.workspace}}/libcudss-windows-x86_64-1.0.0.35_cuda13-archive
key: ${{runner.os}}-${{matrix.msvc}}-cudss-1.0.0.35-cuda13-v1
- name: Download and extract cuDSS
if: matrix.gpu == 'cuda' && steps.cache-cudss.outputs.cache-hit != 'true'
run: |
$CUDSS_ARCHIVE = "${{github.workspace}}/libcudss-windows-x86_64-1.0.0.35_cuda13-archive.zip"
Invoke-WebRequest https://developer.download.nvidia.com/compute/cudss/redist/libcudss/windows-x86_64/libcudss-windows-x86_64-1.0.0.35_cuda13-archive.zip -OutFile $CUDSS_ARCHIVE
Expand-Archive -Path $CUDSS_ARCHIVE -DestinationPath "${{github.workspace}}"
Remove-Item $CUDSS_ARCHIVE
- name: Setup cuDSS environment
if: matrix.gpu == 'cuda'
run: |
$WORKSPACE = "${{github.workspace}}" -replace '\\', '/'
echo "cudss_DIR=$WORKSPACE/libcudss-windows-x86_64-1.0.0.35_cuda13-archive/lib/cmake/cudss" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo '${{github.workspace}}\libcudss-windows-x86_64-1.0.0.35_cuda13-archive\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Cache OpenBLAS
id: cache-openblas
uses: actions/cache@v4
with:
path: openblas/
key: ${{runner.os}}-openblas-0.3.34-${{matrix.arch}}
- name: Download OpenBLAS
if: steps.cache-openblas.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.34/OpenBLAS-0.3.34-x64.zip -OutFile openblas.zip
Expand-Archive -Path openblas.zip -DestinationPath ${{github.workspace}}/openblas
Remove-Item openblas.zip
- name: Setup OpenBLAS environment
run: |
echo '${{github.workspace}}\openblas\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Cache SuiteSparse
id: cache-suitesparse
uses: actions/cache@v4
with:
path: suitesparse/
key: ${{matrix.msvc}}-suitesparse-7.14.1-openblas-0.3.34-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}
- name: Download and build SuiteSparse
if: steps.cache-suitesparse.outputs.cache-hit != 'true'
run: |
$ProgressPreference = 'SilentlyContinue'
$WORKSPACE = "${{github.workspace}}" -replace '\\', '/'
Invoke-WebRequest https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v7.14.1.tar.gz -OutFile suitesparse.tar.gz
& "$env:SystemRoot\System32\tar.exe" -xf suitesparse.tar.gz
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Remove-Item suitesparse.tar.gz
cmake -S SuiteSparse-7.14.1 -B build-suitesparse `
-DBLA_VENDOR=OpenBLAS `
"-DBLAS_INCLUDE_DIRS=$WORKSPACE/openblas/include" `
"-DBLAS_LIBRARIES=$WORKSPACE/openblas/lib/libopenblas.lib" `
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} `
-DBUILD_STATIC_LIBS=${{matrix.lib == 'static'}} `
-DCMAKE_CONFIGURATION_TYPES=${{matrix.build_type}} `
"-DCMAKE_INSTALL_PREFIX=$WORKSPACE/suitesparse" `
"-DLAPACK_LIBRARIES=$WORKSPACE/openblas/lib/libopenblas.lib" `
'-DSUITESPARSE_C_TO_FORTRAN=(name,NAME) name##_' `
-DSUITESPARSE_DEMOS=OFF `
'-DSUITESPARSE_ENABLE_PROJECTS=cholmod;spqr' `
-DSUITESPARSE_USE_CUDA=OFF `
-DSUITESPARSE_USE_FORTRAN=OFF `
-DSUITESPARSE_USE_OPENMP=OFF
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build-suitesparse `
--config ${{matrix.build_type}} `
--target install `
--parallel
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Remove-Item -Recurse -Force SuiteSparse-7.14.1, build-suitesparse
- name: Cache Eigen
id: cache-eigen
uses: actions/cache@v4
with:
path: eigen/
key: ${{runner.os}}-eigen-3.4.0
- name: Download Eigen
if: steps.cache-eigen.outputs.cache-hit != 'true'
run: |
(New-Object System.Net.WebClient).DownloadFile("https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip", "eigen-3.4.0.zip");
& "$env:SystemRoot\System32\tar.exe" -xf eigen-3.4.0.zip;
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Setup Eigen
if: steps.cache-eigen.outputs.cache-hit != 'true'
run: |
$WORKSPACE = "${{github.workspace}}" -replace '\\', '/'
cmake -S eigen-3.4.0 -B build-eigen `
-DBUILD_TESTING=OFF `
-DCMAKE_Fortran_COMPILER= `
"-DCMAKE_INSTALL_PREFIX=$WORKSPACE/eigen" `
-DEIGEN_BUILD_DOC=OFF
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build-eigen `
--config ${{matrix.build_type}} `
--target install
- name: Setup Build Environment
run: |
$WORKSPACE = "${{github.workspace}}" -replace '\\', '/'
echo "Eigen3_ROOT=$WORKSPACE/eigen" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CMAKE_PREFIX_PATH=$WORKSPACE/suitesparse" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup Runtime Environment
run: |
echo '${{github.workspace}}\suitesparse\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Cache ccache binary
id: cache-ccache-bin
uses: actions/cache@v4
with:
path: ccache-4.10.2-windows-x86_64/
key: ${{runner.os}}-ccache-bin-4.10.2
- name: Download ccache
if: steps.cache-ccache-bin.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-windows-x86_64.zip -OutFile ccache.zip
Expand-Archive -Path ccache.zip -DestinationPath .
Copy-Item ccache-4.10.2-windows-x86_64/ccache.exe ccache-4.10.2-windows-x86_64/cl.exe
Remove-Item ccache.zip
- name: Cache Build
id: cache-build
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: ${{runner.os}}-${{matrix.msvc}}-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.gpu}}-ccache-${{github.run_id}}
restore-keys: ${{runner.os}}-${{matrix.msvc}}-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.gpu}}-ccache-
- name: Configure
run: |
$WORKSPACE = "${{github.workspace}}" -replace '\\', '/'
cmake -S . -B build_${{matrix.build_type}}/ `
"-DBLAS_blas_LIBRARY=$WORKSPACE/openblas/lib/libopenblas.lib" `
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} `
-DCMAKE_CONFIGURATION_TYPES=${{matrix.build_type}} `
"-DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/install" `
"-DCMAKE_VS_GLOBALS=CLToolExe=cl.exe;CLToolPath=${{github.workspace}}\ccache-4.10.2-windows-x86_64;TrackFileAccess=false;UseMultiToolTask=true;DebugInformationFormat=OldStyle" `
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded `
"-DLAPACK_lapack_LIBRARY=$WORKSPACE/openblas/lib/libopenblas.lib" `
-DWITH_SUITESPARSE=ON
- name: Build
run: |
cmake --build build_${{matrix.build_type}}/ `
--config ${{matrix.build_type}}
- name: Test
if: matrix.gpu == 'no-cuda'
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: |
cmake --build build_${{matrix.build_type}}/ `
--config ${{matrix.build_type}} `
--target RUN_TESTS
- name: Install
run: |
cmake --build build_${{matrix.build_type}}/ `
--config ${{matrix.build_type}} `
--target INSTALL