Skip to content
Snippets Groups Projects
Commit e7e3137b authored by Thomas Müller's avatar Thomas Müller
Browse files

Link against CUDA dynamically rather than statically

parent 1d3a4159
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,7 @@ set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_EXTENSIONS OFF)
set(CUDA_LINK_LIBRARIES_KEYWORD PUBLIC)
set(CMAKE_CUDA_RUNTIME_LIBRARY Shared)
if (MSVC)
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-bigobj")
......@@ -365,10 +366,10 @@ if (Python_FOUND)
if (MSVC)
# Copy dlls needed at runtime
file(GLOB CUBLAS_DLLS "${CUDA_COMPILER_BIN}/cublas*.dll")
if (CUBLAS_DLLS)
file(GLOB CUDA_DLLS "${CUDA_COMPILER_BIN}/cublas*.dll" "${CUDA_COMPILER_BIN}/cudart64*.dll" "${CUDA_COMPILER_BIN}/cusolver64*.dll")
if (CUDA_DLLS)
add_custom_command(TARGET pyngp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CUBLAS_DLLS} $<TARGET_FILE_DIR:pyngp>
COMMAND ${CMAKE_COMMAND} -E copy ${CUDA_DLLS} $<TARGET_FILE_DIR:pyngp>
COMMAND_EXPAND_LISTS
)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment