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

Dirk Eddelbuettel edd at debian.org
Tue Mar 18 16:00:21 CET 2014


Andreas,

On 18 March 2014 at 15:45, Andreas Recke wrote:
| maybe I can add some more details about my problem. It has been
| addressed before at stackoverflow:
| 
| http://stackoverflow.com/questions/21657575/what-does-this-mean-in-lme4-function-dataptr-not-provided-by-package-rcpp

Yes, I also found that thread when I thinking to recommend that one shall
also Google error messages as Googling the string

     function 'dataptr' not provided by package 'Rcpp'

leads to it immediately.  

And the comments by Hadley and Ben still holds. You need

        (re-)install Rcpp 
        (re-)install RcppEigen 
        (re-)install lme4
 
| with the question:
| "I'm trying to do LMM using lme4, and this message pops up:
| 
| Error in initializePtr() : function 'dataptr' not provided by package 'Rcpp'
| 
| What should I do?"
| 
| As proposed there in the responses, I reinstalled Rcpp, RcppArmadillo
| and RcppEigen (in this order) from source packages.

You also need to reinstall lme4 if that it what you use.  See the release
announcement for Rcpp 0.11.0 and the script at 
   https://github.com/RcppCore/rcpp-logs/blob/master/scripts/showReverseRcppDepends.r

You also have to make sure that you actually load the rebuilt version. Maybe
you have several on your machine, rebuilt one 'later in the path' and then
accidentally load on older one that is 'earlier' in the path.  We can't tell,
we can only tell you that metric ton of Rcpp, RcppArmadillo, RcppEigen,
lme4. ... users all went through this too.  There is only one way to fix
this.



| However, when I look with nm into RcppEigen.so in the library folder, I
| find the following:
| 
| andreas at persephone:~/R/x86_64-pc-linux-gnu-library/3.0/RcppEigen/libs$
| nm RcppEigen.so | grep " u "
| 
| 
| 
| 
| 0000000000238e70 u _ZGVZ13error_occuredvE3fun
| 0000000000238e80 u _ZGVZ19reset_current_errorvE3fun
| 0000000000238bb8 u _ZGVZ20rcpp_get_stack_tracevE3fun
| 0000000000238bb0 u _ZGVZ20rcpp_set_stack_traceP7SEXPRECE3fun
| 0000000000238e60 u _ZGVZ22rcpp_get_current_errorvE3fun
| 0000000000238ba0 u _ZGVZ7dataptrP7SEXPRECE3fun
| 0000000000238ba8 u _ZGVZ8demangleRKSsE3fun
| 0000000000238e90 u _ZGVZN4Rcpp8internal18get_Rcpp_namespaceEvE3fun
| 0000000000238e10 u _ZZ13error_occuredvE3fun
| 0000000000238e30 u _ZZ19reset_current_errorvE3fun
| 0000000000238b80 u _ZZ20rcpp_get_stack_tracevE3fun
| 0000000000238b70 u _ZZ20rcpp_set_stack_traceP7SEXPRECE3fun
| 0000000000238e00 u _ZZ22rcpp_get_current_errorvE3fun
| 0000000000238b60 u _ZZ7dataptrP7SEXPRECE3fun                  <-----
| here is the missing function

You simply misunderstand.  The 'no library required' mechanism didn't remove
the need for dataptr, but this symbol, as the other Rcpp symbols, are now
private by R itself via a variant of dlopen().  We can discuss that in more
detail if you really care.

Witness:


edd at max:~$ locate RcppEigen.so | grep /usr                     # only one RcppEigen
/usr/local/lib/R/site-library/RcppEigen/libs/RcppEigen.so
edd at max:~$ nm /usr/local/lib/R/site-library/RcppEigen/libs/RcppEigen.so | grep " u " | grep dataptr
00000000002399a0 u _ZGVZ7dataptrP7SEXPRECE3fun                 # same issue you focus on
0000000000239960 u _ZZ7dataptrP7SEXPRECE3fun
edd at max:~$ Rscript -e 'print(.libPaths()); library(RcppEigen); print(search())'
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"       "/usr/lib/R/library"           
[1] ".GlobalEnv"        "package:RcppEigen" "package:stats"    "package:graphics"  
[5] "package:grDevices" "package:utils"     "package:datasets" "Autoloads"         
[9] "package:base"     
edd at max:~$ 


The nm output is a red herring.  I show the same, yet I load RcppEigen fine.  Ok?


Dirk


