# Error in executing an example in Torsten 0.91.2

**URL:** <https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195>\
**Category:** Other\
**Tags:** torsten\
**Created:** [August 18, 2025, 10:32am UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195 "2025-08-18T10:32:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnny0514](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Johnny0514](https://discourse.mc-stan.org/u/Johnny0514)\
**Post date:** [August 18, 2025, 10:32am UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/1 "2025-08-18T10:32:53Z")

</div>

Dear everyone:

I have installed cmdstanr and Torsten 0.91.2. When I tried to execute the test example, the error occurred, as shown below:

```no-highlight
C:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/include/c++/cstdlib:141:11: error: 'at_quick_exit' has not been declared in '::'
  141 | using ::at_quick_exit;
      | ^ ~~~~~~~~~~~~ C:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/include/c++/cstdlib:164:11: error: 'quick_exit' has not been declared in '::'
  164 | using ::quick_exit;
      | ^ ~~~~~~~~~
C:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/include/c++/stdlib.h:43:14: error: 'at_quick_exit' has not been declared in 'std'
   43 | using std::at_quick_exit;
      | ^ ~~~~~~~~~~~~
C:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/include/c++/stdlib.h:46:14: error: 'quick_exit' has not been declared in 'std'
   46 | using std::quick_exit;
      | ^ ~~~~~~~~~

cc1plus.exe: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnosticsmingw32-make[1]: *** [C:/Users/LENOVO/.cmdstan/Torsten/cmdstan/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbbmalloc:65: backend.o] Error 1

mingw32-make: *** [stan/lib/stan_math/make/libraries:187: stan/lib/stan_math/lib/tbb/tbbmalloc.def] Error 2

```

The R scriptes were as follows:

```r
library("cmdstanr")
set_cmdstan_path("C:/Users/LENOVO/.cmdstan/Torsten/cmdstan") 
file.dir <- file.path("C:/Users/LENOVO/.cmdstan/Torsten", "example-models", "pk2cpt")
file <- file.path(file.dir, "pk2cpt.stan")
model <- cmdstan_model(file)

```

How can I solve this problem?

Operating System: windows 11  
Interface Version: R studio 5 R 4.5.1  
Compiler/Toolkit: cmdstanr Torsten

Looking forward to your replies!

---

<div class="post-metadata">

**Author:** ![cbdavis33](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/cbdavis33/32/15374_2.png) [@cbdavis33](https://discourse.mc-stan.org/u/cbdavis33)\
**Post date:** [August 18, 2025, 10:21pm UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/2 "2025-08-18T22:21:47Z")

</div>

Hi, are you able to use regular CmdStan using the directions [here](https://mc-stan.org/cmdstanr/articles/cmdstanr.html) to run the bernoulli model? If so, then try that model with the Stan+Torsten installation. If not, then there’s likely an issue running on Windows. Unfortunately, I don’t have access to a Windows machine to try to debug, but I’ll bring the issue up in the next meeting of the Torsten Steering Committee.

Casey

---

<div class="post-metadata">

**Author:** ![Johnny0514](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Johnny0514](https://discourse.mc-stan.org/u/Johnny0514)\
**Post date:** [August 19, 2025, 4:15am UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/3 "2025-08-19T04:15:22Z")

</div>

Hi! Thank you for your comment!

The version of regular cmdstanr is 2.36.1, and the Bernoulli model was successfully executed. I tried to use the cmdstan of Torsten’s installation package to implement the Bernoulli model, but it failed. The regular cmdstan(2.36.1) can not execute the “pk2cpt.stan“ of Torsten. What should I do next?

---

<div class="post-metadata">

**Author:** ![cbdavis33](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/cbdavis33/32/15374_2.png) [@cbdavis33](https://discourse.mc-stan.org/u/cbdavis33)\
**Post date:** [August 19, 2025, 5:59am UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/4 "2025-08-19T05:59:50Z")

</div>

Ok, the only other thing I can think of is after you `git clone`Torsten, you need to do something like (in the terminal) `cd C:/your/path/to/Torsten/cmdstan`and then `mingw32-make build`(I think that’s correct. It’s been a long time since I’ve worked on Windows, but it’s something like that). But to be honest, your error might be unrelated to that. If you have already or can get that make build command to work and still get errors running either the bernoulli model or `pk2cpt.stan`, then it’s likely an issue with the Torsten installation, and I’ll see if we can get it sorted out.

---

<div class="post-metadata">

**Author:** ![Johnny0514](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Johnny0514](https://discourse.mc-stan.org/u/Johnny0514)\
**Post date:** [August 20, 2025, 5:51am UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/5 "2025-08-20T05:51:06Z")

</div>

```no-highlight

mod <- cmdstan_model(file)
Compiling Stan program...Ϣ: ṩģʽ޷ҵļ

'\"cscript /nologo /E:jscript ../tbb_2020.3/build/detect.js /arch gcc\""' ڲⲿҲǿеĳ
ļ'\"cscript /nologo /E:jscript ../tbb_2020.3/build/detect.js /runtime gcc\""' ڲⲿҲǿеĳ
ļ

../tbb_2020.3/build/common.inc:81: ***Architecture not detected. Stop.mingw32-make:*** [stan/lib/stan_math/make/libraries:187: stan/lib/stan_math/lib/tbb/tbbmalloc.def] Error 2

错误: An error occured during compilation! See the message above for more information.

```

The error now was shown above. How can I solve it?

---

<div class="post-metadata">

**Author:** ![Johnny0514](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Johnny0514](https://discourse.mc-stan.org/u/Johnny0514)\
**Post date:** [August 20, 2025, 10:59am UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/6 "2025-08-20T10:59:46Z")

</div>

if ! [[mingw32-make =~ mingw32]]; then  
echo “ERROR: Please use mingw32-make on Windows to build the Intel TBB library.”;  
echo “This is packaged with RTools, for example.”;  
exit 1;  
fi  
touch stan/lib/stan\_math/lib/tbb/tbb-make-check  
tbb\_root=“../tbb\_2020.3” CXX=“g++” CC=“gcc” LDFLAGS=‘-Wl,-L,“/c/Users/LENOVO/.cmdstan/Torsten/cmdstan/stan/lib/stan\_math/lib/tbb” -Wl,-rpath,“/c/Users/LENOVO/.cmdstan/Torsten/cmdstan/stan/lib/stan\_math/lib/tbb” ’ ‘mingw32-make’ -C “stan/lib/stan\_math/lib/tbb” -r -f “/c/Users/LENOVO/.cmdstan/Torsten/cmdstan/stan/lib/stan\_math/lib/tbb\_2020.3/build/Makefile.tbbmalloc” compiler=none cfg=release stdver=c++1y malloc CXXFLAGS=“-Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation "  
mingw32-make[1]: Entering directory ‘/c/Users/LENOVO/.cmdstan/Torsten/cmdstan/stan/lib/stan\_math/lib/tbb’  
'“cscript /nologo /E:jscript ../tbb\_2020.3/build/detect.js /arch none””’ 不是内部或外部命令，也不是可运行的程序  
或批处理文件。  
‘“cscript /nologo /E:jscript ../tbb\_2020.3/build/detect.js /runtime none”"’ 不是内部或外部命令，也不是可运行的程序  
或批处理文件。  
../tbb\_2020.3/build/common.inc:81: \*\*\* Architecture not detected. Stop.  
mingw32-make[1]: Leaving directory ‘/c/Users/LENOVO/.cmdstan/Torsten/cmdstan/stan/lib/stan\_math/lib/tbb’  
mingw32-make: \*\*\* [stan/lib/stan\_math/make/libraries:187: stan/lib/stan\_math/lib/tbb/tbbmalloc.def] Error 2

---

<div class="post-metadata">

**Author:** ![Johnny0514](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Johnny0514](https://discourse.mc-stan.org/u/Johnny0514)\
**Post date:** [August 20, 2025, 11:04am UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/7 "2025-08-20T11:04:33Z")

</div>

```no-highlight
 model <- cmdstan_model(file)
Compiling Stan program...Ϣ: ṩģʽ޷ҵļ

mingw32-make: *** [make/program:14: src/cmdstan/main.o] Error 1错误: An error occured during compilation! See the message above for more information.

```

I do not know how to solve this prolem! I really want to study and use Torsten.

---

<div class="post-metadata">

**Author:** ![cbdavis33](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/cbdavis33/32/15374_2.png) [@cbdavis33](https://discourse.mc-stan.org/u/cbdavis33)\
**Post date:** [August 20, 2025, 4:57pm UTC](https://discourse.mc-stan.org/t/error-in-executing-an-example-in-torsten-0-91-2/40195/8 "2025-08-20T16:57:22Z")

</div>

It’s a Windows issue. I’ll see if I can find someone who can help
