Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building the R package, "later," generates undefined symbol

Updating installed packages for R-3.5.2 (in Slackware-14.2) the "later" package fails to load because of this error:

/usr/lib/R/library/later/libs/later.so: undefined symbol: __atomic_fetch_add_8,

Web searches and folks on the r-help mail list were not able to resolve this issue.

Earlier versions of "later" had no problems installing and updating.

All suggestions will be followed up.

like image 283
Rich Shepard Avatar asked Mar 05 '23 10:03

Rich Shepard


1 Answers

Issue #73 on github discusses that on some platforms, one needs to add a flag -latomic even though std::atomic is part of the C++11 standard library.

Assuming you have C++11 installed on your Slackware 14.2, you should be able to:

git clone https://github.com/r-lib/later.git
nano later/src/Makevars # or whatever editor you prefer
# Change `PKG_LIBS = -pthread` to `PKG_LIBS = -pthread -latomic`
sudo R CMD INSTALL later

Update December 2019:

With the latest version of later, it now is:

git clone https://github.com/r-lib/later.git
nano later/src/Makevars.in # or whatever editor you prefer
# Change `PKG_LIBS = -pthread @extra_pkg_libs@` to `PKG_LIBS = -pthread -latomic @extra_pkg_libs@`
sudo R CMD INSTALL later
like image 171
sgrubsmyon Avatar answered Mar 16 '23 06:03

sgrubsmyon