Problems with external library conflict in R package

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problems with external library conflict in R package

Pascal.Niklaus
I have an R library (using Rcpp) that used to compile and install fine.
It uses some boost libraries. My Makevars file looks like this:

PKG_LIBS=`$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` -lboost_iostreams -lm
CXX_STD = CXX14

The problem I face now is that for some other R-independent software
project I installed boost 1.71 from source in /usr/local. Since then,
the R package does not install anymore; I get:

Error: package or namespace load failed (...) dyn.load(file, DLLpath =
DLLpath, ...):
  unable to load shared object (...) XXX.so
  undefined symbol: _ZN5boost9iostreams6detail10bzip2_base3endEbSt9nothrow_t

Both the distribution's includes and library files and the ones I
installed in /usr/local are there:

$ locate boost/iostreams/filter/bzip2.hpp
/usr/include/boost/iostreams/filter/bzip2.hpp
/usr/local/include/boost/iostreams/filter/bzip2.hpp

$ ldconfig -p | grep boost_ios
         libboost_iostreams.so.1.71.0 (libc6,x86-64) =>
/usr/local/lib/libboost_iostreams.so.1.71.0
         libboost_iostreams.so.1.65.1 (libc6,x86-64) =>
/usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.65.1

When I als specify -L/usr/local/lib in Makevars, the code installs fine.

There is probably a simple answer, but I don't understand why I get this
mismatch between library versions. Any help is appreciated!

Thanks

Pascal

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.