ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build - #11889

Closed
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708
Closed

ARROW-14708: [C++] Adding missing abseil dependencies to enable static flight build#11889
rok wants to merge 10 commits into
apache:masterfrom
rok:ARROW-14708

Conversation

@rok

@rokrok commented Dec 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm

lidavidm commented Dec 7, 2021

Copy link
Copy Markdown
Member

Thanks! Unfortunately I still get a lot of linker errors using the repro from JIRA, but at least the Abseil issues are eliminated. I think the remaining issues are just because of the order of libraries.

This is what CMake generates, which fails with linker errors:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a -pthread /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a

The errors indicate libarrow_flight.a is missing symbols from libarrow.a and the bundled gRPC is missing symbols from OpenSSL.

This works:

/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/arrow_example.dir/example.cc.o -o arrow_example /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a -pthread /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -lrt

i.e. link libarrow_flight, then libarrow, then libarrow_bundled_dependencies, then OpenSSL.

Flipping the order of libraries in the CMakeLists.txt fixes the first issue, so I suppose this is user error, or we're missing some dependency expressed in CMake(?).

The installed ArrowFlightTargets.cmake does not declare arrow_static in INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the same for arrow_bundled_dependencies.

@lidavidm

Copy link
Copy Markdown
Member

This diff gets CMake to repeat libarrow.a after libarrow_flight.a, so we don't have to order the Arrow libraries ourselves in our "consumer" CMakeLists.txt:

diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt+++ b/cpp/src/arrow/flight/CMakeLists.txt@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})+ ${ARROW_FLIGHT_LINK_LIBS}+ STATIC_INSTALL_INTERFACE_LIBS+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)

And this additional diff, while questionable, fixes the rest of the link errors:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL+ set_target_properties(+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()

@rok

rok commented Dec 7, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks @lidavidm I was gonna ask for ideas about the flight linking errors! I'll include your diffs and test.

@rok

rok commented Dec 8, 2021

Copy link
Copy Markdown
MemberAuthor

@lidavidm I'm able to compile this locally now. I've also reduced the abseil dependencies (I think to a minimum).
Do we want further review on this?

@lidavidm

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: f3745060a1982f3ee46705bec28df3830312a8b9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1268

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
centos-8-amd64Github Actions
centos-8-arm64TravisCI
conda-cleanAzure
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py36-cudaAzure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py36-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.6Github Actions
test-conda-python-3.6-pandas-0.23Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.15Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-python-3Azure
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp36-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp36-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp36-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp36-amd64Github Actions
wheel-manylinux2014-cp36-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp36-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@lidavidm

Copy link
Copy Markdown
Member

@kou Sorry to trouble you, but would you be able to look over the CMake changes here? I'm not sure if the changes to ArrowConfig.cmake.in are strictly correct.

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidavidm No problem. :-)

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is needed.
Is there a use-case that uses arrow_bundled_dependencies without arrow_static?

BTW, indent for this code is broken.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the problem here is the order of libraries to the linker. As described above, currently, the order is OpenSSL, then libarrow_bundled_dependencies, so linking will fail because libarrow_bundled_dependencies itself also depends on OpenSSL. Adding this gets CMake to repeat OpenSSL after libarrow_bundled_dependencies and then the linker will find the necessary symbols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then we should list OpenSSL in INTERFACE_LINK_LIBRARIES of arrow_bundled_dependencies not arrow_static and INTERFACE_LINK_LIBRARIES of arrow_static should list only arrow_bundled_dependencies something like this:

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..ac2b9a027 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in+++ b/cpp/src/arrow/ArrowConfig.cmake.in@@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES "@ARROW_LIBRARY_PATH_SUFFIXES@")
set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
+set(ARROW_STATIC_INSTALL_INTERFACE_LIBS "@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
@@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
PROPERTIES
IMPORTED_LOCATION
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ INTERFACE_LINK_LIBRARIES+ "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
)
-- get_property(arrow_static_interface_link_libraries- TARGET arrow_static- PROPERTY INTERFACE_LINK_LIBRARIES)- set_target_properties(- arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES- "${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
endif()
endif()
endif()
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..66a24fbfc 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -526,6 +526,9 @@ endif()
if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")+else()+ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
endif()
# Need -latomic on Raspbian.
# See also: https://issues.apache.org/jira/browse/ARROW-12860
@@ -557,7 +560,7 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
add_dependencies(arrow ${ARROW_LIBRARIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a one-linear(?) to collect this list like https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2659-L2667 ?

It may be better that we have a shell script that generates the list and include it from this file:

# cpp/build-support/list-grpc-absl-libraries.sh
...
echo"set(GRPC_GPR_ABSL_LIBRARIES absl::...)"
$ cpp/build-support/list-grpc-absl-libraries.sh > cpp/cmake_modules/gRPCVariables.cmake
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 66d04acae..36565fdbf 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake@@ -3475,14 +3475,7 @@ macro(build_grpc)
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
- set(GRPC_GPR_ABSL_LIBRARIES- absl::base- absl::statusor- absl::status- absl::cord- absl::strings- absl::synchronization- absl::time)+ include(gRPCVariables)
add_library(gRPC::gpr STATIC IMPORTED)
set_target_properties(gRPC::gpr
PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from a87ae67 to 7d55e3cCompareDecember 9, 2021 15:06
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

Thanks for the feedback @kou and @lidavidm! I've moved things around as suggested. My cmake skills are lacking.

I've also added a shell script to extract the gRPCVariables. It extracts Abseil and gRPC dependencies at the moment, but I am not sure about it's correctness. Could one of you please take a look and suggest improvements if needed?

@rok
rokforce-pushed the ARROW-14708 branch 3 times, most recently from 1c9e45d to 9c13c18CompareDecember 9, 2021 19:29
@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

I'm getting:

CMake Error: install(EXPORT "arrow_targets" ...) includes target "arrow_static" which requires target "arrow_bundled_dependencies" that is not in any export set.

When running:

cmake -DARROW_DEPENDENCY_SOURCE=BUNDLED ..

I'll continue tomorrow but would appreciate pointers :)

@lidavidm

Copy link
Copy Markdown
Member

Just a thought, maybe the create_merged_static_lib call needs to be moved before add_arrow_lib so that it exists before we use it?

@kou

kou commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ah, it seems that we also need to specify arrow_bundled_dependencies to install(TARGETS arrow_static) something like the following:

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake+++ b/cpp/cmake_modules/BuildUtils.cmake@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)+ OUTPUT_PATH+ SHARED_INSTALL_EXTRA_TARGETS+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS} ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt+++ b/cpp/src/arrow/CMakeLists.txt@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}+ STATIC_EXTRA_TARGETS+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})

