[cutlass-library] Alias cutlass_lib to the static target when shared is off (fixes #3179)#3245
Open
LeSingh1 wants to merge 1 commit into
Open
Conversation
…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 NVIDIA#3179
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When CUTLASS is built with a static-only configuration (
-DCUTLASS_BUILD_SHARED_LIBS=OFF -DCUTLASS_BUILD_STATIC_LIBS=ON),tools/profilerfails to compile:Root cause
In
tools/library/CMakeLists.txtthe legacycutlass_libALIAS is only created whenCUTLASS_BUILD_SHARED_LIBS=ON:But
tools/profiler/CMakeLists.txtunconditionally consumes it (line 89):When shared is disabled,
cutlass_libdoesn't exist; CMake silently treats it as a plain-lcutlass_liblinker flag, so the transitive include directories fromcutlass_library_includes(which exposetools/library/include/) are never propagated, hence the missing-header error.Fix
Fall back to aliasing
cutlass_libto the static target when shared is disabled:Behavior when
SHARED_LIBS=ON(the default and most common configuration) is unchanged.Verification
I don't have a CUDA build environment on this machine, so I have not run a full static-only build locally. The diff matches the diagnosis in the issue body verbatim, and the change is local to a single backwards-compatibility alias.
Issue
Fixes #3179