Skip to content

Commit

Permalink
Fix missing RMM_STATIC_CUDART define when compiling JNI with static C…
Browse files Browse the repository at this point in the history
…UDA runtime (#10585)

Fixes #10571.

This fixes the JNI CMakeLists.txt so that RMM will automatically get the `RMM_STATIC_CUDART` define added to the build when `CUDA_STATIC_RUNTIME=ON`.  Verified by building with Javva CI Dockerfile with static CUDA runtime and examining the build command-lines and flag definitions in java/target/cmake-build/CMakeFiles.

Authors:
  - Jason Lowe (https://github.com/jlowe)

Approvers:
  - Alessandro Bellina (https://github.com/abellina)

URL: #10585
  • Loading branch information
jlowe authored Apr 4, 2022
1 parent adec535 commit fa0938f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
1 change: 1 addition & 0 deletions java/ci/build-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ mkdir -p "$WORKSPACE/cpp/build"
cd "$WORKSPACE/cpp/build"
cmake .. -G"${CMAKE_GENERATOR}" \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
-DCUDA_STATIC_RUNTIME=$ENABLE_CUDA_STATIC_RUNTIME \
-DUSE_NVTX=$ENABLE_NVTX \
-DCUDF_USE_ARROW_STATIC=ON \
-DCUDF_ENABLE_ARROW_S3=OFF \
Expand Down
22 changes: 3 additions & 19 deletions java/src/main/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,7 @@ rapids_find_package(ZLIB REQUIRED)
# ##################################################################################################
# * RMM -------------------------------------------------------------------------------------------

find_path(
RMM_INCLUDE "rmm"
HINTS "${CUDF_CPP_BUILD_DIR}/_deps/rmm-src/include" "$ENV{RMM_ROOT}/include"
"$ENV{RMM_HOME}/include" "$ENV{CONDA_PREFIX}/include/rmm" "$ENV{CONDA_PREFIX}/include"
)

message(STATUS "RMM: RMM_INCLUDE set to ${RMM_INCLUDE}")

find_path(
SPDLOG_INCLUDE "spdlog"
HINTS "${CUDF_CPP_BUILD_DIR}/_deps/spdlog-src/include" "$ENV{RMM_ROOT}/_deps/spdlog-src/include"
"$ENV{RMM_ROOT}/include" "$ENV{CONDA_PREFIX}/include"
)

message(STATUS "SPDLOG: SPDLOG_INCLUDE set to ${SPDLOG_INCLUDE}")
include(${CUDF_SOURCE_DIR}/cmake/thirdparty/get_rmm.cmake)

# ##################################################################################################
# * ARROW -----------------------------------------------------------------------------------------
Expand Down Expand Up @@ -255,11 +241,9 @@ target_include_directories(
"${NVCOMP_INCLUDE}"
"${CMAKE_BINARY_DIR}/include"
"${CMAKE_SOURCE_DIR}/include"
"${SPDLOG_INCLUDE}"
"${CMAKE_SOURCE_DIR}/src"
"${JNI_INCLUDE_DIRS}"
"${CUDF_INCLUDE}"
"${RMM_INCLUDE}"
"${ARROW_INCLUDE}"
)

Expand Down Expand Up @@ -296,7 +280,7 @@ if(USE_GDS)
PUBLIC "${LIBCUDACXX_INCLUDE}" "${CUDF_INCLUDE}"
PRIVATE "${cuFile_INCLUDE_DIRS}"
)
target_link_libraries(cufilejni PRIVATE cudfjni "${cuFile_LIBRARIES}")
target_link_libraries(cufilejni PRIVATE cudfjni rmm::rmm "${cuFile_LIBRARIES}")
endif()

# ##################################################################################################
Expand All @@ -323,7 +307,7 @@ if(CUDF_JNI_LIBCUDF_STATIC)
endif()

target_link_libraries(
cudfjni PRIVATE ${CUDF_LINK} ${NVCOMP_LIBRARY} ${ARROW_LIBRARY} CUDA::cuda_driver
cudfjni PRIVATE ${CUDF_LINK} ${NVCOMP_LIBRARY} ${ARROW_LIBRARY} rmm::rmm CUDA::cuda_driver
)

# ##################################################################################################
Expand Down

0 comments on commit fa0938f

Please sign in to comment.