Or we can add install(TARGETS arrow_bundled_dependencies EXPORT arrow_targets ...) separately.

Do you want me to take this up?

@rok

rok commented Dec 9, 2021

Copy link
Copy Markdown
MemberAuthor

@kou thanks for the pointers!
I've pushed the change you proposed and hit another error (below). If you can spare time on this I'd be thankful but it's also a nice learning opportunity for me in case you're busy :).

 -Wall -fno-semantic-interposition -msse4.2 CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:539 (add_arrow_lib)
-- Creating bundled static library target arrow_bundled_dependencies at /home/rok/Documents/repos/arrow/cpp/build/release/libarrow_bundled_dependencies.a
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowTestingTargets.cmake".
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:601 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowDatasetTargets.cmake".
Call Stack (most recent call first):
src/arrow/dataset/CMakeLists.txt:51 (add_arrow_lib)
-- Found Python3: /home/rok/miniconda3/envs/pyarrow-dev/bin/python3.7 (found version "3.7.12") found components: Interpreter Development NumPy Development.Module Development.Embed CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ArrowPythonTargets.cmake".
Call Stack (most recent call first):
src/arrow/python/CMakeLists.txt:70 (add_arrow_lib)
CMake Error at cmake_modules/BuildUtils.cmake:469 (install):
install EXPORT given unknown argument "ParquetTargets.cmake".
Call Stack (most recent call first):
src/parquet/CMakeLists.txt:240 (add_arrow_lib)

@rok

rok commented Jan 21, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g nightly

@github-actions

Copy link
Copy Markdown

Revision: aed4157ff68fcde5f16a472cd689640dc624f588

Submitted crossbow builds: ursacomputing/crossbow @ actions-1422

