Cmdstanr, cannot set the file path to the CmdStan installation

I can’t seem to set the file path to the CmdStan installation:

> devtools::install_github("stan-dev/cmdstanr")
...
Installing package into ‘/home/shira-rstudio/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
...
> library(cmdstanr)
This is cmdstanr version 0.0.0.9000
- Online documentation and vignettes at mc-stan.org/cmdstanr
- Use set_cmdstan_path() to set the path to CmdStan
- Use install_cmdstan() to install CmdStan
> cmdstan_default_install_path()
[1] "/home/shira-rstudio/.cmdstanr"
> logistic0 <- cmdstan_model("logistic0.stan")
Compiling Stan program...
Error: CmdStan path has not been set yet. See ?set_cmdstan_path.
> set_cmdstan_path("/home/shira-rstudio/R/x86_64-pc-linux-gnu-library/3.5/")
CmdStan path set to: /home/shira-rstudio/R/x86_64-pc-linux-gnu-library/3.5
Warning message:
Can't find CmdStan makefile to detect version number. Path may not point to valid installation. 

what should I try ? thanks so much !

You need to install cmdstan first. You can try install_cmdstan() or you can do it manually. I’ve used git in the terminal via

cd into_some_directory_you_want_to_install_to
git clone https://github.com/stan-dev/cmdstan.git --recursive

Looks like you’re on linux so once you’ve done the above you can do

make stan-update
make build 

optionally you can use multiple cores to do the build step as it takes about 5-10 min otherwise. Use make build -j4 for 4 core install.

Then use set_cmdstan_path(~\into_some_directory_you_want_to_install_to)

2 Likes