Repository navigation
Closed
Description
Describe the bug, including details regarding any error messages, version, and platform.
I'm encountering an issue when trying to build the R package from a local build of Arrow C++ but only when I have GCS enabled. The error happens when I run R CMD INSTALL --preclean --no-multiarch .:
symbol not found in flat namespace '__ZN4absl12lts_2023012510FormatTimeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS0_4TimeENS0_8TimeZoneE
This looked very similar to what was reported in #32487, though I'm not building tests. I first tried setting CMAKE_CXX_STANDARD=17 which didn't help. @nealrichardson recommended absl_SOURCE=BUNDLED which also didn't help. I do have abseil via Homebrew.
I'm including some details of how I'm building everything below. I'm building off of main (2f3f41f):
How I'm building libarrow and the R package
$ echo $ARROW_HOME
/Users/bryce/builds/arrow-arm64
$ pwd
/Users/bryce/src/apache/arrow/cpp/build
$ cmake .. \
-GNinja \
-DARROW_COMPUTE=ON \
-DARROW_CSV=ON \
-DARROW_DATASET=ON \
-DARROW_FILESYSTEM=ON \
-DARROW_JSON=ON \
-DARROW_PARQUET=ON \
-DARROW_INSTALL_NAME_RPATH=OFF \
-DARROW_S3=ON \
-DARROW_GCS=ON \
-DARROW_MIMALLOC=OFF \
-DARROW_WITH_BROTLI=ON \
-DARROW_WITH_BZ2=ON \
-DARROW_WITH_LZ4=ON \
-DARROW_WITH_SNAPPY=ON \
-DARROW_WITH_ZLIB=ON \
-DARROW_WITH_ZSTD=ON \
-DARROW_EXTRA_ERROR_CONTEXT=ON \
-DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
-DCMAKE_BUILD_TYPE=Release \
-DGTest_SOURCE=BUNDLED \
-DCMAKE_CXX_STANDARD=17 \
-Dabsl_SOURCE=BUNDLED
$ ninja install
$ cd ~/src/apache/arrow/r
$ R CMD INSTALL --preclean --no-multiarch .
More complete R build output
installing to /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-r/00new/arrow/libs/arrow.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-r/00new/arrow/libs/arrow.so, 0x0006): symbol not found in flat namespace '__ZN4absl12lts_2023012510FormatTimeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS0_4TimeENS0_8TimeZoneE'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/arrow’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/arrow’
Component(s)
R
Activity
amoeba commentedon Mar 9, 2023
Removing Homebrew abseil then re-building from scratch worked. I was then able to reinstall abseil from Homebrew and build w/o
absl_SOURCE=BUNDLEDwhich is what I had been doing before I ran into this. So I'm not sure what state I had gotten my system into to run into this in the first place.kou commentedon Mar 10, 2023
Ah, this is caused by mixing include paths.
Some dependencies installed by Homebrew add
-I$(brew --prefix)/includeand it may be used before bundled Abseil. It mixes Homebrew Abseil'sinclude/and bundled Abseil'slib/.amoeba commentedon Mar 10, 2023
Interesting @kou, thanks. This is an area I'm not very familiar with but is there a possibility for an improvement to the build system here?
kou commentedon Mar 10, 2023
CMake has some features to control include path order. For example,
target_include_directories()https://cmake.org/cmake/help/latest/command/target_include_directories.html providesAFTER/BEFORE.We may be able to solve this by these features.
nealrichardson commentedon May 2, 2023
@kou should we reopen this?
kou commentedon May 2, 2023
Yes.
apacheGH-34523: [C++] Avoid mixing bundled Abseil and system Abseil
GH-34523: [C++] Avoid mixing bundled Abseil and system Abseil (#35387)
amoeba commentedon May 3, 2023
Thanks for the fix @kou !
apacheGH-34523: [C++] Avoid mixing bundled Abseil and system Abseil (a…
apacheGH-34523: [C++] Avoid mixing bundled Abseil and system Abseil (a…