r-lib / later

Schedule an R function or formula to run after a specified period of time.
https://r-lib.github.io/later
Other
138 stars 27 forks source link

Installation fails on Raspberry PI 4: undefined reference to `__atomic_fetch_add_8` #109

Closed plnnr closed 4 years ago

plnnr commented 5 years ago

I have Raspberry Pi 4B with R 3.6.1 and RStudio server v1.2.1335 (from here). I have tried all of the proposed solutions from issue 73, but it doesn't work (i.e., install Rcpp in root; then modifying the Makevars file with PKG_LIBS = -pthread -latomic and other variations; then install.packages(/path/to/git/repo/later, repos = NULL, type="source")), but I still get the error below:

Error: package or namespace load failed for ‘later’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/site-library/00LOCK-later/00new/later/libs/later.so':
  /usr/local/lib/R/site-library/00LOCK-later/00new/later/libs/later.so: undefined symbol: __atomic_fetch_add_8

Any thoughts?

I've also tried remotes::install_github('r-lib/later#106') since that build has a pull request. Also doesn't work. It's a bummer because this package is requisite in a lot of spatial packages like mapview and tmap.

jcheng5 commented 5 years ago

What OS version are you using?

plnnr commented 5 years ago

@jcheng5 (sorry late reply...)

$ hostnamectl
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 4.19.66-v7l+
Architecture: arm
daissi commented 5 years ago

Similar problem appears on Debian for armel and mipsel architectures. https://buildd.debian.org/status/package.php?p=r-cran-later

bearloga commented 4 years ago

Yup, running into the same issue with my Raspberry Pi 4 too, using Raspian Buster (based on Debian Buster)

$ hostnamectl
Operating System: Raspbian GNU/Linux 10 (buster)
          Kernel: Linux 4.19.75-v7l+
    Architecture: arm

$ g++ --version
g++ (Raspbian 8.3.0-6+rpi1) 8.3.0

P.S. This issue effectively makes devtools uninstallable because of its dependency on DT which depends on crosstalk which depends on shiny which depends on httpuv which depends on later.

wch commented 4 years ago

We don't have RPi to develop on. If anyone would like to provide a PR with a configure script that detects when -latomic is necessary (see https://github.com/r-lib/later/issues/73#issuecomment-463689967), we'd be happy to look at it.

bearloga commented 4 years ago
pi@raspberrypi:~/Downloads $ R CMD INSTALL later
* installing to library ‘/home/pi/R/arm-unknown-linux-gnueabihf-library/3.5’
* installing *source* package ‘later’ ...
Raspbian OS detected, make sure to install libboost-atomic-dev
** libs
make: Nothing to be done for 'all'.
installing to /home/pi/R/arm-unknown-linux-gnueabihf-library/3.5/later/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
* DONE (later)
bearloga commented 4 years ago

Thank you, @wch!!

marton-balazs-kovacs commented 4 years ago

Sorry if it is obvious but I still run into the same problem on raspbian 10 when I try to install later 1.0.0. or 0.8.0 with R CMD INSTALL. How could you solve the issue? @bearloga

bearloga commented 4 years ago

@marton-balazs-kovacs installing from CRAN gives me the same problem (even though the patched version is on CRAN) but installing the development version worked for me:

# install.packages("remotes")
remotes::install_github("r-lib/later")
wch commented 4 years ago

We're also working on releasing a new version of later to CRAN. Hopefully it'll go through some time this week.

marton-balazs-kovacs commented 4 years ago

Thanks everyone! I have tried from CRAN and it worked.