RcppCore / RcppEigen

Rcpp integration for the Eigen templated linear algebra library
Other
111 stars 40 forks source link

Different RcppEigen.package.skeleton behavior depending on whether the pkgKitten package is installed #79

Closed Mervap closed 4 years ago

Mervap commented 4 years ago

Let me try to explain what is the problem Consider the following sequence of operations from the console:

> mkdir tmp
> cd tmp
> mkdir myPackage

After that, it is obvious that tmp contains only the myPackage folder and the myPackage folder is empty

Now I want to create a new R package inside the myPackage folder

Now consider 2 cases:

  1. The pkgKitten package is not installed on the current interpreter I run following code

    > R -q -e "RcppEigen::RcppEigen.package.skeleton('myPackage', force = T)"

    and get the next one output

    Calling package.skeleton to create basic package. Creating directories ... Creating DESCRIPTION ... Creating NAMESPACE ... Creating Read-and-delete-me ... Saving functions and data ... Making help files ... Done. Further steps are described in './myPackage/Read-and-delete-me'.

    Adding RcppEigen settings >> added Imports: Rcpp, RcppEigen >> added LinkingTo: Rcpp, RcppEigen >> added useDynLib and importFrom directives to NAMESPACE >> added Makevars file with RcppEigen settings >> added Makevars.win file with RcppEigen settings >> added example src file using Eigen classes >> added example Rd file for using Eigen classes >> invoked Rcpp::compileAttributes to create wrappers

    Let's look inside the myPackage folder

    > ls myPackage/
    DESCRIPTION  man  NAMESPACE  R  Read-and-delete-me  src

    Great! The package was created

  2. The pkgKitten package is installed on the current interpreter now Let's try

    > R -q -e "RcppEigen::RcppEigen.package.skeleton('myPackage', force = T)"

    Calling kitten to create basic package. Error: Directory 'myPackage' already exists. Aborting.

    Oops, error. And the directory is of course empty.

I think this behavior is unacceptable. It depends on some external factors. Are you sure you want to use the pkgKitten package? Or maybe you should give the user a choice whether to use it? The directory where I want to create the package may be not empty. I would like to be able to create a package without first deleting pkgKitten every time. Thanks

eddelbuettel commented 4 years ago

Please close this bug report and open one on pkgKitten.

You are free to uninstall pkgKitten should you have it installed. It is just a suggested package -- if you don't want it, don't use it.

eddelbuettel commented 4 years ago

And yes, I want it. I wrote it for Rcpp and also use it for RcppArmadillo and RcppEigen, and it has been used in the present form for many years. It's an optional feature.

Mervap commented 4 years ago

Okey But it seems very strange to me that the behavior described above does not lead to an error in Rcpp and does it on RcppArmadillo and RcppEigen Shouldn't the behavior be similar?