[ 
https://issues.apache.org/jira/browse/ARROW-12561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17332928#comment-17332928
 ] 

Yibo Cai edited comment on ARROW-12561 at 4/27/21, 5:04 AM:
------------------------------------------------------------

*-DCMAKE_CXX_FLAGS=-stdlib=libc++* does the job. Not necessary to add other 
options.


was (Author: yibocai):
*-DCMAKE_CXX_FLAGS=-stdlib=libc++* does the job. Not necessary to add other 
options.

Only one like error:
{code:bash}
[1/1] Linking CXX executable release/arrow-json-integration-test
FAILED: release/arrow-json-integration-test 
: && /usr/bin/clang++-10  -stdlib=libc++ -Qunused-arguments -fcolor-diagnostics 
-O3 -DNDEBUG  -Wall -Wno-unknown-warning-option -Wno-pass-failed -msse4.2  -O3 
-DNDEBUG   
src/arrow/testing/CMakeFiles/arrow-json-integration-test.dir/json_integration_test.cc.o
  -o release/arrow-json-integration-test  
-Wl,-rpath,/home/cyb/arrow/cpp/release/release:/home/cyb/arrow/cpp/release/googletest_ep-prefix/lib
 release/libarrow_testing.so.400.0.0 release/libarrow.so.400.0.0 
utf8proc_ep-install/lib/libutf8proc.a re2_ep-install/lib/libre2.a -ldl 
googletest_ep-prefix/lib/libgtest_main.so googletest_ep-prefix/lib/libgtest.so 
googletest_ep-prefix/lib/libgmock.so 
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so 
/usr/lib/x86_64-linux-gnu/libboost_system.so -ldl 
../debug/gflags_ep-prefix/src/gflags_ep/lib/libgflags_nothreads.a 
jemalloc_ep-prefix/src/jemalloc_ep/dist//lib/libjemalloc_pic.a -pthread -lrt && 
:
/usr/bin/ld: 
../debug/gflags_ep-prefix/src/gflags_ep/lib/libgflags_nothreads.a(gflags.cc.o): 
undefined reference to symbol 
'_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc@@GLIBCXX_3.4.21'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing 
from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
{code}

> [C++][CMake] Add cmake option to link with clang libc++ on Linux distro
> -----------------------------------------------------------------------
>
>                 Key: ARROW-12561
>                 URL: https://issues.apache.org/jira/browse/ARROW-12561
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Yibo Cai
>            Assignee: Yibo Cai
>            Priority: Major
>
> Gnu libstdc++ is the default c++ library on Linux distros. Clang has its own 
> libc++ implementation, but not used widely.
> I found some performance issue when build Arrow with clang but link with gnu 
> libstdc++ (ARROW-12533). 
> It's better to add a cmake option to use libc++ when build arrow with clang.
> libc++ is already the default on apple macos: 
> https://github.com/apache/arrow/blob/master/cpp/cmake_modules/SetupCxxFlags.cmake#L400



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to