File tree Expand file tree Collapse file tree 4 files changed +24
-5
lines changed
Expand file tree Collapse file tree 4 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 33## New Features
44
55- PR #341 Enable logging
6+ - PR #343 Add in option to statically link against cudart
67
78## Improvements
89
Original file line number Diff line number Diff line change @@ -57,6 +57,18 @@ endif(CMAKE_COMPILER_IS_GNUCXX)
5757option (BUILD_TESTS "Configure CMake to build tests" ON )
5858option (BUILD_BENCHMARKS "Configure CMake to build (google) benchmarks" OFF )
5959
60+ ###################################################################################################
61+ # - cudart options --------------------------------------------------------------------------------
62+ # cudart can be statically linked or dynamically linked the python ecosystem wants dynamic linking
63+
64+ option (CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF )
65+
66+ if (CUDA_STATIC_RUNTIME)
67+ message (STATUS "Enabling static linking of cudart" )
68+ set (CUDART_LIBRARY "cudart_static" )
69+ else ()
70+ set (CUDART_LIBRARY "cudart" )
71+ endif (CUDA_STATIC_RUNTIME)
6072
6173###################################################################################################
6274# - cnmem ---------------------------------------------------------------------------------
@@ -152,7 +164,7 @@ endif(USE_NVTX)
152164###################################################################################################
153165# - link libraries --------------------------------------------------------------------------------
154166
155- target_link_libraries (rmm cudart cuda)
167+ target_link_libraries (rmm ${CUDART_LIBRARY} cuda)
156168
157169###################################################################################################
158170# - install targets -------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -18,14 +18,15 @@ ARGS=$*
1818# script, and that this script resides in the repo dir!
1919REPODIR=$( cd $( dirname $0 ) ; pwd)
2020
21- VALIDARGS=" clean librmm rmm -v -g -n -h"
22- HELP=" $0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-h]
21+ VALIDARGS=" clean librmm rmm -v -g -n -s - h"
22+ HELP=" $0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-s] [- h]
2323 clean - remove all existing build artifacts and configuration (start over)
2424 librmm - build and install the librmm C++ code
2525 rmm - build and install the rmm Python package
2626 -v - verbose build mode
2727 -g - build for debug
2828 -n - no install step
29+ -s - statically link against cudart
2930 -h - print this text
3031
3132 default action (no args) is to build and install 'librmm' and 'rmm' targets
@@ -39,6 +40,7 @@ VERBOSE=""
3940BUILD_TYPE=Release
4041INSTALL_TARGET=install
4142PYTHON=${PYTHON:= python}
43+ CUDA_STATIC_RUNTIME=OFF
4244RAN_CMAKE=0
4345
4446# Set defaults for vars that may not have been defined externally
@@ -59,6 +61,7 @@ function ensureCMakeRan {
5961 if (( RAN_CMAKE == 0 )) ; then
6062 echo " Executing cmake for librmm..."
6163 cmake -DCMAKE_INSTALL_PREFIX=" ${INSTALL_PREFIX} " \
64+ -DCUDA_STATIC_RUNTIME=" ${CUDA_STATIC_RUNTIME} " \
6265 -DCMAKE_CXX11_ABI=ON \
6366 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
6467 RAN_CMAKE=1
9194if hasArg -n; then
9295 INSTALL_TARGET=" "
9396fi
97+ if hasArg -s; then
98+ CUDA_STATIC_RUNTIME=ON
99+ fi
94100
95101# If clean given, run it prior to any other steps
96102if hasArg clean; then
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ set(CMAKE_CUDA_STANDARD_REQUIRED ON)
2929function (ConfigureTest CMAKE_TEST_NAME CMAKE_TEST_SRC)
3030 add_executable (${CMAKE_TEST_NAME} ${CMAKE_TEST_SRC} )
3131 set_target_properties (${CMAKE_TEST_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON )
32- target_link_libraries (${CMAKE_TEST_NAME} gmock gtest gmock_main gtest_main pthread rmm)
32+ target_link_libraries (${CMAKE_TEST_NAME} gmock gtest gmock_main gtest_main pthread cudart rmm)
3333 set_target_properties (${CMAKE_TEST_NAME} PROPERTIES
3434 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /gtests" )
3535 add_test (NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME} )
@@ -128,6 +128,6 @@ set(RANDOM_ALLOCATE_SRC
128128
129129add_executable (random_allocate ${RANDOM_ALLOCATE_SRC} )
130130set_target_properties (random_allocate PROPERTIES POSITION_INDEPENDENT_CODE ON )
131- target_link_libraries (random_allocate rmm)
131+ target_link_libraries (random_allocate cudart rmm)
132132set_target_properties (random_allocate PROPERTIES
133133 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bench" )
You can’t perform that action at this time.
0 commit comments