diff --git a/java/pom.xml b/java/pom.xml
index 5712f37f225..78b3dce20fb 100755
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -424,14 +424,6 @@
fail("Could not find cudf as a dependency of libcudfjni out> $sout err> $serr")
}
- def libnvcomp = ~/libnvcomp\\.so\\s+=>\\s+(.*)libnvcomp.*\\.so\\s+.*/
- def nvcompm = libnvcomp.matcher(sout)
- if (nvcompm.find()) {
- pom.properties['native.nvcomp.path'] = nvcompm.group(1)
- } else {
- fail("Could not find nvcomp as a dependency of libcudfjni out> $sout err> $serr")
- }
-
def libcudart = ~/libcudart\\.so\\.(.*)\\s+=>.*/
def cm = libcudart.matcher(sout)
if (cm.find()) {
@@ -516,13 +508,6 @@
libcudf.so
-
-
- ${native.nvcomp.path}
-
- libnvcomp.so
-
-
diff --git a/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java b/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java
index d6fea637037..8780ecc3aa3 100755
--- a/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java
+++ b/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java
@@ -55,7 +55,6 @@ public class NativeDepsLoader {
*/
private static final String[][] loadOrder = new String[][]{
new String[]{
- "nvcomp",
"cudf"
},
new String[]{
diff --git a/java/src/main/native/CMakeLists.txt b/java/src/main/native/CMakeLists.txt
index cba46470b54..b75988309c3 100755
--- a/java/src/main/native/CMakeLists.txt
+++ b/java/src/main/native/CMakeLists.txt
@@ -304,4 +304,4 @@ target_compile_definitions(cudfjni PUBLIC SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM
###################################################################################################
# - link libraries --------------------------------------------------------------------------------
-target_link_libraries(cudfjni ${CUDF_LIB} ${ARROW_LIBRARY} ${NVCOMP_LIB} ${CUDART_LIBRARY} cuda)
+target_link_libraries(cudfjni ${NVCOMP_LIB} ${CUDF_LIB} ${ARROW_LIBRARY} ${CUDART_LIBRARY} cuda)
diff --git a/java/src/main/native/cmake/Templates/Nvcomp.CMakeLists.txt.cmake b/java/src/main/native/cmake/Templates/Nvcomp.CMakeLists.txt.cmake
index dca0a174e54..5761ef8fd1b 100644
--- a/java/src/main/native/cmake/Templates/Nvcomp.CMakeLists.txt.cmake
+++ b/java/src/main/native/cmake/Templates/Nvcomp.CMakeLists.txt.cmake
@@ -1,5 +1,5 @@
#=============================================================================
-# Copyright (c) 2020, NVIDIA CORPORATION.
+# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ ExternalProject_Add(nvcomp
SOURCE_DIR "${NVCOMP_ROOT}/nvcomp"
BINARY_DIR "${NVCOMP_ROOT}/build"
INSTALL_DIR "${NVCOMP_ROOT}/install"
+ PATCH_COMMAND patch --reject-file=- -p1 -N < ${CMAKE_CURRENT_SOURCE_DIR}/cmake/nvcomp.patch || true
CMAKE_ARGS ${NVCOMP_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${NVCOMP_ROOT}/install
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target nvcomp
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Skipping nvcomp install step.")
diff --git a/java/src/main/native/cmake/nvcomp.patch b/java/src/main/native/cmake/nvcomp.patch
new file mode 100644
index 00000000000..ea1340b7754
--- /dev/null
+++ b/java/src/main/native/cmake/nvcomp.patch
@@ -0,0 +1,15 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 32f48ef..a2e3125 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -10,7 +10,9 @@ endif()
+ file(GLOB CUDA_SOURCES *.cu)
+ file(GLOB CPP_SOURCES *.cpp)
+
+-add_library(nvcomp SHARED ${CUDA_SOURCES} ${CPP_SOURCES})
++
++add_library(nvcomp STATIC ${CUDA_SOURCES} ${CPP_SOURCES})
++set_property(TARGET nvcomp PROPERTY POSITION_INDEPENDENT_CODE True)
+ set_property(TARGET nvcomp PROPERTY CUDA_ARCHITECTURES ${GPU_ARCHS})
+ target_compile_options(nvcomp PRIVATE
+ $<$:--expt-extended-lambda -Xcompiler -pthread>)