TaskStatus
almalinux-8-amd64Github Actions
almalinux-8-arm64TravisCI
amazon-linux-2-amd64Github Actions
centos-7-amd64Github Actions
conda-cleanAzure
conda-linux-gcc-py37-cpu-r40Azure
conda-osx-arm64-clang-py38Azure
conda-osx-arm64-clang-py39Azure
conda-osx-clang-py37-r40Azure
conda-osx-clang-py37-r41Azure
conda-osx-clang-py38Azure
conda-osx-clang-py39Azure
conda-win-vs2017-py37-r40Azure
debian-bookworm-amd64Github Actions
debian-bookworm-arm64TravisCI
debian-bullseye-amd64Github Actions
debian-bullseye-arm64TravisCI
debian-buster-amd64Github Actions
debian-buster-arm64TravisCI
example-cpp-minimal-build-staticGithub Actions
example-cpp-minimal-build-static-system-dependencyGithub Actions
homebrew-cppGithub Actions
homebrew-r-autobrewGithub Actions
java-jarsGithub Actions
nugetGithub Actions
python-sdistGithub Actions
test-build-cpp-fuzzGithub Actions
test-build-vcpkg-winGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-conda-python-3.10Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-kartothek-latestGithub Actions
test-conda-python-3.7-kartothek-masterGithub Actions
test-conda-python-3.7-pandas-0.24Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-masterGithub Actions
test-conda-python-3.9-pandas-masterGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-debian-11-go-1.16Azure
test-debian-11-python-3Azure
test-debian-c-glibGithub Actions
test-debian-rubyGithub Actions
test-fedora-33-cppGithub Actions
test-fedora-33-python-3Azure
test-fedora-r-clang-sanitizerAzure
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-bundledAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-4.1-centos7-devtoolset-8Azure
test-r-rstudio-r-base-4.1-centos8Azure
test-r-rstudio-r-base-4.1-focalAzure
test-r-rstudio-r-base-4.1-opensuse15Azure
test-r-rstudio-r-base-4.1-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-skyhook-integrationGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-20.04-python-3Azure
test-ubuntu-c-glibGithub Actions
test-ubuntu-default-docsAzure
test-ubuntu-rubyGithub Actions
ubuntu-bionic-amd64Github Actions
ubuntu-bionic-arm64TravisCI
ubuntu-focal-amd64Github Actions
ubuntu-focal-arm64TravisCI
ubuntu-hirsute-amd64Github Actions
ubuntu-hirsute-arm64TravisCI
ubuntu-impish-amd64Github Actions
ubuntu-impish-arm64TravisCI
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp310-universal2Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-big-sur-cp39-universal2Github Actions
wheel-macos-high-sierra-cp310-amd64Github Actions
wheel-macos-high-sierra-cp37-amd64Github Actions
wheel-macos-high-sierra-cp38-amd64Github Actions
wheel-macos-high-sierra-cp39-amd64Github Actions
wheel-macos-mavericks-cp310-amd64Github Actions
wheel-macos-mavericks-cp37-amd64Github Actions
wheel-macos-mavericks-cp38-amd64Github Actions
wheel-macos-mavericks-cp39-amd64Github Actions
wheel-manylinux2010-cp310-amd64Github Actions
wheel-manylinux2010-cp37-amd64Github Actions
wheel-manylinux2010-cp38-amd64Github Actions
wheel-manylinux2010-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64TravisCI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64TravisCI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64TravisCI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64TravisCI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from cc1b7a1 to 85c9208CompareJanuary 22, 2022 00:08
Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated
Comment threadcpp/src/arrow/flight/CMakeLists.txt Outdated
@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from f632d02 to 89bd9b4CompareMarch 7, 2022 18:25
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm Implemented your suggestions and added a workaround for the abseil issue on macOS.

Comment threadcpp/cmake_modules/BuildUtils.cmake Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused here, now the arguments were added back but we don't use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on non-Apple platforms will it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this branch at all? Presumably absl::time's deps are correct on non-Apple platforms and we don't need to overwrite them?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that shouldn't be there.

@rokrokMar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about absl::time's deps on non-Apple so leaving that branch as is.

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment threadcpp/examples/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this end with -Wl,--no-force-load or something?

Related, does it take -force-load or --force-load?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all_load/noall_load currently won't work due to symbol duplication so force-load is the only option and there appears to be no noforce-load option.
More here.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this back to NOT? I feel like it flip-flops on every commit…was there a rebase error or something? It might be easier to squash current commits if needed

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, sorry. I was switching back and forth between linux and mac to fix the mac issue and probably caused this. I'll squash later today.

@rok
rokforce-pushed the ARROW-14708 branch 2 times, most recently from 27e3cd0 to f525cd6CompareMarch 7, 2022 19:51
@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

@lidavidm thanks for your patience. I've pushed another change with your suggestions.

@rok
rok requested a review from lidavidmMarch 7, 2022 22:32
Comment on lines -242 to -243
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, did you mean to remove this parameter?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

Comment threadcpp/src/arrow/ArrowConfig.cmake.in Outdated
)

INTERFACE_LINK_LIBRARIES
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be quoted.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Things work for me now.

@rok

rok commented Mar 7, 2022

Copy link
Copy Markdown
MemberAuthor

Sorry for the rebasing mess @lidavidm ! :)

endif()

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
STATIC_INSTALL_INTERFACE_LIBS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove STATIC_INSTALL_INTERFACE_LIBS?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. Changed.

Comment threadcpp/src/arrow/CMakeLists.txt Outdated

if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need _REAL alias?
Is there any problem if we use ARROW_STATIC_INSTALL_INTERFACE_LIBS directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing _REAL. It works for me locally, waiting or tests.

@rok

rok commented Mar 8, 2022

Copy link
Copy Markdown
MemberAuthor

@kou thank you for the review! I've pushed suggested changes.

kou
kou approved these changes Mar 8, 2022

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

@koukou closed this in 2fea818Mar 8, 2022
@ursabot

ursabot commented Mar 8, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 5772d65 and contender = 2fea818. 2fea818 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.34%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.13% ⬆️0.13%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rok@lidavidm@kou@kszucs@ursabot