Pascal A. Niklaus
2019-Oct-31 18:17 UTC
[R] Problems with external library conflict in R package
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