Hi!
The example Stan model with CmdStan located in the examples/bernoulli directory is compiling but not running . The system used is running Windows 10 and CmdStan 2.26.1.
There are no errors when building the Stan model into an executable using mingw32-make:
--- Translating Stan model to C++ code ---
bin/stanc.exe --o=examples/bernoulli/bernoulli.hpp examples/bernoulli/bernoulli.stan
--- Compiling, linking C++ code ---
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.6.1/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -x c++ -o examples/bernoulli/bernoulli.o examples/bernoulli/bernoulli.hpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.6.1/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -Wl,-L,"C:/Users/xxx/.cmdstan/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/xxx/.cmdstan/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb" examples/bernoulli/bernoulli.o src/cmdstan/main.o -static-libgcc -static-libstdc++ stan/lib/stan_math/lib/sundials_5.6.1/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_5.6.1/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_5.6.1/lib/libsundials_idas.a stan/lib/stan_math/lib/sundials_5.6.1/lib/libsundials_kinsol.a stan/lib/stan_math/lib/tbb/tbb.dll -o examples/bernoulli/bernoulli.exe
rm -f examples/bernoulli/bernoulli.o
Intel TBB is not in PATH.
Consider calling
mingw32-make install-tbb
to avoid copying Intel TBB library files.
'stan/lib/stan_math/lib/tbb/tbb.dll' -> 'examples/bernoulli/tbb.dll'
However, the following error appears when trying to run basic MCMC sampling on the executable:
bernoulli.exe sample data bernoulli.data.json
The procedure entry point _ZNSt11range_errorC1EPKc could not be located in the dynamic link library C:\Users\xxx.cmdstan\cmdstan-2.26.1\examples\bernoulli\tbb.dll
When building the executable, Stan gave a warning about the Intel TBB not being in the PATH, so I tried setting the PATH variable both manually and using the install-tbb
batch script provided, but it still does not work. I also tried re-installing CmdStan twice: once by installing it from the latest binaries on GitHub and another time by installing it through CmdStanPy (which is how I plan on using CmdStan). I also tried updating the Visual C++ Redistributable for Windows which was shown online to solve the entry point issue for DLLs.
I tried searching through the forums, but I am unable to find anything comparable to the issue I’m facing. Can someone please help me resolve this.