Squashed commit of the following:
commit d6a52a8841a88bdc22f566731923bd1fc9b337aa Author: Carl Pearson <pearson@illinois.edu> Date: Fri Sep 20 07:32:02 2019 -0500 add badge commit c0a5bbaa2c77d028719c08012da10496c6585bc9 Author: Carl Pearson <pearson@illinois.edu> Date: Fri Sep 20 07:23:20 2019 -0500 download cmake instead of build, add bin to path commit ed3526a8b27984634a9fdd76d40a586d24bda310 Author: Carl Pearson <pearson@illinois.edu> Date: Thu Sep 19 17:23:07 2019 -0500 install cmake 3.15.3 commit 6442aa4f3f4cbc38bae184ac4e06954976134e0a Author: Carl Pearson <pearson@illinois.edu> Date: Thu Sep 19 17:20:33 2019 -0500 require CMake 3.13+ commit 3a0176484fd1c563a7a35edbf0e196544ee2771c Author: Carl Pearson <pearson@illinois.edu> Date: Thu Sep 19 17:17:49 2019 -0500 make VERBOSE=1 commit 8114641a64d6a3044e228fbcf17c1938991918a0 Author: Carl Pearson <pearson@illinois.edu> Date: Thu Sep 19 17:14:24 2019 -0500 try to add stubs dir to link path
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
# 3.9+ for OpenMP::OpenMP_CXX
|
||||
# 3.10+ findopenmp gained support for language-specific components
|
||||
# 3.11+ for CMake not to add -fopenmp to the nvcc flags
|
||||
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
|
||||
# 3.13+ for target_link_directories
|
||||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||
|
||||
project(perfect LANGUAGES CUDA CXX VERSION 0.1.0)
|
||||
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
|
||||
@@ -32,6 +33,13 @@ elseif (CMAKE_BUILD_TYPE MATCHES Release)
|
||||
set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} -lineinfo)
|
||||
endif()
|
||||
|
||||
# find the CUDA stubs directory in case the drivers are not installed
|
||||
# for CI, for example
|
||||
set(CUDA_TOOLKIT_ROOT_DIR "${CMAKE_CUDA_COMPILER}")
|
||||
get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR}" DIRECTORY)
|
||||
get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR}" DIRECTORY)
|
||||
set(CUDA_TOOLKIT_LIB_DIR ${CUDA_TOOLKIT_ROOT_DIR}/lib64/stubs)
|
||||
message(STATUS "CUDA toolkit stubs dir:" ${CUDA_TOOLKIT_LIB_DIR})
|
||||
|
||||
|
||||
set(CMAKE_CUDA_STANDARD 11)
|
||||
@@ -41,6 +49,7 @@ add_subdirectory(include/perfect)
|
||||
add_library(perfect INTERFACE)
|
||||
target_include_directories(perfect INTERFACE include/)
|
||||
target_include_directories(perfect INTERFACE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
|
||||
target_link_directories(perfect INTERFACE ${CUDA_TOOLKIT_LIB_DIR})
|
||||
target_link_libraries(perfect INTERFACE nvidia-ml)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user