[Rcpp-devel] Building shared libs with Rcpp does not work as before after Debian update

Dirk Eddelbuettel edd at debian.org
Tue Mar 18 13:34:41 CET 2014


On 18 March 2014 at 11:43, Andreas Recke wrote:
| I would like to have at least the option to use the command line to
| compile my code and to have it working even with different
| versions of R and Rcpp, especially because I found a way to use the
| THRUST library for parallel computing with Rcpp, Boost and R.

To clarify, and to be very plain: You obviously have the same option as
before, it simply is easier now as the PKG_LIBS now becomes (and I include
your boost libs here)

   PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -lboost_system -lboost_thread

(see eg the skeleton generated by RcppArmadillo) and the PKG_CFLAGS is as before

   PKG_CXXFLAGS=$(shell Rscript -e "Rcpp:::CxxFlags()") $(shell Rscript -e "RcppArmadillo:::CxxFlags()")

if you really insist on building on the command-line via

   R CMD SHLIB test.cpp

but by setting PKG_LIBS inside of R you _should_ be able to also use
sourceCpp() and cppFunction() from inside R to make your life easier.

| looking at test.so with nm , function "dataptr" is marked as unknown

It helped if you posted __the exact error message__ (and preferably in
English) and those error messages are pretty well recognised by Google and
usually lead to to the solution from an earlier post (and was just pointed
out to my by a friend who had 'forgotten' about the required rebuild
post-Rcpp 0.11.0 too).

| Until recently, the above described procedure worked fine. Maybe it is
| possible to keep it available for compatibility reasons.

Whether you recognise it or not, we work really hard at backwards
compatibility.  We didn't break anything, you "simply" missed the need for a
rebuild after the breaking-change release 0.11.0.

| By the way: I have R version 3.0.3 (2014-03-06) -- "Warm Puppy" on
| x86_64-pc-linux-gnu (64-bit), with Rcpp 0.11.1 from 3/12/2014

Reinstall RcppArmadillo and you should be fine. Also reinstall your package,
remove all .so files.  Rcpp no longer provides the old libRcpp.so which those
old shared libraries used and still expect.  They. Need. A. Rebuild.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list