<meta http-equiv="content-type" content="text/html; charset=utf-8">I apologize if this has been covered. I've looked and see a couple of post relating to this issue, but I'm not sure if it was ever solved. The example modules appear to not work, at least for me. On a related note I can't get my modules to run either, but If I can figure out how to run the examples I think I can get mine running.<div>
<br></div><div>R> sessionInfo()<div>R version 2.13.0 (2011-04-13)</div><div>Platform: x86_64-pc-linux-gnu (64-bit)</div><div><br></div><div>locale:</div><div> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C </div>
<div> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 </div><div> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 </div><div> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C </div><div> [9] LC_ADDRESS=C LC_TELEPHONE=C </div>
<div>[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C </div><div><br></div><div>attached base packages:</div><div>[1] stats graphics grDevices utils datasets methods base </div><div><br></div><div>
other attached packages:</div><div>[1] Rcpp_0.9.4</div><div><div><br></div></div></div><div>To install the package skeleton:</div><div>$ r -lRcpp -e"Rcpp.package.skeleton(\"test\",module=T)"</div><div>
Attaching package: 'utils'</div><div><br></div><div>The following object(s) are masked from 'package:Rcpp':</div><div><br></div><div> .DollarNames, prompt</div><div><br></div><div>Creating directories ...</div>
<div>Creating DESCRIPTION ...</div><div>Creating NAMESPACE ...</div><div>Creating Read-and-delete-me ...</div><div>Saving functions and data ...</div><div>Making help files ...</div><div>Done.</div><div>Further steps are described in './test/Read-and-delete-me'.</div>
<div><br></div><div>Adding Rcpp settings</div><div> >> added RcppModules: yada</div><div> >> added Depends: Rcpp</div><div> >> added LinkingTo: Rcpp</div><div> >> added useDynLib directive to NAMESPACE</div>
<div> >> added Makevars file with Rcpp settings</div><div> >> added Makevars.win file with Rcpp settings</div><div> >> added example header file using Rcpp classes</div><div> >> added example src file using Rcpp classes</div>
<div> >> added example R file calling the C++ example</div><div> >> added Rd file for rcpp_hello_world</div><div> >> copied the example module </div><div><br></div><div>build</div><div>$ R CMD build test</div>
<div><<output omitted>></div><div><br></div><div>and check with an error.</div><div>$R CMD check test_1.0.tar.gz</div><div><div><<output omitted>></div></div><div><div>* checking whether the name space can be loaded with stated dependencies ... WARNING</div>
<div>Error: .onLoad failed in loadNamespace() for 'test', details:</div><div> call: value[[3L]](cond)</div><div> error: failed to load module yada from package test</div><div>Execution halted</div></div><div><br>
</div><div><<output omitted>></div><div><br></div><div>According to Dirk's June 15th post on the issue I include <span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">require("methods", character=TRUE, quietly=TRUE) in the .onLoad function, now checks ok but when trying things out I get a segmentation fault.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">$ R -q --vanilla</span></div><div><font class="Apple-style-span" face="arial, sans-serif"><div><span class="Apple-style-span" style="border-collapse: collapse; ">R> library(test)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; ">Loading required package: Rcpp</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">R> Module('yada','test')$bla()</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "> *** caught segfault ***</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">address 0x90, cause 'memory not mapped'</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">Traceback:</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "> 1: .Call(symbol)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "> 2: Module(module, mustStart = TRUE)</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "> 3: .getModulePointer(x)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "> 4: Module("yada", "test")$bla</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "><br></span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; ">Possible actions:</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">1: abort (with core dump, if enabled)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; ">2: normal R exit</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">3: exit R without saving workspace</span></div><div>
<span class="Apple-style-span" style="border-collapse: collapse; ">4: exit R saving workspace</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">Selection: </span></div><div style="border-collapse: collapse; ">
<br></div></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; ">So questions are:</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; "> 1) is anyone else getting this error?</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; "> 2) does anyone know how to fix it?</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; "><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; ">Thanks,</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; ">Andrew</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; "><br></span></font></div>