File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 11# Copyright (c) OpenMMLab. All rights reserved.
22
33cmake_minimum_required (VERSION 3.8)
4- project (_turbomind)
4+ project (_turbomind LANGUAGES CXX CUDA )
55
66find_package (pybind11 CONFIG)
77if (NOT pybind11_FOUND)
@@ -21,13 +21,24 @@ target_link_libraries(_xgrammar PRIVATE core xgrammar)
2121target_compile_features (_xgrammar PRIVATE cxx_std_14)
2222
2323if (CALL_FROM_SETUP_PY)
24- set (_INSTALL_CUDA_RPATH
25- "\$ ORIGIN"
26- "\$ ORIGIN/../../nvidia/nccl/lib/"
27- "\$ ORIGIN/../../nvidia/cuda_runtime/lib/"
28- "\$ ORIGIN/../../nvidia/cublas/lib/"
29- "\$ ORIGIN/../../nvidia/curand/lib/"
30- )
24+ string (REPLACE "." ";" _ver ${CMAKE_CUDA_COMPILER_VERSION} )
25+ list (GET _ver 0 CUDA_MAJOR)
26+
27+ if (CUDA_MAJOR GREATER_EQUAL "13" )
28+ set (_INSTALL_CUDA_RPATH
29+ "\$ ORIGIN"
30+ "\$ ORIGIN/../../nvidia/nccl/lib/"
31+ "\$ ORIGIN/../../nvidia/cu${CUDA_MAJOR} /lib/"
32+ )
33+ else ()
34+ set (_INSTALL_CUDA_RPATH
35+ "\$ ORIGIN"
36+ "\$ ORIGIN/../../nvidia/nccl/lib/"
37+ "\$ ORIGIN/../../nvidia/cuda_runtime/lib/"
38+ "\$ ORIGIN/../../nvidia/cublas/lib/"
39+ "\$ ORIGIN/../../nvidia/curand/lib/"
40+ )
41+ endif ()
3142 set_target_properties (${PROJECT_NAME} PROPERTIES
3243 BUILD_RPATH "\$ ORIGIN"
3344 INSTALL_RPATH "${_INSTALL_CUDA_RPATH} "
You can’t perform that action at this time.
0 commit comments