[Rcpp-devel] iak problem -- dyn.load unable to load shared object

Glenn Lawyer lawyer at mpi-inf.mpg.de
Fri Dec 14 14:12:16 CET 2012


Thanks, Dirk, Romain, for your insights.

The problem was the following line in my .bashrc
export PKG_CPPFLAGS='-I/TL/opt/R-2.13.2/library/Rcpp/include'

which included Rcpp 0.9.0 in the compilation, creating the 
undefined symbol (since Rcpp 0.10.1 has a different signature for 
r_vector_start).

Wishing you both and the rest of the list a good weekend,

+glenn



On 12/13/2012 05:21 PM, Romain Francois wrote:
> Do you have the same version of Rcpp as root and as non root ?
>
> You can use c++filt to demangle the name, e.g. what does this 
> give you:
>
> $ c++filt _ZN4Rcpp8internal14r_vector_startILi14EdEEPT0_P7SEXPREC
>
> r_vector_start has changed in 0.10.1, i.e. it lost a template 
> parameter, which is likely to be the case here. I suppose you 
> have two versions of Rcpp installed;
>
> Romain
>
> Le 13/12/12 17:08, Glenn Lawyer a écrit :
>> The problem seems to be file privileges. When I run R as 
>> superuser, it
>> works. When I run as a normal user, I continue getting
>>
>> Error in dyn.load(libLFile) :
>>    unable to load shared object 
>> '/tmp/RtmpTFHtzm/file1d365e7eaf51.so':
>>    /tmp/RtmpTFHtzm/file1d365e7eaf51.so: undefined symbol:
>> _ZN4Rcpp8internal14r_vector_startILi14EdEEPT0_P7SEXPREC
>>
>> Note that the names of the undefined symbol is the same for all 
>> of the
>> ways and examples I have tested, which include:
>> cxxfunction (following the vignette)
>> cppFunction (following Hadley's tutorial)
>> R CMD INSTALL -l foo mypackage
>> where "mypackage" is created by Rcpp.package.skeleton("mypackage")
>> R CMD INSTALL -l foo somepackage.tar.gz
>> where "somepackage" is a package downloaded from CRAN which 
>> uses Rcpp.
>>
>> I would very much appreciate a hint/suggestion as to which
>> folders/directories/paths I may need to check to get the file
>> permissions correct.
>>
>> Does the name of the undefined symbol tell you anything? If you 
>> ignore
>> some characters, it reads
>> ...Rccp.internal..r_vector_start...SEXPR..
>>
>> +glenn
>>
>>
>>
>> On 12/12/2012 05:15 PM, Dirk Eddelbuettel wrote:
>>> Works for me:
>>>
>>> R> require(Rcpp)
>>> R> require(inline)
>>> Loading required package: inline
>>> R> inc <- '
>>> +    using namespace Rcpp;
>>> +    double norm( double x, double y ) {
>>> +    return sqrt( x*x + y*y );
>>> +    }
>>> +    RCPP_MODULE(mod) {
>>> +    function( "norm", &norm );
>>> +    }
>>> + '
>>> R> fx <- cxxfunction(signature(), plugin="Rcpp", include=inc)
>>> R>
>>> R> mod <- Module( "mod", getDynLib(fx) )
>>> R>
>>> R> mod$norm( 3, 4 )
>>> [1] 5
>>> R>
>>> R> sessionInfo()
>>> R version 2.15.2 (2012-10-26)
>>> Platform: x86_64-pc-linux-gnu (64-bit)
>>>
>>> locale:
>>>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               
>>> LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     
>>> LC_MONETARY=en_US.UTF-8
>>>   [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=C                 
>>> LC_NAME=C                  LC_ADDRESS=C               
>>> LC_TELEPHONE=C
>>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>>
>>> attached base packages:
>>> [1] stats     graphics  grDevices utils     datasets  
>>> methods   base
>>>
>>> other attached packages:
>>> [1] inline_0.3.10   RQuantLib_0.3.9 Rcpp_0.10.1.5
>>>
>>> loaded via a namespace (and not attached):
>>> [1] compiler_2.15.2 tools_2.15.2
>>> R>
>>>
>>> That is with Rcpp from SVN but that shouldn't matter.
>>>
>>> Dirk
>>>
>>
>> -- 
>> --------------------------------------------------------------
>> Pirating science, because open access isn't always open enough
>> www.scipirate.com                                    @piratesci
>>
>>       Dr. Glenn Lawyer
>>       +352 661 967 244
>>       Max-Planck-Institut für Informatik
>>       Computational Biology and Applied Algorithmics
>>       Campus E1 4
>>       66123 Saarbrücken, Germany
>>       http://bioinf.mpi-inf.mpg.de/~lawyer
>>
>>
>>
>> _______________________________________________
>> 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 
>>
>>
>
>

-- 
--------------------------------------------------------------
Pirating science, because open access isn't always open enough
www.scipirate.com                                   @piratesci

      Dr. Glenn Lawyer
      +352 661 967 244
      Max-Planck-Institut für Informatik
      Computational Biology and Applied Algorithmics
      Campus E1 4
      66123 Saarbrücken, Germany
      http://bioinf.mpi-inf.mpg.de/~lawyer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121214/2798c422/attachment.html>


More information about the Rcpp-devel mailing list