Help creating package with rstan_package_skeleton


I’m having some difficulties creating an R package using rstantools::rstan_package_skeleton().

When I try to build the package i get this error :

* installing to library ‘/usr/local/lib/R/site-library’
g++ -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o stan_files/ init.o -L/usr/local/lib/R/lib -lR
* installing *source* package ‘IMPriorsPARCC’ ...
** libs
/usr/local/lib/R/share/make/ recipe for target '' failed
/usr/bin/ld: cannot find stan_files/: File format not recognized
collect2: error: ld returned 1 exit status
make: *** [] Error 1
ERROR: compilation failed for package ‘IMPriorsPARCC’
* removing ‘/usr/local/lib/R/site-library/IMPriorsPARCC’

Exited with status 1.

Any clues about what I could be missing?

I uploaded my code to github, in case that helps: (edited)


You should use rstan_package.skeleton from rstantools 1.5.0. At least you will get a different error message. See also its vignette.


Yeah what @bgoodri said.

I’ll make an announcement about the rstantools release as well as the release of the other R packages shortly.