blob: ea4f7c7bb37ccc4b3cba72d06db0ff61209dc657 [file]
# Base configuration for windows builds.
# SPDX-FileCopyrightText: The Eigen Authors
# SPDX-License-Identifier: MPL-2.0
.build:windows:
needs: []
extends: [ .common:windows, .artifacts:windows:builddir ]
stage: build
variables:
EIGEN_CI_BUILD_TARGET: buildtests
# Reduce overall build size and compile time.
# Note: -d2ReducedOptimizeHugeFunctions (VS 2019+) uses '-' rather than '/'
# because sccache treats unrecognized '/...' arguments as input file paths.
EIGEN_CI_TEST_CUSTOM_CXX_FLAGS: "-d2ReducedOptimizeHugeFunctions;-DEIGEN_STRONG_INLINE=inline;-Os"
# "off" disables the ccache compiler launchers (see
# build.windows.script.ps1). The script downloads a pinned,
# SHA-256-verified ccache when the runner has none; if that also fails,
# the job builds exactly as before.
EIGEN_CI_CCACHE: "on"
# cache:policy of the .ccache/ pool; see the Linux build template.
EIGEN_CI_CCACHE_POLICY: pull-push
EIGEN_CI_CCACHE_DIR: ${CI_PROJECT_DIR}/.ccache
# Runner-local cache, so no archive-size limit applies; 4G holds a full
# MSVC buildtests run with headroom and only bounds runner disk use.
EIGEN_CI_CCACHE_MAXSIZE: 4G
# Hash compile paths relative to the project directory: absolute paths are
# part of ccache's hash, so without this a checkout-path change (runner
# layout, concurrent build slots) turns every compile into a miss.
EIGEN_CI_CCACHE_BASEDIR: ${CI_PROJECT_DIR}
# Don't re-compress the already-zstd-compressed ccache payload when
# archiving; see the Linux build template for the measured rationale.
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "fastest"
# ccache pool name; see the Linux build template.
EIGEN_CI_CCACHE_POOL: $CI_JOB_NAME_SLUG
script:
- ./ci/scripts/build.windows.script.ps1
after_script: !reference [.windows:stop-sccache, script]
tags:
- eigen-runner
- windows
- x86-64
rules: !reference [.rules:libeigen:all-tests, rules]
# Cache the ccache directory, not ${EIGEN_CI_BUILDDIR}, mirroring
# build.linux.gitlab-ci.yml: ccache keys on file content and compiler, so
# hits survive a re-checkout that re-stamps every source mtime (which made
# the old build-directory cache rebuild everything anyway). Deliberately not
# scoped by EIGEN_CI_CCACHE_SCOPE the way the Linux template is: the Windows
# runner has no shared cache server, so every archive is runner-local and
# nothing ever evicts one. Shared pools are bounded at one archive per job;
# per-merge-request pools would grow without bound, by four MSVC pools per
# `all-tests` merge request (22 of them in the 60 days to 2026-09-03), for
# little gain -- Windows builds run only under a label, so a merge request
# seldom builds here twice. Keys stay split by GitLab's protection suffix as
# described in the Linux template. Both entries push even when the build fails
# (when: always): the retry pipeline after a compile error is exactly where
# hits matter most.
cache:
# The pinned sccache/ccache binaries the build script downloads when the runner has
# none; one shared key so a runner downloads it once for all build jobs.
# Cache content is writable job output, not a trusted source: the script
# re-verifies the binary's SHA-256 on every use before executing it.
- key: "windows-ccache-bin"
paths:
- .ccache-bin/
- .sccache-bin/
when: always
- key: "$EIGEN_CI_CCACHE_POOL-ccache"
paths:
- .ccache/
- .sccache/
policy: $EIGEN_CI_CCACHE_POLICY
when: always
######### MSVC #################################################################
# MSVC 14.29 (VS 2019) 32 bit
build:windows:x86:msvc-14.29:default:
extends: .build:windows
variables:
EIGEN_CI_MSVC_ARCH: "x64_x86"
# MSVC 14.29 (VS 2019) 64 bit
build:windows:x86-64:msvc-14.29:default:
extends: .build:windows
build:windows:x86-64:msvc-14.29:avx2:
extends: .build:windows
variables:
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX2=on"
build:windows:x86-64:msvc-14.29:avx512dq:
extends: .build:windows
variables:
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX512DQ=on"
# MSVC 14.29 (VS 2019) + CUDA
.build:windows:cuda:
extends: .build:windows
# The .cu compiles reach the launcher through CMAKE_CUDA_COMPILER_LAUNCHER;
# see the Linux CUDA template for the rationale.
variables:
# The GPU in the Windows CUDA runner (eigen-windows-testing-001.gcloud) is
# a Tesla L4, sm_89. Eigen has no architecture-dependent device code
# between sm_75 and sm_89, so a second architecture would only double the
# device compile time on a single self-hosted runner. CUDA 13 dropped
# offline compilation for Volta and older; nothing below sm_75 can be
# listed here any more.
EIGEN_CI_CUDA_COMPUTE_ARCH: "89"
EIGEN_CI_BUILD_TARGET: buildtests_gpu
EIGEN_CI_ADDITIONAL_ARGS:
-DEIGEN_TEST_CUDA=on
-DEIGEN_CUDA_COMPUTE_ARCH=${EIGEN_CI_CUDA_COMPUTE_ARCH}
# Name the GPU and driver on this runner first; the arch list above has to
# match it.
before_script:
- nvidia-smi
- . ci/scripts/common.windows.before_script.ps1
rules: !reference [.rules:libeigen:gpu, rules]
tags:
- eigen-runner
- windows
- x86-64
- cuda
# MSVC 14.29 + CUDA 13.0
build:windows:x86-64:cuda-13.0:msvc-14.29:
extends: .build:windows:cuda
variables:
# Pin the toolkit and fail when it is absent. With CUDA_PATH empty,
# FindCUDA falls through to whichever nvcc is first on PATH and the job
# silently builds with a toolkit other than the one in its name.
EIGEN_CI_BEFORE_SCRIPT: >-
if (-not $$env:CUDA_PATH_V13_0) { throw 'CUDA 13.0 is not installed on this runner' };
$$env:CUDA_PATH=$$env:CUDA_PATH_V13_0
######### MR Affected Tests ####################################################
# Opt-in via `affected-tests` plus `windows-tests` or `all-platforms`; see
# .rules:libeigen:affected-tests:windows in ci/common.gitlab-ci.yml. Only MSVC
# x64 at baseline ISA; the wider Windows matrix stays in `all-tests`.
build:windows:x86-64:msvc-14.29:default:affected:
extends: [ build:windows:x86-64:msvc-14.29:default, .affected:build ]
variables:
EIGEN_CI_CCACHE_POOL: build-windows-x86-64-msvc-14-29-default
rules: !reference [.rules:libeigen:affected-tests:windows, rules]
######### MSVC cross-compiled on Linux ########################################
# Builds the Windows unit tests on a Linux runner, driving the real MSVC
# toolchain through Wine. This gives merge requests MSVC coverage without
# occupying the Windows runners; the resulting binaries are run by the matching
# job in test.windows.gitlab-ci.yml.
#
# Note that this is a different MSVC than the native Windows jobs use: it
# matches the hosted Windows runner the tests run on, not EIGEN_CI_MSVC_VER.
.build:windows:cross:
# Publishes the build tree only: setup.msvc-wine.sh installs the toolchain in
# .msvc/ beside it, which must never reach an artifact.
# .smoketest:build keeps the ccache pool shared, as for the Linux smoke builds.
extends: [ .artifacts:windows:builddir, .smoketest:build ]
needs: []
stage: build
image: ${EIGEN_CI_IMAGE_LINUX_AMD64_MSVC_WINE_BUILD}
variables:
EIGEN_CI_MSVC_VS_MAJOR: "17"
# Visual Studio 17.14 == MSVC 14.44 (v143), which is what the hosted Windows
# runners report. Keeping these in step means the binaries run against the
# runtime they were built against. Read the value off a
# test:windows:cross:... job log ("this runner has ...") rather than from
# the runner image's recipe: its chocolatey package version tracks the
# installer, not the toolset the installer pulls.
EIGEN_CI_MSVC_VS_VERSION: "17.14"
# '-' rather than '/', as in .build:windows: sccache treats unrecognized
# '/...' arguments as input file paths.
EIGEN_CI_TEST_CUSTOM_CXX_FLAGS: "-d2ReducedOptimizeHugeFunctions;-DEIGEN_STRONG_INLINE=inline;-Os"
EIGEN_CI_ADDITIONAL_ARGS: ""
# The compiler cache settings of .build:linux:cross, whose cache stanza and
# build script this job reuses; that template explains each value. The pool
# holds MSVC's object files, not the toolchain.
EIGEN_CI_CCACHE: "on"
EIGEN_CI_CCACHE_POLICY: pull-push
EIGEN_CI_CCACHE_DIR: ${CI_PROJECT_DIR}/.ccache
EIGEN_CI_CCACHE_MAXSIZE: 4G
EIGEN_CI_CCACHE_COMPRESSLEVEL: 5
EIGEN_CI_CCACHE_BASEDIR: ${CI_PROJECT_DIR}
EIGEN_CI_CCACHE_POOL: $CI_JOB_NAME_SLUG
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "fastest"
script:
- ./ci/scripts/build.windows-cross.script.sh
tags:
- saas-linux-medium-amd64
cache: !reference [.build:linux:cross, cache]
build:windows:cross:x86-64:msvc-14.44:smoketest:
extends: .build:windows:cross
variables:
EIGEN_CI_BUILD_TARGET: buildsmoketests
rules: !reference [.rules:libeigen:smoketest:msvc-cross, rules]