[R-SIG-Mac] trouble loading C++-using packages on El Capitan

Kevin Ushey kev|nu@hey @end|ng |rom gm@||@com
Thu May 30 18:11:50 CEST 2019


Hi,

Some users have reported issues when attempting to load packages using
C++ code on El Capitan -- for example:

Error: package or namespace load failed for ‘readr’ in dyn.load(file,
DLLpath = DLLpath, ...):
unable to load shared object
'/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/libs/Rcpp.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/libs/Rcpp.so,
6): Symbol not found: ___cxa_uncaught_exceptions
Referenced from:
/Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib
Expected in: /usr/lib/libc++abi.dylib
in /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib

The main thing that stands out to me is that /usr/lib/libc++abi.dylib
is being requested, rather than the libc++abi library that's
distributed with the macOS R binaries. I can confirm as much in my R
3.6.0 installation:

kevin using cdrv:/Library/Frameworks/R.framework/Resources/lib
$ otool -L libc++.1.dylib
libc++.1.dylib:
        /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib
(compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current
version 400.17.0)
        /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++abi.1.dylib
(compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 1252.200.5)

This can be changed with install_name_tool; e.g.

install_name_tool -change \
    /usr/lib/libc++abi.dylib \
    /Library/Frameworks/R.framework/Resources/lib/libc++abi.1.dylib \
    /Library/Frameworks/R.framework/Resources/lib/libc++.1.dylib

And this did fix the issue for one user
(https://community.rstudio.com/t/installing-packages-after-update-to-3-6-same-problem/31824)

My question is: is the usage of the system's libc++abi intentional, or
should that be pointing to the bundled libc++abi?

Thanks,
Kevin



More information about the R-SIG-Mac mailing list