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
So, that file is generated by this file in TBB’s build system. In particular, that line expands the Windows variable %COMPUTERNAME%. For some reason, on your student’s machine, this variable seems to be expanding to %,?%`%", which has an extra " in it and is causing this headache.
The simplest thing to do is probably open that file in something like notepad, and change the first line to #N ": BUILD_HOST\t\tMy Computer" ENDL \
I’ve attached a version with this string changed, which you can drag-and-drop (remember to rename it without the .txt suffix the forums requires)
Using the version_string.ver file you provided seemed to have fixed that error but we still got another (different one?)
Anyway, her computer name was ‰„‰‘‰“ which I’m guessing was because the name as it appeared in the Settings > System > About was comprised of non-ASCII characters?
This was sort of what I figured might be happening. While I’ve never seen it crop up specifically here, the Windows support for non-ascii code pages has a near endless number of edge cases in situations like this. Unfortunately our (and a lot of open source in general) coverage of Windows developers is sparse, and so the odds of us seeing this kind of thing before a user does is super low.
I got cmdstan to work fine with WSL. I’m installing rstudio and then rstan through WSL on windows and it’s working fine. Some dependencies to install, but this is cool. It’s like Ubuntu
So I’ll stop spamming this thread, but there’s issues with using git and WSL, there’s a bug report, and the recursive option doesn’t work (and some missing directories or files). So for cloning, I’m using MINGW64 terminal, and then I’m copying it over to WSL to run, because I couldn’t get make to work on MINGW64. And I think I had to install sundails, tbb from source on WSL to get cmdstan to run. Just in case this helps anyone.