I have been searching all available information on these forums, GitHub Issues, and Stackoverflow, and trying out various solutions, all without success, to install CmdStan on a Windows 11 machine, on which I do not have admin rights (though I can consult an admin when needed to install software).
I have done the following:
- Download CmdStan source code into C:/Users/(myname)/Documents/.cmdstan/cmdstan-2.34.1
- Run Rtools43 bash and use pacman to make sure the compilers are installed properly (or so I think)
- Attempt to install CmdStan in two different ways
- Tried it from within R
cmdstanr::install_cmdstan()
, after ensuring that all Rtools and that kind of thing are present in the PATH variable. - Opened the Rtools43 bash shell, added
/c/rtools43/mingw64/bin
to the PATH variable to make sure thatmingw32-make
andg++
are available, then navigate to the directory where CmdStan source code is and runmingw32-make build
- Tried it from within R
Regardless of which of these I try, I ultimately run into the following error message, which appears after a long string of output when running install_cmdstan()
in R, and appears immediately without any preceding output when running mingw32-make build
from the Rtools43 bash shell:
touch stan/lib/stan_math/lib/tbb/version_tbb_2020.3
tbb_root="../tbb_2020.3" CXX="g++" CC="gcc" LDFLAGS='-Wl,-L,"C:/Users/Quentin.Read/Documents/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/Quentin.Read/Documents/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb" ' 'C:/rtools43/mingw64/bin/mingw32-make.exe' -C "stan/lib/stan_math/lib/tbb" -r -f "C:/Users/Quentin.Read/Documents/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbb" compiler=gcc cfg=release stdver=c++1y CXXFLAGS="-D_UCRT"
mingw32-make[1]: Entering directory 'C:/Users/Quentin.Read/Documents/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb'
process_begin: CreateProcess(C:\Windows\System32\cmd.exe, cmd /C "cscript /nologo /E:jscript ../tbb_2020.3/build/detect.js /arch gcc", ...) failed.
../tbb_2020.3/build/windows.inc:29: pipe: No error
process_begin: CreateProcess(C:\Windows\System32\cmd.exe, cmd /C "cscript /nologo /E:jscript ../tbb_2020.3/build/detect.js /runtime gcc", ...) failed.
../tbb_2020.3/build/windows.inc:33: pipe: No error
../tbb_2020.3/build/common.inc:81: *** Architecture not detected. Stop.
mingw32-make[1]: Leaving directory 'C:/Users/Quentin.Read/Documents/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb'
mingw32-make: *** [stan/lib/stan_math/make/libraries:175: stan/lib/stan_math/lib/tbb/tbb.def] Error 2
Based on the above I have tried to find information about TBB and how this error can be resolved but I have not been successful. None of the (many many many) forum posts, questions, and threads related to installing CmdStan on Windows address this exact issue, and none of the tricks suggested by users and developers on any of the threads have worked for my situation.
I am at my wits’ end and have been trying to fix this for a long time now. It is very important for me to be able to fix this because I will soon be forced to switch to the Windows 11 operating system by my employer. I was provided with a tester machine to test out installations on, before I have to give up my current machine and have it reimaged with the new OS. I would love to be able to get CmdStan running on this tester machine, so that I can be confident it will work for me moving forward. Thanks for your help!