Skip to content

Commit 151b744

Browse files
committed
Use CUDA_LIBRARIES instead of hardcoding the path to libcudart
Hardcoded paths don't work when using Debian's packaged version of cuda, as the library paths don't match. CMake's find_package(CUDA) sets CUDA_LIBRARIES to the path of libcudart, so just use that instead.
1 parent 7441f3a commit 151b744

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
6767
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
6868

6969
set(OPTIMIZE "-O3" CACHE STRING "Optimization level")
70-
if(CUDA)
71-
set(C_CXX_FLAGS "-lcudart -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Woverloaded-virtual -pedantic-errors -Wno-deprecated")
72-
else()
73-
set(C_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Woverloaded-virtual -pedantic-errors -Wno-deprecated")
74-
endif(CUDA)
70+
set(C_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Woverloaded-virtual -pedantic-errors -Wno-deprecated")
7571
if(OPENMP)
7672
set(C_CXX_FLAGS "-fopenmp ${C_CXX_FLAGS}")
7773
endif(OPENMP)

src/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ include_directories(${TACO_SRC_DIR})
2222
add_library(taco ${TACO_LIBRARY_TYPE} ${TACO_HEADERS} ${TACO_SOURCES})
2323
if (CUDA)
2424
include_directories(${CUDA_INCLUDE_DIRS})
25-
target_link_libraries(taco INTERFACE ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libcudart.so)
25+
target_link_libraries(taco PUBLIC ${CUDA_LIBRARIES})
2626
endif (CUDA)
2727
install(TARGETS taco DESTINATION lib)
2828

0 commit comments

Comments
 (0)