mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #437] Fix unknown CMake command "cuda_add_library" in CMakeLists.txt #446
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#446
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/437
Author: @PerryLink
Created: 9/10/2026
Status: 🔄 Open
Base:
main← Head:fix/undefined-cuda-add-library📝 Commits (1)
b4dd001Fix unknown CMake command "cuda_add_library" in CMakeLists.txt📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
CMakeLists.txt(+1 -1)📄 Description
CMakeLists.txtcannot configure: line 32 (nv_dev) / line 34 (main) callscuda_add_library(), which is a macro from the deprecatedFindCUDAmodule — but the file never loads that module; it only callsfind_package(CUDAToolkit)on line 16. CMake aborts with:That is fatal at configure time, so the CLion indexing support this file was added for has never worked —
cuda_add_libraryis present in the file as far back as5bda2724("Add CMake support for CLion indexing"), andfind_package(CUDA)appears in no revision of it.Reproduction
On CMake 4.4.3 a reduced case is enough — no CUDA toolkit and no torch required:
Root cause
FindCUDAdefines the command only afterfind_package(CUDA), which appears in no revision of this file:The rest of the file is already on the modern path (
project(... LANGUAGES CXX CUDA)line 3,CMAKE_CUDA_STANDARDline 22,find_package(CUDAToolkit)line 16), soFindCUDAis simply never pulled in.Fix
Plain
add_library()is the right form:CUDAis already listed inproject(... LANGUAGES ...), so the.cusource still goes through nvcc withoutFindCUDA.I deliberately did not add
find_package(CUDA).FindCUDAhas been deprecated since CMake 3.10, and withCMP0146set toNEW(or oncecmake_minimum_requiredreaches 3.27)find_package(CUDA)defines nothing and the error comes straight back:It would also contradict the
CUDAToolkitusage on line 16.Verification
Same reduced case with the one-line change:
Note
Lines 7-10 (
CUDA_SEPARABLE_COMPILATION,CUDA_NVCC_FLAGS) areFindCUDAvariables too and are currently no-ops for the same reason. I left them out to keep this to one line — happy to send that as a separate PR if you want it.Base branch
Targeting
main(the default branch).nv_devcarries the same broken line but is 108 commits ahead ofmain, so this one-line change was rebased ontomainrather than moved across; the identical change applies tonv_devif you would rather take it there.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.