[R-pkg-devel] Using Rcpp to set up a package

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue May 5 22:24:01 CEST 2020


Jim,

This is not the list for Rcpp discussions, as the package and its
documentation have been saying for a decade you should subscribe
to the rcpp-devel list.

Allow me to add one item:

On 5 May 2020 at 19:58, James Owen Ramsay, Dr. wrote:
| I’m working on max OS-X 10.15.3, using R 4.0.0, and updated Xcode as well as updated tools:
| 
| Here’s my setup of a package called Data2LD2. (An update of an existing package Data2LD already on Iran):
| 
| code_files = c("~/Documents/R/Data2LDRcpp/R/Atensorfn.R",
|               "~/Documents/R/Data2LDRcpp/R/BAtensorfn.R",
|               "~/Documents/R/Data2LDRcpp/R/Btensorfn.R",
|               "~/Documents/R/Data2LDRcpp/R/checkModel.R",
|               "~/Documents/R/Data2LDRcpp/R/Data2LD.opt.R",
|               "~/Documents/R/Data2LDRcpp/R/Data2LD.R",
|               "~/Documents/R/Data2LDRcpp/R/fun.explinear.R",
|               "~/Documents/R/Data2LDRcpp/R/fun.Dexplinear.R",
|               "~/Documents/R/Data2LDRcpp/R/getForceterm.R",
|               "~/Documents/R/Data2LDRcpp/R/getHomoTerm.R",
|               "~/Documents/R/Data2LDRcpp/R/inprod.TPbasis.R",
|               "~/Documents/R/Data2LDRcpp/R/make.Fterm.R",
|               "~/Documents/R/Data2LDRcpp/R/make.Xterm.R",
|               "~/Documents/R/Data2LDRcpp/R/make.Variable.R",
|               "~/Documents/R/Data2LDRcpp/R/modelList2Vec.R",
|               "~/Documents/R/Data2LDRcpp/R/modelVec2List.R",
|               "~/Documents/R/Data2LDRcpp/R/printMatrix.R",
|               "~/Documents/R/Data2LDRcpp/R/printModel.R")
| 
| cpp_files = c("~/Documents/R/Data2LDRcpp/src/DASarrayFnCpp",
|              "~/Documents/R/Data2LDRcpp/src/DBSarrayFnCpp",
|              "~/Documents/R/Data2LDRcpp/src/DRarrayFnCpp",
|              "~/Documents/R/Data2LDRcpp/src/loopJuanCpp",
|              "~/Documents/R/Data2LDRcpp/src/RmatFnCpp",
|              "~/Documents/R/Data2LDRcpp/src/SmatFnCpp")
| 
| Rcpp.package.skeleton(name="Data2LD2", 
|                      code_files=code_files,
|                      cpp_files =cpp_files,
|                      author="James Ramsay",
|                      maintainer="James Ramsay",
|                      force=TRUE)

I have created many packages using Rcpp.package.skeleton(), but I usually do
NOT supply lists of files. I would consider starting with an empty package,
and adding files as you go along.  For a deeper look it usually helps us most
to actually _see_ the code so if it is in public repo, tell us.

| Here’s the bad news from R CMD check:
| 
| Error: package or namespace load failed for ‘Data2LD2’ in dyn.load(file, DLLpath = DLLpath, ...):
| unable to load shared object '/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so':
|  dlopen(/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so, 6): Symbol not found: _DASarrayFnCpp
|  Referenced from: /Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so
|  Expected in: flat namespace

We've seen that error but I don't recall from the top of my head where this
leads.

Overall, I would expect this to be simple to fix. Let's lay out the files as
expect, let's run `compileAttributes()` (if you use Rcpp Attributes as one
should) and let's take it from there.

But let's maybe have that discussion over at rcpp-devel.

Best,  Dirk


| in /Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so
| Error: loading failed
| Execution halted
| ERROR: loading failed
| * removing ‘/Users/jimramsay/Documents/R/Data2LD2.Rcheck/Data2LD2’
| 
| I’m getting this failure after many iterations of this setup, this being the simplest and most direct that I know.
| 
| Sure would like some help (or some sympathy at least)
| 
| Jim Ramsay
| ______________________________________________
| R-package-devel using r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list