Error installing Torsten

This is an error when installing RTorsten on a Windows 10 machine.

> source("install.R")
Loading required package: usethis
Loading torstenHeaders
 Error in utils::unzip(file.path(td, "math.zip"), exdir = td) : 
  cannot open file 'C:/Users/wk/AppData/Local/Temp/Rtmp8mWImR/torsten/math-80d832d9353ba085f48d09a8d39225e6957cd43c/lib/boost_1.69.0/doc/html/boost_asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/completion_handler_type.html': No such file or directory 

Any idea how to fix this? Installation works fine on mac. I did edit the makevars file per the instructions.

@yizhang

Can you enable long paths? There is somewhere a setting for that (+reboot)

1 Like

This is likely caused by windows’ limit on path length to 260 char, as @ahartikainen mentioned you can resolve this by turning on long path in register or moving to a working directory with shorter path.

Meanwhile, @billg and I are evaluating cmdstanr as Torsten’s R interface. You can try it with develop branch of Torsten. Just follow the introduction, and add to cmdstan/make/local: STANC2=true. I’ll add a workflow demo by @billg soon.

1 Like

Thanks for the pointers. These installations issues came up during the Torsten workshop at U Buffalo.

I had no problem installing Torsten on my mac, and in fact, I’ve already been experimenting with cmdstanr as the R interface. The following manipulations in R were enough:

library(cmdstanr)
set_cmdstan_path(.../Torsten/cmdStan)

This didn’t quite work on the windows machine because g++ was not installed (but that’s a broader issue).

I’ll add a workflow demo by @billg soon.

Looking forward.

yes that’s a windows-only issue also encountered by another user.

This won’t work for cmdstan 2.22+. You’ll need that STANC2 macro mentioned earlier. In the final release we’ll provide Torsten’s stanc3 binaries.

Its nicer to do this by just using

mod <- cmdstan_model(file, compiler_flags = c("STANC2=true"))

But that will only work with latest develop cmdstan (as of Feature/819 makefile stanc2 stanc3 by mitzimorris · Pull Request #820 · stan-dev/cmdstan · GitHub).
2.22.1 release required a make clean and rebuild of cmdstan.

2 Likes