From f85e5423c0c54be57872363bd9233923660c21f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 11:49:56 +0000 Subject: [PATCH 1/6] Initial plan From 01ab2efdb4cb81cb4dd95dee4f5de8f66ff4955a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:01:11 +0100 Subject: [PATCH 2/6] build(msvc): enable faster debug info and linking defaults Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com> --- CMakeLists.txt | 8 ++++++++ README.md | 2 ++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9cccd0773..47488ce88a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,14 @@ include_directories( external) if (MSVC) + option(ALIEN_MSVC_FAST_BUILD "Enable faster MSVC debug info generation and linking for local development builds" ON) + if (ALIEN_MSVC_FAST_BUILD) + # Prefer /Z7 over /Zi in Debug/RelWithDebInfo to reduce PDB writer contention with /MP. + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") + # Reduce debug link time in Visual Studio builds. + add_link_options($<$:/DEBUG:FASTLINK>) + endif() + # Suppress `warning C4005: 'FOO': macro redefinition` add_compile_options($<$:-wd4005>) diff --git a/README.md b/README.md index 70a4afa893..725a4b4d24 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release -j8 ``` +On MSVC, CMake enables `ALIEN_MSVC_FAST_BUILD=ON` by default, which uses `/Z7` for Debug/RelWithDebInfo and `/DEBUG:FASTLINK` to shorten local incremental build times. + If everything goes well, the ALIEN executable can be found under the build directory in `./alien` or `.\Release\alien.exe` depending on the used toolchain and platform. It is important to start ALIEN directly from the build folder, otherwise it will not find the resource folder. From d3085d0476a24251d0ee918b933ba2f7756821d1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:16:05 +0100 Subject: [PATCH 3/6] build: speed release by removing CUDA debug flags from Release Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com> --- CMakeLists.txt | 4 +++- README.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47488ce88a..5ca789dc30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,9 @@ set(CMAKE_CUDA_STANDARD 20) set(CMAKE_CUDA_STANDARD_REQUIRED ON) set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) -set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g -lineinfo --use-local-env -use_fast_math") +set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use-local-env -use_fast_math") +set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -lineinfo") +set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "${CMAKE_CUDA_FLAGS_RELWITHDEBINFO} -lineinfo") project(alien-project LANGUAGES C CXX CUDA) diff --git a/README.md b/README.md index 725a4b4d24..3c40e0b0da 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release -j8 ``` On MSVC, CMake enables `ALIEN_MSVC_FAST_BUILD=ON` by default, which uses `/Z7` for Debug/RelWithDebInfo and `/DEBUG:FASTLINK` to shorten local incremental build times. +Release builds no longer include CUDA debug info flags by default (`-g`, `-lineinfo`), which shortens release compile times (including MSVC toolchains). If everything goes well, the ALIEN executable can be found under the build directory in `./alien` or `.\Release\alien.exe` depending on the used toolchain and platform. It is important to start ALIEN directly from the build folder, otherwise it will not find the resource folder. From 8deedf313b54960b61438cfa501a39f89a733237 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:30:38 +0100 Subject: [PATCH 4/6] build: add fast MSVC release-link defaults for local iteration Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com> --- CMakeLists.txt | 8 ++++++++ README.md | 1 + 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ca789dc30..4ce8128fa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,14 @@ if (MSVC) add_link_options($<$:/DEBUG:FASTLINK>) endif() + option(ALIEN_MSVC_FAST_RELEASE_BUILD "Enable faster MSVC release linking for local development builds" ON) + if (ALIEN_MSVC_FAST_RELEASE_BUILD) + # Favor release link throughput over final binary size/optimization for local iteration. + add_link_options($<$:/INCREMENTAL>) + add_link_options($<$:/OPT:NOREF>) + add_link_options($<$:/OPT:NOICF>) + endif() + # Suppress `warning C4005: 'FOO': macro redefinition` add_compile_options($<$:-wd4005>) diff --git a/README.md b/README.md index 3c40e0b0da..9cf5bf5b03 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ cmake --build . --config Release -j8 ``` On MSVC, CMake enables `ALIEN_MSVC_FAST_BUILD=ON` by default, which uses `/Z7` for Debug/RelWithDebInfo and `/DEBUG:FASTLINK` to shorten local incremental build times. Release builds no longer include CUDA debug info flags by default (`-g`, `-lineinfo`), which shortens release compile times (including MSVC toolchains). +For MSVC, `ALIEN_MSVC_FAST_RELEASE_BUILD=ON` is also enabled by default and favors faster Release links using `/INCREMENTAL`, `/OPT:NOREF`, and `/OPT:NOICF` for local iteration. If everything goes well, the ALIEN executable can be found under the build directory in `./alien` or `.\Release\alien.exe` depending on the used toolchain and platform. It is important to start ALIEN directly from the build folder, otherwise it will not find the resource folder. From 63583ec9973c11358a69704650a03dd5054b7c6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 22:17:31 +0100 Subject: [PATCH 5/6] build: avoid MSVC release warning and cut VS module scan overhead Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com> --- CMakeLists.txt | 12 ++++++++---- README.md | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ce8128fa0..25c3d88255 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,12 +39,16 @@ if (MSVC) add_link_options($<$:/DEBUG:FASTLINK>) endif() + option(ALIEN_MSVC_DISABLE_MODULE_SCAN "Disable MSVC C++ module scanning for faster non-module builds" ON) + if (ALIEN_MSVC_DISABLE_MODULE_SCAN) + # This project does not use C++ modules; dependency scanning adds avoidable overhead in Visual Studio builds. + set(CMAKE_CXX_SCAN_FOR_MODULES OFF) + endif() + option(ALIEN_MSVC_FAST_RELEASE_BUILD "Enable faster MSVC release linking for local development builds" ON) if (ALIEN_MSVC_FAST_RELEASE_BUILD) - # Favor release link throughput over final binary size/optimization for local iteration. - add_link_options($<$:/INCREMENTAL>) - add_link_options($<$:/OPT:NOREF>) - add_link_options($<$:/OPT:NOICF>) + # Improve /GL + /LTCG release link throughput without forcing /INCREMENTAL. + add_link_options($<$:/LTCG:INCREMENTAL>) endif() # Suppress `warning C4005: 'FOO': macro redefinition` diff --git a/README.md b/README.md index 9cf5bf5b03..98d510199b 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,8 @@ cmake --build . --config Release -j8 ``` On MSVC, CMake enables `ALIEN_MSVC_FAST_BUILD=ON` by default, which uses `/Z7` for Debug/RelWithDebInfo and `/DEBUG:FASTLINK` to shorten local incremental build times. Release builds no longer include CUDA debug info flags by default (`-g`, `-lineinfo`), which shortens release compile times (including MSVC toolchains). -For MSVC, `ALIEN_MSVC_FAST_RELEASE_BUILD=ON` is also enabled by default and favors faster Release links using `/INCREMENTAL`, `/OPT:NOREF`, and `/OPT:NOICF` for local iteration. +For MSVC, `ALIEN_MSVC_DISABLE_MODULE_SCAN=ON` is enabled by default to skip C++ module dependency scanning in non-module builds and reduce compile overhead in Visual Studio. +`ALIEN_MSVC_FAST_RELEASE_BUILD=ON` is also enabled by default and uses `/LTCG:INCREMENTAL` for faster local Release links without forcing `/INCREMENTAL`. If everything goes well, the ALIEN executable can be found under the build directory in `./alien` or `.\Release\alien.exe` depending on the used toolchain and platform. It is important to start ALIEN directly from the build folder, otherwise it will not find the resource folder. From 3a13342415ef70c67f0813d46adf983384632549 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 20:06:15 +0100 Subject: [PATCH 6/6] build: scope msvc fast-link flags to real linker targets Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com> --- CMakeLists.txt | 15 +++++++++++---- README.md | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25c3d88255..8bdc6065f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,8 +35,13 @@ if (MSVC) if (ALIEN_MSVC_FAST_BUILD) # Prefer /Z7 over /Zi in Debug/RelWithDebInfo to reduce PDB writer contention with /MP. set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") - # Reduce debug link time in Visual Studio builds. - add_link_options($<$:/DEBUG:FASTLINK>) + # Reduce debug link time in Visual Studio builds for real linker invocations. + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /DEBUG:FASTLINK") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG " /DEBUG:FASTLINK") + string(APPEND CMAKE_MODULE_LINKER_FLAGS_DEBUG " /DEBUG:FASTLINK") + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO " /DEBUG:FASTLINK") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO " /DEBUG:FASTLINK") + string(APPEND CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO " /DEBUG:FASTLINK") endif() option(ALIEN_MSVC_DISABLE_MODULE_SCAN "Disable MSVC C++ module scanning for faster non-module builds" ON) @@ -47,8 +52,10 @@ if (MSVC) option(ALIEN_MSVC_FAST_RELEASE_BUILD "Enable faster MSVC release linking for local development builds" ON) if (ALIEN_MSVC_FAST_RELEASE_BUILD) - # Improve /GL + /LTCG release link throughput without forcing /INCREMENTAL. - add_link_options($<$:/LTCG:INCREMENTAL>) + # Improve /GL + /LTCG release link throughput for real linker invocations. + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " /LTCG:INCREMENTAL") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE " /LTCG:INCREMENTAL") + string(APPEND CMAKE_MODULE_LINKER_FLAGS_RELEASE " /LTCG:INCREMENTAL") endif() # Suppress `warning C4005: 'FOO': macro redefinition` diff --git a/README.md b/README.md index 98d510199b..f9dcbb70ef 100644 --- a/README.md +++ b/README.md @@ -94,10 +94,10 @@ mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release -j8 ``` -On MSVC, CMake enables `ALIEN_MSVC_FAST_BUILD=ON` by default, which uses `/Z7` for Debug/RelWithDebInfo and `/DEBUG:FASTLINK` to shorten local incremental build times. +On MSVC, CMake enables `ALIEN_MSVC_FAST_BUILD=ON` by default, which uses `/Z7` for Debug/RelWithDebInfo and applies `/DEBUG:FASTLINK` on executable/shared/module link steps to shorten local incremental build times. Release builds no longer include CUDA debug info flags by default (`-g`, `-lineinfo`), which shortens release compile times (including MSVC toolchains). For MSVC, `ALIEN_MSVC_DISABLE_MODULE_SCAN=ON` is enabled by default to skip C++ module dependency scanning in non-module builds and reduce compile overhead in Visual Studio. -`ALIEN_MSVC_FAST_RELEASE_BUILD=ON` is also enabled by default and uses `/LTCG:INCREMENTAL` for faster local Release links without forcing `/INCREMENTAL`. +`ALIEN_MSVC_FAST_RELEASE_BUILD=ON` is also enabled by default and applies `/LTCG:INCREMENTAL` on executable/shared/module link steps for faster local Release links without forcing `/INCREMENTAL`. If everything goes well, the ALIEN executable can be found under the build directory in `./alien` or `.\Release\alien.exe` depending on the used toolchain and platform. It is important to start ALIEN directly from the build folder, otherwise it will not find the resource folder.