[Rcpp-devel] Rcpp Modules - Failed to initialize module pointer

schattenpflanze at arcor.de schattenpflanze at arcor.de
Sat Apr 9 18:31:58 CEST 2011


> Is there a way to load/initialize the module in such a way that
>  > library(testmod)
>  > yada
> immediately yields the full description above?
Aha, it seems that setting the (yet undocumented) option 'mustStart' to 
'TRUE' in the Module command inside .onLoad() does the trick :-).

Best regards,
Peter



> Am 09.04.2011 14:11, schrieb schattenpflanze at arcor.de:
>> Hello,
>>
>> I would like to use the very nice Rcpp (0.9.3) Module feature to expose
>> C++ functions to R. As a starting point, I tried to get the "testmod"
>> package, created with
>> Rcpp.package.skeleton( "testmod", module = TRUE )
>> to run. I can compile and install the package without errors on R
>> 2.14.0, Suse Linux 11.3. However, when I try to use the module, I get
>> the following output:
>>
>>> require(Rcpp)
>> Lade nötiges Paket: Rcpp
>>> library(testmod)
>> Attaching package: ‘testmod’
>> The following object(s) are masked _by_ ‘.GlobalEnv’: yada
>>> yada
>> Uninitialized module named "yada" from package ".GlobalEnv"
>>> yada <- Module( "yada" )
>>> yada$foo( 1,2 )
>> Fehler in Module(module, mustStart = TRUE) :
>> Failed to initialize module pointer: Error in
>> FUN("_rcpp_module_boot_yada"[[1L]], ...): no such symbol
>> _rcpp_module_boot_yada in package .GlobalEnv
>>
>> I have seen the previous thread on a similar error, and I suppose the
>> error is related to Section 3 of the Rcpp-modules vignette. The
>> .onLoad() routine, however, is already present in the testmod package. I
>> have also tried to replace the contents of zzz.R with the code given in
>> Section 3.1.1 of the vignette (using populate()), with the same result.
>> What do the error messages above actually mean and what am I missing
>> here?
>>
>> Best regards,
>> Peter
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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



More information about the Rcpp-devel mailing list