I'm trying to install cmdstanr from GitHub via devtools::install_github("stan-dev/cmdstanr")
Expected behavior
Successful package install followed by the need to call cmdstanr::install_cmdstan(), which installs CmdStan and sets the path.
Error
Installation fails with the following:
✔ checking for file ‘/tmp/RtmpRH3cgr/remotesb1b5b912816/stan-dev-cmdstanr-edf9bad/DESCRIPTION’ ...
─ preparing ‘cmdstanr’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘cmdstanr_0.1.1.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘cmdstanr’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘cmdstanr’:
.onAttach failed in attachNamespace() for 'cmdstanr', details:
call: NULL
error: CmdStan path has not been set yet. See ?set_cmdstan_path.
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/cmdstanr’
Error: Failed to install 'cmdstanr' from GitHub:
(converted from warning) installation of package ‘/tmp/RtmpRH3cgr/fileb1b12559732/cmdstanr_0.1.1.tar.gz’ had non-zero exit status
To Reproduce
On a fresh machine image without the package or CmdStan installed / path set run devtools::install_github(...)
Operating system
Amazon Linux 2 AMI
CmdStanR version number
GitHub master
Additional context
I can still install via install.packages("cmdstanr", repos = ...)
Could be something in #273? I successfully installed with this method on a fresh machine image earlier this week, prior to that PR.
Indeed, the problem is that check fails if there is no "current version" to check against. Let me see if there is an easy fix for that. Otherwise I will revert that PR and we will reapply a fixed version of that.
I think I have a fix for this. Can open a PR in a few min
@nerutenbeck Thanks for reporting this. This is definitely due to a mistake I made in #273. Should be fixed by #275.