You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/02/08 03:09:21 UTC

[arrow] branch master updated: ARROW-4500: [C++] Remove pthread / librt hacks causing linking issues in some Linux environments

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 4131484  ARROW-4500: [C++] Remove pthread / librt hacks causing linking issues in some Linux environments
4131484 is described below

commit 41314846bf548861e7ccee512f3f0bce1d32b88c
Author: Wes McKinney <we...@apache.org>
AuthorDate: Thu Feb 7 21:08:36 2019 -0600

    ARROW-4500: [C++] Remove pthread / librt hacks causing linking issues in some Linux environments
    
    pthread and librt are already part of the public link interface to `arrow_static` -- tagging on these additional link options can cause the libraries to get passed multiple times to the linker, or in the wrong order, causing link failures in certain environments
    
    ```
    FAILED: debug/plasma_store_server
    : && /usr/bin/ccache
    /home/wesm/miniconda/envs/arrow-3.7/bin/x86_64-conda_cos6-linux-gnu-c++
    -Wno-noexcept-type -fvisibility-inlines-hidden -std=c++17
    -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize
    -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -ggdb -O0 -Wall
    -Wconversion -Wno-sign-conversion -Werror -msse4.2
    -fno-omit-frame-pointer -fPIC -g -Wl,-O2 -Wl,--sort-common
    -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags
    -rdynamic
    src/plasma/CMakeFiles/plasma_store_server.dir/external_store.cc.o
    src/plasma/CMakeFiles/plasma_store_server.dir/hash_table_store.cc.o
    src/plasma/CMakeFiles/plasma_store_server.dir/store.cc.o -o
    debug/plasma_store_server
    -Wl,-rpath,/home/wesm/cpp-toolchain/lib: -lrt debug/libplasma.a
    debug/libarrow.a -lrt
    /home/wesm/cpp-toolchain/lib/libdouble-conversion.a
    /home/wesm/cpp-toolchain/lib/libbrotlidec-static.a
    /home/wesm/cpp-toolchain/lib/libbrotlienc-static.a
    /home/wesm/cpp-toolchain/lib/libbrotlicommon-static.a
    /home/wesm/cpp-toolchain/lib/libbz2.a
    /home/wesm/cpp-toolchain/lib/liblz4.a
    /home/wesm/cpp-toolchain/lib/libsnappy.a
    /home/wesm/cpp-toolchain/lib/libz.so
    /home/wesm/cpp-toolchain/lib/libzstd.a
    /home/wesm/cpp-toolchain/lib/libglog.a
    /home/wesm/cpp-toolchain/lib/libgflags.a
    /home/wesm/cpp-toolchain/lib/libboost_system.so
    /home/wesm/cpp-toolchain/lib/libboost_filesystem.so
    /home/wesm/cpp-toolchain/lib/libboost_regex.so
    jemalloc_ep-prefix/src/jemalloc_ep/dist//lib/libjemalloc_pic.a
    /home/wesm/cpp-toolchain/lib64/libflatbuffers.a -pthread && :
    /home/wesm/miniconda/envs/arrow-3.7/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld:
    jemalloc_ep-prefix/src/jemalloc_ep/dist//lib/libjemalloc_pic.a(nstime.pic.o):
    undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5'
    /home/wesm/miniconda/envs/arrow-3.7/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld:
    /home/wesm/miniconda/envs/arrow-3.7/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/../lib/librt.so:
    error adding symbols: DSO missing from command line
    
    ```
    
    Author: Wes McKinney <we...@apache.org>
    
    Closes #3583 from wesm/ARROW-4500 and squashes the following commits:
    
    db53dc9ee <Wes McKinney> Support ARROW_BUILD_STATIC=OFF
    4a189ea87 <Wes McKinney> Simplify plasma library link libraries
    b1d2a27ca <Wes McKinney> Remove pthread / librt hacks causing linking issues on Ubuntu 18.10
