From f568b75695b570990cc763213294ab6ee5b0a300 Mon Sep 17 00:00:00 2001 From: LeSingh1 Date: Sun, 17 May 2026 18:52:25 -0700 Subject: [PATCH] [cutlass-library] Alias cutlass_lib to the static target when shared is off The legacy `cutlass_lib` ALIAS was only created when CUTLASS_BUILD_SHARED_LIBS=ON. Consumers such as tools/profiler unconditionally link to it, so a static-only configuration (`-DCUTLASS_BUILD_SHARED_LIBS=OFF -DCUTLASS_BUILD_STATIC_LIBS=ON`) loses both the transitive include directories from `cutlass_library_includes` and the link itself -- the profiler then fails to build with: fatal error: cutlass/library/library.h: No such file or directory Fall back to aliasing `cutlass_lib` to the static target when shared is disabled. Behavior when shared is enabled (the default) is unchanged. Fixes #3179 --- tools/library/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/library/CMakeLists.txt b/tools/library/CMakeLists.txt index 39676ca4db..6e8cd67f8d 100644 --- a/tools/library/CMakeLists.txt +++ b/tools/library/CMakeLists.txt @@ -293,9 +293,14 @@ cutlass_add_cutlass_library( ) -# For backward compatibility with the old name +# For backward compatibility with the old name. +# `cutlass_lib` consumers (e.g. tools/profiler) need a single target to link +# against regardless of whether the user opted for a shared or static-only +# build, so fall back to the static target when shared is disabled. if(CUTLASS_BUILD_SHARED_LIBS) add_library(cutlass_lib ALIAS cutlass_library) +elseif(CUTLASS_BUILD_STATIC_LIBS) + add_library(cutlass_lib ALIAS cutlass_library_static) endif() if(CUTLASS_BUILD_STATIC_LIBS)