Compiling Stan program...
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
C
:\rtools45\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -ltbb: No such file or directory
C:\rtools45\x8
6_64-w64-mingw32.static.posix\bin/ld.exe: cannot find stan/lib/stan_math/lib/tbb/tbb.dll: No such file or directory
collect2.exe: error: ld returned 1 exit status
make: *** [make/program:82: C:/Users/yahli/AppData/Local/Temp/RtmpItUWJj/model-670470cb6958.exe] Error 1
Error: An error occured during compilation! See the message above for more information.
I don’t know much about Windows TBB issues, so hopefully @WardBrian or someone else can chime in here. But I think some of the important output may come earlier in the installation output, not just the last few lines. Earlier in the output were there any TBB related error messages?
Also, one important question:
Is the cmdstanr installation from the “release” on r-universe (e.g. installed via install.packages(“cmdstanr”, repos = c(‘``https://stan-dev.r-universe.dev``’, getOption(“repos”)))) or was it installed from Github (e.g. via remotes::install_github or pak::pak)? If it was installed from GitHub, how recently was it installed? We very recently (~5 days ago) merged a pull request that affects how the toolchain is handled on Windows, so it would be good to know how cmdstanr was installed and when.
I think I had an issue with this. Go for command-line installations of the dependencies and make sure the versions are correct. Stan Math Library: Stan Math Library Docs are the proper packages, and then you can use, on ubuntu, sudo apt install blah blah, or I was using WSL (windows subsystem for linux) and I think you can use the same commands, I don’t remember. If you’re on windows, WSL is like a separate VM, that operates like ubuntu. I think it also uses apt. So I would make sure the stan/math dependencies are there first and then try re-installing. Also make sure you have the rtools tool chains installed, stuff like that.
They could try installing from GitHub and then restart R before trying to install_cmdstan again. I doubt that would fix it, but it shouldn’t hurt so maybe worth a shot.
Do you know if this is a personal computer or if it’s a managed university/work machine? If the former, it’s possible that just removing and reinstalling RTools could fix this. If the latter, it could be maybe be some policy/security restriction, but it’s hard to say just from that output.
And then there may be dependencies you have to add. Check out I think I had to add some additional repos for the package manager, and then there was additional tool chains that I had to install in order to get TBB to run with cmdstan properly. There’s a way to add another repo that aren’t on the stock apt package manager repos. I saved some references, but they’re not comprehensive.
And you may have to follow the paper trail, and add some additional toolchains, to get cmdstan to cooperate with WSL.
I would just keep looking up stuff on stackoverflow and technical documentation and keep installing stuff… if it says cannot find xxx go ahead and look it up install instructions on stack overflow.
WSL operates like ubuntu, it’s kinda like a virtual machine. Good luck. This took me a few days.
Thanks for the full log. It appears there is an issue with the TBB build. Could you go to their cmdstan folder and get the contents of CMDSTAN/stan/lib/stan_math/lib/tbb/version_string.ver?
My hunch is that the first couple lines of this file will be missing a " (or possibly have too many), but I haven’t previously encountered this