Skip to content

Commit f841a6a

Browse files
committed
Merge branch 'branch-0.14' into fea-enable-logging
2 parents 2ab41d3 + a9be620 commit f841a6a

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## New Features
44

55
- PR #341 Enable logging
6+
- PR #343 Add in option to statically link against cudart
67

78
## Improvements
89

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ endif(CMAKE_COMPILER_IS_GNUCXX)
5757
option(BUILD_TESTS "Configure CMake to build tests" ON)
5858
option(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 -------------------------------------------------------------------------------

build.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ ARGS=$*
1818
# script, and that this script resides in the repo dir!
1919
REPODIR=$(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=""
3940
BUILD_TYPE=Release
4041
INSTALL_TARGET=install
4142
PYTHON=${PYTHON:=python}
43+
CUDA_STATIC_RUNTIME=OFF
4244
RAN_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
@@ -91,6 +94,9 @@ fi
9194
if hasArg -n; then
9295
INSTALL_TARGET=""
9396
fi
97+
if hasArg -s; then
98+
CUDA_STATIC_RUNTIME=ON
99+
fi
94100

95101
# If clean given, run it prior to any other steps
96102
if hasArg clean; then

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set(CMAKE_CUDA_STANDARD_REQUIRED ON)
2929
function(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

129129
add_executable(random_allocate ${RANDOM_ALLOCATE_SRC})
130130
set_target_properties(random_allocate PROPERTIES POSITION_INDEPENDENT_CODE ON)
131-
target_link_libraries(random_allocate rmm)
131+
target_link_libraries(random_allocate cudart rmm)
132132
set_target_properties(random_allocate PROPERTIES
133133
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bench")

0 commit comments

Comments
 (0)