---
 cpp/cmake_modules/FindLLVM.cmake |  4 ++--
 cpp/src/arrow/ipc/CMakeLists.txt | 16 ++--------------
 cpp/src/plasma/CMakeLists.txt    |  8 ++------
 3 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/cpp/cmake_modules/FindLLVM.cmake b/cpp/cmake_modules/FindLLVM.cmake
index 2cea734..5a9705d 100644
--- a/cpp/cmake_modules/FindLLVM.cmake
+++ b/cpp/cmake_modules/FindLLVM.cmake
@@ -33,11 +33,11 @@ if (APPLE)
 endif()
 
 find_package(LLVM ${ARROW_LLVM_VERSION} REQUIRED CONFIG HINTS
+             ${LLVM_DIR}
              /usr/lib
              /usr/local/opt/llvm
              /usr/share
-             ${LLVM_BREW_PREFIX}
-             ${LLVM_DIR})
+             ${LLVM_BREW_PREFIX})
 message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
 message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
 
diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt
index 7967582..492f0e7 100644
--- a/cpp/src/arrow/ipc/CMakeLists.txt
+++ b/cpp/src/arrow/ipc/CMakeLists.txt
@@ -96,23 +96,11 @@ else()
   set(ARROW_UTIL_LIB arrow_shared)
 endif()
 
-set(UTIL_LINK_LIBS
-  ${ARROW_UTIL_LIB}
-  ${BOOST_FILESYSTEM_LIBRARY}
-  ${BOOST_SYSTEM_LIBRARY})
-
-if(NOT WIN32)
-  set(UTIL_LINK_LIBS
-    ${UTIL_LINK_LIBS}
-    pthread
-    ${CMAKE_DL_LIBS})
-endif()
-
 if (ARROW_BUILD_UTILITIES)
   add_executable(arrow-file-to-stream file-to-stream.cc)
-  target_link_libraries(arrow-file-to-stream ${UTIL_LINK_LIBS})
+  target_link_libraries(arrow-file-to-stream ${ARROW_UTIL_LIB})
   add_executable(arrow-stream-to-file stream-to-file.cc)
-  target_link_libraries(arrow-stream-to-file ${UTIL_LINK_LIBS})
+  target_link_libraries(arrow-stream-to-file ${ARROW_UTIL_LIB})
 
   add_dependencies(integration arrow-file-to-stream)
   add_dependencies(integration arrow-stream-to-file)
diff --git a/cpp/src/plasma/CMakeLists.txt b/cpp/src/plasma/CMakeLists.txt
index fd25aef..bb70e9e 100644
--- a/cpp/src/plasma/CMakeLists.txt
+++ b/cpp/src/plasma/CMakeLists.txt
@@ -61,10 +61,6 @@ add_custom_command(
   COMMENT "Running flatc compiler on ${PLASMA_FBS_SRC}"
   VERBATIM)
 
-if(UNIX AND NOT APPLE)
-  link_libraries(rt)
-endif()
-
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
 
 set(PLASMA_SRCS
@@ -93,8 +89,8 @@ ADD_ARROW_LIB(plasma
   SOURCES ${PLASMA_SRCS}
   OUTPUTS PLASMA_LIBRARIES
   DEPENDENCIES gen_plasma_fbs
-  SHARED_LINK_LIBS ${FLATBUFFERS_STATIC_LIB} ${CMAKE_THREAD_LIBS_INIT} ${PLASMA_LINK_LIBS}
-  STATIC_LINK_LIBS ${FLATBUFFERS_STATIC_LIB} ${CMAKE_THREAD_LIBS_INIT} ${PLASMA_STATIC_LINK_LIBS})
+  SHARED_LINK_LIBS ${PLASMA_LINK_LIBS}
+  STATIC_LINK_LIBS ${PLASMA_STATIC_LINK_LIBS})
 
 add_dependencies(plasma ${PLASMA_LIBRARIES})