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

on Windows, How to solve above problems?

What folder have you installed CmdStan? (Not cmdstanr but cmdstan)

yes, cmdstanr
Is this wrong?

Do you have a cmdstan in that folder?

no.
So, you mean ‘cmdstan_path ← path / to / cmdstanr / cmdstan’?

path / to / cmdstan

Maybe you have one in ~/.cmdstan

?

Have installed CmdStan manually?

Hi,
I’m encountering same issue on my Mac where I receive the following error message: “Error: CmdStan path has not been set yet. See ?set_cmdstan_path.” Can you provide guidance on how to resolve this problem? Any assistance greatly appreciated.

Hi, welcome to the Stan forum. Have you tried installing CmdStan using cmdstanr::install_cmdstan()?