You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2023/02/06 12:14:43 UTC

[GitHub] [arrow] kou commented on a diff in pull request #34048: GH-32292: [R][Packaging] Use binaries build on CentOS 7 for Ubuntu < 22.04

kou commented on code in PR #34048:
URL: https://github.com/apache/arrow/pull/34048#discussion_r1097302416


##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -576,6 +576,19 @@ if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
   string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
   list(INSERT ARROW_STATIC_INSTALL_INTERFACE_LIBS 0 "Arrow::arrow_bundled_dependencies")
 endif()
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+  set(GLIBCXX_USE_CXX11_ABI_SOURCE
+      ${CMAKE_CURRENT_BINARY_DIR}/try_compile_glibcxx_use_cxx_abi.cc)
+  file(WRITE ${GLIBCXX_USE_CXX11_ABI_SOURCE} "#if !_GLIBCXX_USE_CXX11_ABI\n"
+                                             "#error Not using CXX11 ABI\n" "#endif\n")
+  try_compile(IS_GLIBCXX_USE_CXX11_ABI ${CMAKE_CURRENT_BINARY_DIR}/try_compile
+              SOURCES ${GLIBCXX_USE_CXX11_ABI_SOURCE})
+  if(NOT IS_GLIBCXX_USE_CXX11_ABI)
+    string(APPEND ARROW_PC_CFLAGS " -D_GLIBCXX_USE_CXX11_ABI=0")
+  endif()
+endif()

Review Comment:
   Yes, this is needed.
   devtoolset-8 uses `_GLIBCXX_USE_CXX11_ABI=0` by default. So we don't need to specify it explicitly for our R package on CentOS 7.
   But g++ on Ubuntu 18.04/20.04 uses `_GLIBCXX_USE_CXX11_ABI=1` by default. If we mix `_GLIBCXX_USE_CXX11_ABI=0` Apache Arrow C++ binaries (built on CentOS 7) and `_GLIBCXX_USE_CXX11_ABI=1` our R package, our R package can't find needed symbols. It causes a link error.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org