Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: unable to install R package on CentOS 7 #13358

Closed
traversc opened this issue Jun 10, 2022 · 8 comments
Closed

Bug: unable to install R package on CentOS 7 #13358

traversc opened this issue Jun 10, 2022 · 8 comments

Comments

@traversc
Copy link
Contributor

traversc commented Jun 10, 2022

Installing from CRAN fails with and without NOT_CRAN=true. One error message below. I'm unable to install on a fresh CentOS 7 installation, so very reproducible. Any way I can fix it?

(I posted this on JIRA 1 week ago, but it's currently filled with spam bots)

installing to /home/tching/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-arrow/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, DLLpat/home86_64-pc-linux-gnu-library/4.1/00LOCK-arrow/00new/arrow/libs/arrow.so':
/home/tching/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-arrow/00new/arrow/libs/arrow.so: undefined symbol: _ZNK5arrow8DataType18ComputeFingerprintB5cxx11Ev
Error: loading failed
Execution halted
ERROR: loading failed
 * removing ‘/home/tching/R/x86_64-pc-linux-gnu-library/4.1/arrow’
 * restoring previous ‘/home/tching/R/x86_64-pc-linux-gnu-library/4.1/arrow’

The downloaded source packages are in
‘/tmp/RtmpeEDbrP/downloaded_packages’
Warning message:
In install.packages("arrow") :
installation of package ‘arrow’ had non-zero exit status
@assignUser
Copy link
Member

Hi!
I have setup a test on the rstudio/r-base:4.2-centos7 image and can't reproduce your issue. Could you set ARROW_R_DEV=TRUE and try again? (here a currently running test with 4.1)

@traversc
Copy link
Contributor Author

Setting ARROW_R_DEV=TRUE let me figure out what the issue was. One difference from your test setup is I am using gcc 10 and compiling R from source, which is common on centos 7 which uses gcc 4.8.5 by default.

The shared system libraries did not play nicely with the arrow package (lz4 and snappy in particular), so uninstalling them let the package installation go through properly.

A feature request would be to add a configuration parameter to turn off searching for system libraries.

Anyway, feel free to close. Thanks!

@assignUser
Copy link
Member

@traversc just came across this issue again, due to the switch to C++17 the next release (10.0.0 in ~ 2-3 weeks) we (will) now build the centos 7 binaries with devtoolset 8 (PR here: #14243 input/testing appreciated!)

A feature request would be to add a configuration parameter to turn off searching for system libraries.

If you build from source (via LIBARROW_BINARY=FALSE) you can use EXTRA_CMAKE_FLAGS=-DARROW_DEPENDENCY_SOURCE=BUNDLED to do that.

@traversc
Copy link
Contributor Author

traversc commented Oct 6, 2022

@assignUser I worry about things like ABI compatibility. From what I understand, there was an ABI break during GCC 5, so a binary compiled with devtoolset 8 would not be by default compatible with Centos 7 GCC 4.8.5 (please correct me if I'm wrong).

One solution could be to build two versions for Centos 7, one for the default GCC 4.8.5 and another for more modern compilers.

There are some GCC compatibility flags that might be useful.

Edit: but it looks like you got it working on Centos 7 GCC 4.8.5, so I could be wrong!

@assignUser
Copy link
Member

one for the default GCC 4.8.5

This is not possible due to the switch to C++17 which is first supported in gcc >= 5 but with devtoolset the missing libc++ features are statically linked into the binary and will work on machines without dts (:magic_wand: ).

You can test this yourself by downloading the r-pkg__centos7 artifact from this workflow run: https://github.com/ursacomputing/crossbow/actions/runs/3159866027
It contains a binary package compiled in this way, would be great to have some external validation of the process :)

@traversc
Copy link
Contributor Author

traversc commented Oct 6, 2022

Awesome, sounds like I'm wrong! What is "dts"?

Would be happy to test it out for you, but need more instructions. How do I get the R package to point to the binaries in the zip file?

@assignUser
Copy link
Member

Ah, sorry thought I had written it out before: dts = devtoolset
You can unpack the zip anywhere you like, that contains a file called arrow_9.0.0.20220930_R_x86_64-pc-linux-gnu.tar.gz and you can install this with install.packages("/path/to/arrow_9.0.0.20220930_R_x86_64-pc-linux-gnu.tar.gz"), given that you have installed the needed dependencies (e.g. by having installed arrow before), otherwise you need to install any you are missing manually and try again after.

Let me know if you need any other info :)

@traversc
Copy link
Contributor Author

traversc commented Oct 7, 2022

Looks like it works on Centos 7 with GCC 10!

There was a warning that the R package was built with R 4.2, but I assume that's a minor thing.

@AlenkaF AlenkaF closed this as completed Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants