소스 검색

HADOOP-11927. Fix "undefined reference to dlopen" error when compiling libhadooppipes (Xianyin Xin via Colin P. McCabe)

Colin Patrick Mccabe 10 년 전
부모
커밋
f34638399a
2개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      hadoop-common-project/hadoop-common/CHANGES.txt
  2. 9 0
      hadoop-tools/hadoop-pipes/src/CMakeLists.txt

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -749,6 +749,9 @@ Release 2.8.0 - UNRELEASED
     HADOOP-11743. maven doesn't clean all the site files
     (ramtin via vinayakumarb)
 
+    HADOOP-11927.  Fix "undefined reference to dlopen" error when compiling
+    libhadooppipes (Xianyin Xin via Colin P. McCabe)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 9 - 0
hadoop-tools/hadoop-pipes/src/CMakeLists.txt

@@ -69,7 +69,16 @@ add_library(hadooputils STATIC
 add_library(hadooppipes STATIC
     main/native/pipes/impl/HadoopPipes.cc
 )
+
+INCLUDE(CheckLibraryExists)
+CHECK_LIBRARY_EXISTS(dl dlopen "" NEED_LINK_DL)
+
+if (NEED_LINK_DL)
+    set(LIB_DL dl)
+endif (NEED_LINK_DL)
+
 target_link_libraries(hadooppipes
     ${OPENSSL_LIBRARIES}
+    ${LIB_DL}
     pthread
 )