[Rcpp-devel] [Summary] (Was: question re: LdFlags, RcppLdFlags

Dirk Eddelbuettel edd at debian.org
Thu Oct 10 18:16:51 CEST 2013


On 10 October 2013 at 18:02, Romain Francois wrote:
| To give some context, I'm taking about using R's linking mechanism. I'm 
| talking about generating automatically the code that:
| - registers a function with R_RegisterCCallable
| - grabs the function with R_GetCCallable

[...]

| The name as given by nm definitely contains namespace information.

You are making the heroic assumption that libraries are never stripped, this
is something you have no control.  Eg each of the 100+ r-cran-* packages in
Debian and Ubuntu will by default be stripped, leading to your approach to go
belly-up: 

edd at max:~$ nm /usr/lib/R/site-library/tseries/libs/tseries.so 
nm: /usr/lib/R/site-library/tseries/libs/tseries.so: no symbols
edd at max:~$ 

"No symbols".

This is a standard distro package a user may have:

edd at max:~$ dpkg -S /usr/lib/R/site-library/tseries/libs/tseries.so
r-cran-tseries: /usr/lib/R/site-library/tseries/libs/tseries.so
edd at max:~$ 


So this approach can't be assumed to work _portably across compilers and os
[distros]_ as I asked about earlier -- and which you chose to ignore.

You can look at nm _on your box_ to learn about (unstripped) libraries.  But
I would surmise that you cannot rely on this to build a tool chain.

Dirk

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


More information about the Rcpp-devel mailing list