| 0000000000238b90 u _ZZ8demangleRKSsE3fun
| 0000000000238e20 u _ZZN4Rcpp8internal18get_Rcpp_namespaceEvE3fun
| 0000000000238e40 u
| _ZZN5Eigen8internal20manage_caching_sizesENS_6ActionEPlS2_E13m_l1CacheSize
| 0000000000238e50 u
| _ZZN5Eigen8internal20manage_caching_sizesENS_6ActionEPlS2_E13m_l2CacheSize
| 0000000000033708 u
| _ZZN5Eigen8internal23triangular_solve_vectorIddlLi1ELi1ELb0ELi0EE3runElPKdlPdE10PanelWidth
| 0000000000033718 u
| _ZZN5Eigen8internal23triangular_solve_vectorIddlLi1ELi2ELb0ELi0EE3runElPKdlPdE10PanelWidth
| 0000000000033700 u
| _ZZN5Eigen8internal23triangular_solve_vectorIddlLi1ELi2ELb0ELi1EE3runElPKdlPdE10PanelWidth
| 00000000000336f8 u
| _ZZN5Eigen8internal23triangular_solve_vectorIddlLi1ELi5ELb0ELi0EE3runElPKdlPdE10PanelWidth
| 00000000000336f0 u
| _ZZN5Eigen8internal23triangular_solve_vectorIddlLi1ELi6ELb0ELi1EE3runElPKdlPdE10PanelWidth
| 0000000000033710 u
| _ZZN5Eigen8internal32triangular_matrix_vector_productIlLi2EdLb0EdLb0ELi0ELi0EE3runEllPKdlS4_lPdlRS3_E10PanelWidth
| 
| 
| This completely fits the above quoted error message. But I don't know
| how to solve this. Can you help?
| 
| Best regards,
| Andreas
| 
| 
| 
| 
| 
| 
| 
| On 18.03.2014 11:43, Andreas Recke wrote:
| > Hi,
| >
| > until recently, I used a very simple mechanism to compile and link my
| > C++/Rcpp/RcppArmadillo code for using it in R.
| > Since the last update, however, something has changed with the linking,
| > and the Rcpp shared library is not linked to
| > the final libary as before.
| > My question is, whether I need to change the my code to take these
| > changes into account? Is there a compatibility problem
| > with earlier versions of R and Rcpp?
| > 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.
| >
| > So here is my problem:
| >
| >  ******************* test.cpp ***************
| >  #include <iostream>
| >  #include <iomanip>
| >  #include <cmath>
| >  #include <RcppArmadillo.h>
| >
| >  using namespace Rcpp;
| >
| >  double norm(double x, double y)
| >  {
| >      return sqrt(x*x + y*y);
| >  }
| >
| >  RcppExport SEXP norm_wrapper(SEXP x_,SEXP y_)
| >  {
| >    // step 0: convert input to C++ types
| >    double x = as<double>(x_), y= as<double>(y_);
| >    // step 1: call the underlying C ++ function
| >    double res = norm (x,y);
| >    // step 2: return the result as a SEXP
| >    return wrap(res);
| >  }
| >  *******************
| >
| > *************** my makevars ****************
| >
| > PKG_CXXFLAGS=$(shell Rscript -e "Rcpp:::CxxFlags()") $(shell Rscript -e "RcppArmadillo:::CxxFlags()")
| > PKG_LIBS=$(shell Rscript -e "Rcpp:::LdFlags()") $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -lboost_system -lboost_thread
| >
| > ********************************************
| >
| >
| > ************* in bash, I compile with ***********
| > R CMD SHLIB test.cpp
| >
| > ****************************************************
| >
| > ************* in R console ****************
| >
| >> dyn.load("test.so")
| >> .Call("norm_wrapper", x_=2, y_=3)
| > and I get the error message, that function "dataptr" is not provided by
| > package "Rcpp" ...
| >
| > ******************************************
| > looking at test.so with nm , function "dataptr" is marked as unknown
| >
| > Until recently, the above described procedure worked fine. Maybe it is
| > possible to keep it available for
| > compatibility reasons.
| >
| > Andreas
| >
| >
| > 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
| >
| 
| --
| Dr. Andreas Recke
| Facharzt
| Klinik für Dermatologie, Allergologie und Venerologie
| Universitätsklinikum Schleswig-Holstein, Campus Lübeck
| Ratzeburger Allee 160
| 23538 Lübeck
| Tel.: +49 451 500 2530
| Fax.: +49 451 500 2981
| 
| [http://www.uksh.de/skin/uksh/tpl/infoportal/img/uk-sh_logo.gif]
| 
| Universitätsklinikum Schleswig-Holstein
| Rechtsfähige Anstalt des öffentlichen Rechts der Christian-Albrechts-Universität zu Kiel und der Universität zu Lübeck
| 
| Vorstandsmitglieder: Prof. Dr. Jens Scholz (Vorsitzender), Peter Pansegrau, Christa Meyer
| Vorsitzender des Aufsichtsrates: Rolf Fischer
| Bankverbindungen:
| Förde Sparkasse BLZ 210 501 70 Kto.-Nr. 100 206, IBAN: DE14 2105 0170 0000 1002 06 SWIFT/BIC: NOLA DE 21 KIE
| Commerzbank AG BLZ 230 800 40 Kto.-Nr. 300 041 200, IBAN: DE17 2308 0040 0300 0412 00 SWIFT/BIC: DRES DE FF 230
| 
| Diese E-Mail enthält vertrauliche Informationen und ist nur für die Personen bestimmt, an welche sie gerichtet ist.
| Sollten Sie nicht der bestimmungsgemäße Empfänger sein, bitten wir Sie, uns hiervon unverzüglich zu unterrichten und die E-Mail zu vernichten.
| Wir weisen darauf hin, dass der Gebrauch und die Weiterleitung einer nicht bestimmungsgemäß empfangenen E-Mail und ihres Inhalts gesetzlich verboten sind und ggf. Schadensersatzansprüche auslösen können.
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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


More information about the Rcpp-devel mailing list