# Trouble installing RStan

**URL:** <https://discourse.mc-stan.org/t/trouble-installing-rstan/37677>\
**Category:** RStan\
**Created:** [December 18, 2024, 3:13pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677 "2024-12-18T15:13:01Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [December 18, 2024, 3:13pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/1 "2024-12-18T15:13:01Z")

</div>

Hello everbody,  
I am new to RSTAN and I have low experience with installing interfaces.  
Since several weeks, I try to make RStan run but I do not succeed.  
I have not found a post with a similar error message, this is why I create a new one.  
After having done a lot of research, I think the problem is related to an issue with the c++ compiler.

I would be super happy to get help from you. Thank you very much and please let me know if you need more details / code outputs.

##########################  
This is the end of the error-message when I run the stan-example (example(stan\_model, package = “rstan”, run.dontrun = TRUE)

Fehler in compileCode(f, code, language = language, verbose = verbose) :  
0 [main] make 110 dofork: child -1 - forked process 29308 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
make: \*\*\* [C:/Users/wuerth/R-44~1.2/share/make/winshlib.mk:39: compilers] Error 127  
Fehler in if (nzchar(cxx)) { : Argument hat Länge 0  
Ruft auf: → .shlib\_internal  
Zusätzlich: Warnmeldung:  
In system(paste(MAKE, p1(paste(“-f”, shQuote(makefiles))), “compilers”), :  
Ausführung von Kommando ‘make -f “C:/Users/wuerth/R-44~1.2/etc/x64/Makeconf” -f “C:/Users/wuerth/R-44~1.2/share/make/winshlib.mk” compilers’ ergab Status 2  
Ausführung angehalten

##########################  
 **→ more details are found in the attachement**  
[installation issue.txt](https://discourse.mc-stan.org/uploads/short-url/hpmEh5HPauZ8JOEsROGrMqOfcNx.txt) (44.7 KB)

##########################  
Here comes more code which might can help to solve the problem:

**\> Sys.which(“make”)**  
make  
“C:\Users\wuerth\rtools44\usr\bin\make.exe”

**\> pkgbuild::check\_rtools(debug = TRUE)**  
Found in Rtools 4.4 installation folder  
[1] TRUE

**pkgbuild::check\_compiler(debug = TRUE)**  
Trying to compile a simple C file  
Running “C:/Users/wuerth/R-4.4.2/bin/x64/Rcmd.exe” SHLIB foo.c  
0 [main] make 1187 dofork: child -1 - forked process 30312 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
make: \*\*\* [C:/Users/wuerth/R-4.4.2/share/make/winshlib.mk:39: compilers] Error 127  
gcc -I"C:/Users/wuerth/R-4.4.2/include" -DNDEBUG -I"C:/Users/wuerth/R-4.4.2/library/Rcpp/include/" -I"C:/Users/wuerth/R-4.4.2/library/RcppEigen/include/" -I"C:/Users/wuerth/R-4.4.2/library/RcppEigen/include/unsupported" -I"C:/Users/wuerth/R-4.4.2/library/BH/include" -I"C:/Users/wuerth/R-4.4.2/library/StanHeaders/include/src/" -I"C:/Users/wuerth/R-4.4.2/library/StanHeaders/include/" -I"C:/Users/wuerth/R-4.4.2/library/RcppParallel/include/" -DRCPP\_PARALLEL\_USE\_TBB=1 -I"C:/Users/wuerth/R-4.4.2/library/rstan/include" -DEIGEN\_NO\_DEBUG -DBOOST\_DISABLE\_ASSERTS -DBOOST\_PENDING\_INTEGER\_LOG2\_HPP -DSTAN\_THREADS -DUSE\_STANC3 -DSTRICT\_R\_HEADERS -DBOOST\_PHOENIX\_NO\_VARIADIC\_EXPRESSION -D\_HAS\_AUTO\_PTR\_ETC=0 -include “C:/Users/wuerth/R-4.4.2/library/StanHeaders/include/stan/math/prim/fun/Eigen.hpp” -std=c++1y -I"C:/Users/wuerth/rtools44/x86\_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c foo.c -o foo.o  
0 [main] make 777 dofork: child -1 - forked process 26760 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
make: \*\*\* [C:/Users/wuerth/R-4.4.2/etc/x64/Makeconf:289: foo.o] Error 127  
Warnmeldung:  
In system(paste(MAKE, p1(paste(“-f”, shQuote(makefiles))), “compilers”), :  
Ausführung von Kommando ‘make -f “C:/Users/wuerth/R-4.4.2/etc/x64/Makeconf” -f “C:/Users/wuerth/R-4.4.2/share/make/winshlib.mk” compilers’ ergab Status 2  
Fehler: Failed to compile C code

**\> system(“touch foo.cpp”)**  
[1] 0

**\> system(“R CMD SHLIB foo.cpp”)**  
0 [main] make 1806 dofork: child -1 - forked process 7604 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
make: \*\*\* [C:/Users/wuerth/R-44~1.2/share/make/winshlib.mk:39: compilers] Error 127  
Fehler in if (nzchar(cxx)) { : Argument hat Länge 0  
Ruft auf: → .shlib\_internal  
Zusätzlich: Warnmeldung:  
In system(paste(MAKE, p1(paste(“-f”, shQuote(makefiles))), “compilers”), :  
Ausführung von Kommando ‘make -f “C:/Users/wuerth/R-44~1.2/etc/x64/Makeconf” -f “C:/Users/wuerth/R-44~1.2/share/make/winshlib.mk” compilers’ ergab Status 2  
Ausführung angehalten  
[1] 1

################################  
More general information

- Operating System = Windows 11
- R version: R-4.4.2
- R tools version: 44

---

<div class="post-metadata">

**Author:** ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Post date:** [December 19, 2024, 2:46pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/2 "2024-12-19T14:46:33Z")

</div>

if you are new to Stan, we highly recommend using [CmdStanR](https://mc-stan.org/cmdstanr), as it is much easier to install (especially on Windows).

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [December 20, 2024, 9:55am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/3 "2024-12-20T09:55:24Z")

</div>

Thank you very much for your answer.

Unfortunately, this does not work either and I think the reason is the same.  
I have installed Rtools44 (thus a suitable C++ toolchain) and it seems to be installed correctly:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/b/9/b9adade740055b39aa60ec1ea8ac0d9cf5fee6ef.png)

#######################################################  
Next, wenn I continue with the “**check\_cmdstan\_toolchain()**” , I get the following error message:

> check\_cmdstan\_toolchain()

Fehler:

**Rtools44 installation found but the toolchain was not installed.**

Run cmdstanr::check\_cmdstan\_toolchain(fix = TRUE) to fix the issue.

> cmdstanr::check\_cmdstan\_toolchain(fix = TRUE)

Installing mingw32-make and g++ with Rtools44

**Error in `processx::run("pacman", args = c("-Sy", install_pkgs, "--noconfirm"), …`:**

**! System command ‘pacman’ failed**

* * *

Exit status: 1

Stderr (last 10 lines, see `$stderr` for more):

warning: Public keyring not found; have you run ‘pacman-key --init’?

error: GPGME error: Invalid crypto engine

error: clang32: missing required signature

warning: Public keyring not found; have you run ‘pacman-key --init’?

error: GPGME error: Invalid crypto engine

error: clang64: missing required signature

warning: Public keyring not found; have you run ‘pacman-key --init’?

error: GPGME error: Invalid crypto engine

error: msys: missing required signature

error: failed to synchronize all databases (invalid or corrupted database (PGP signature))

* * *

Type .Last.error to see the more details.

#######################################################

After some research, I found out that there must be a problem with the Rtools44 bash because when I open it, it says:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/1/4/14de858aeba3d9515706363f5283d73adff9f6b3.png)

#######################################################  
I would be very happy to get help from you. I have no more ideas what I can try to do.  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [January 3, 2025, 10:43am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/4 "2025-01-03T10:43:38Z")

</div>

Apologies for the delay in responding! This was an issue seen with earlier versions of rtools44 which has since been fixed, can you try removing rtools and downloading and reinstalling?

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 7:53am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/5 "2025-01-06T07:53:48Z")

</div>

Hello, thank you very much for your answer!  
I removed rtools and reinstalled it (from this website: [Rtools44 for Windows](https://cran.r-project.org/bin/windows/Rtools/rtools44/rtools.html) ),  
but still, it does not work. I do not think that it is related to the download. As I indicated in my last post, I think it is rather related to the system.  
I really hope to find a solution. I would be very happy to be able to work with RStan to run my MCMC codes.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [January 6, 2025, 8:04am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/6 "2025-01-06T08:04:15Z")

</div>

No worries! In that case, I’ve been working on changes in how `cmdstanr` handles Windows toolchains which could help here.

Can you try restarting R and then installing this branch of `cmdstanr`:

```r
remotes::install_github("stan-dev/cmdstanr@stock-rtools-default")

```

Then try the setup and install for `cmdstan`:

```r
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan()

```

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 8:44am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/7 "2025-01-06T08:44:09Z")

</div>

Wow, this was such a quick reply. Thanks a lot.

Good news:

> cmdstanr::check\_cmdstan\_toolchain(fix = TRUE)  
> The C++ toolchain required for CmdStan is setup properly!

Bad news:

> cmdstanr::install\_cmdstan()  
> The C++ toolchain required for CmdStan is setup properly!  
> versuche URL ‘[https://api.github.com/repos/stan-dev/cmdstan/releases/latest](https://api.github.com/repos/stan-dev/cmdstan/releases/latest)’  
> Content type ‘application/json; charset=utf-8’ length 15127 bytes (14 KB)  
> downloaded 14 KB

- Latest CmdStan release is v2.36.0
- Installing CmdStan v2.36.0 in C:\Users\wuerth/.cmdstan/cmdstan-2.36.0
- Downloading cmdstan-2.36.0.tar.gz from GitHub…  
versuche URL ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’  
Content type ‘application/octet-stream’ length 43437905 bytes (41.4 MB)  
downloaded 9.1 MB

versuche URL ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’  
Content type ‘application/octet-stream’ length 43437905 bytes (41.4 MB)  
downloaded 7.6 MB

versuche URL ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’  
Content type ‘application/octet-stream’ length 43437905 bytes (41.4 MB)  
downloaded 10.1 MB

versuche URL ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’  
Content type ‘application/octet-stream’ length 43437905 bytes (41.4 MB)  
downloaded 9.8 MB

versuche URL ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’  
Content type ‘application/octet-stream’ length 43437905 bytes (41.4 MB)  
downloaded 9.6 MB

versuche URL ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’  
Content type ‘application/octet-stream’ length 43437905 bytes (41.4 MB)  
downloaded 9.9 MB

Fehler: Download of CmdStan failed with error: Herunterladen von ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’ fehlgeschlagen

**→ error in the end: download failed**

Is there another option to download the latest release (except via the command “cmdstanr::install\_cmdstan()” in Rstudio) and also get more insights why the download has failed?  
Looking forward to your answer !

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [January 6, 2025, 8:55am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/8 "2025-01-06T08:55:26Z")

</div>

I’m guessing you’re on a university or corporate network? They can have proxies which cause issues like these (and the previous).

Instead, you can manually download the CmdStan source from this link: [https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)

And then pass the file to the `release_file` argument of `install_cmdstan`:

```r
cmdstanr::install_cmdstan(release_file = "{PATH TO FILE HERE}/cmdstan-2.36.0.tar.gz")

```

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 9:12am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/9 "2025-01-06T09:12:39Z")

</div>

Yes, you are right: I am on a corporate network.

Thank you!  
I installed CmdStan manually from the link you provided (afterwards, I have not unpacked it, right?).  
The new error message is regarding the “tarball extraction”:

> cmdstanr::install\_cmdstan(release\_file = “C:/Users/wuerth/Downloads/cmdstan-2.36.0.tar.gz”, overwrite =TRUE)  
> The C++ toolchain required for CmdStan is setup properly!

- Installing CmdStan from C:/Users/wuerth/Downloads/cmdstan-2.36.0.tar.gz
- Removing the existing installation of CmdStan…
- Unpacking archive…  
cmdstan-2.36.0/bin/windows-stanc: truncated gzip input: Unknown error  
tar.exe: Error exit delayed from previous errors.  
Fehler: Problem extracting tarball. Exited with return code: 1  
Zusätzlich: Warnmeldung:  
In utils::untar(dest\_file, exdir = dir) :  
‘tar.exe -xf “C:\Users\wuerth/.cmdstan/cmdstan-2.36.0.tar.gz” -C “C:/Users/wuerth/.cmdstan”’ returned error code 1

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [January 6, 2025, 9:37am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/10 "2025-01-06T09:37:37Z")

</div>

That’s an odd error! A couple of things to check, can you check the size of the downloaded file?

This is what I get on Windows:

```r
> file.size("../Downloads/cmdstan-2.36.0.tar.gz")
[1] 43437905

```

If that doesn’t match, then the download might not have completed successfully.

If it does match, you can try changing the method that R uses for `untar` (which is what `cmdstanr` calls) by calling:

```r
Sys.setenv("TAR"="internal")

```

and then trying the install again

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 9:58am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/11 "2025-01-06T09:58:21Z")

</div>

Thanks again :).

I am sorry for bothering you with these odd errors, but I am really happy that you try to help because I do not have ideas to fix them (since I have almost 0 experience with R).

Yes, the size matches but still, I get this error:

> Sys.setenv(“TAR”=“internal”)  
> cmdstanr::install\_cmdstan(release\_file = “C:/Users/wuerth/Downloads/cmdstan-2.36.0.tar.gz”, overwrite = TRUE)  
> The C++ toolchain required for CmdStan is setup properly!

- Installing CmdStan from C:/Users/wuerth/Downloads/cmdstan-2.36.0.tar.gz
- Removing the existing installation of CmdStan…
- Unpacking archive…  
Fehler in untar2(tarfile, files, list, exdir, restore\_times) :  
unvollständiger Block in Datei  
Zusätzlich: Warnmeldung:  
In if (dothis) { :  
ungenutzte Verbindung 3 (cmdstan-2.36.0/bin/windows-stanc) geschlossen

Also, sorry for the German words  
unvollständiger Block in Datei → incomplete block on file  
Zusätzlich: Warnmeldung → additional warning  
ungenutzte Verbindung → unused connection  
geschlossen → closed

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [January 6, 2025, 11:01am UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/12 "2025-01-06T11:01:07Z")

</div>

Can you try downloading the cmdstan sources again? The only thing I can think of now is that something went wrong with the download

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 12:54pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/13 "2025-01-06T12:54:29Z")

</div>

I downloaded the sources again. Now, the new (long) error messages remind me on my first problem (error with “make”) :

> cmdstanr::install\_cmdstan(overwrite=TRUE)  
> The C++ toolchain required for CmdStan is setup properly!  
> versuche URL ‘[https://api.github.com/repos/stan-dev/cmdstan/releases/latest](https://api.github.com/repos/stan-dev/cmdstan/releases/latest)’  
> Content type ‘application/json; charset=utf-8’ length 15127 bytes (14 KB)  
> downloaded 14 KB

- Latest CmdStan release is v2.36.0

- Installing CmdStan v2.36.0 in C:\Users\wuerth/.cmdstan/cmdstan-2.36.0

- Downloading cmdstan-2.36.0.tar.gz from GitHub…

- Removing the existing installation of CmdStan…  
versuche URL ‘[https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz)’  
Content type ‘application/octet-stream’ length 43437905 bytes (41.4 MB)  
downloaded 41.4 MB

- Download complete

- Unpacking archive…

- Building CmdStan binaries…  
0 [main] make 940 dofork: child -1 - forked process 19820 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
381653 [main] make 940 dofork: child -1 - forked process 45456 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
786777 [main] make 940 dofork: child -1 - forked process 25884 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
1188792 [main] make 940 dofork: child -1 - forked process 35532 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
1585486 [main] make 940 dofork: child -1 - forked process 51052 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
2059914 [main] make 940 dofork: child -1 - forked process 28056 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
2617753 [main] make 940 dofork: child -1 - forked process 26924 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
3506352 [main] make 940 dofork: child -1 - forked process 8112 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
4128054 [main] make 940 dofork: child -1 - forked process 17144 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
g++ -Wno-nonnull -D\_UCRT -Wno-deprecated-declarations -std=c++17 -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 -Wno-class-memaccess -I stan/lib/stan\_math/lib/tbb\_2020.3/include -O3 -I src -I stan/src -I stan/lib/rapidjson\_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan\_math/ -I stan/lib/stan\_math/lib/eigen\_3.4.0 -I stan/lib/stan\_math/lib/boost\_1.84.0 -I stan/lib/stan\_math/lib/sundials\_6.1.1/include -I stan/lib/stan\_math/lib/sundials\_6.1.1/src/sundials -D\_USE\_MATH\_DEFINES -D\_GLIBCXX11\_USE\_C99\_COMPLEX -DBOOST\_DISABLE\_ASSERTS -c -MT bin/cmdstan/stansummary.o -M -E -MG -MP -MF src/cmdstan/stansummary.d src/cmdstan/stansummary.cpp  
4693721 [main] make 940 dofork: child -1 - forked process 19072 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
cp bin/windows-stanc bin/stanc.exe  
5255826 [main] make 940 dofork: child -1 - forked process 36428 died unexpectedly, retry 0, exit code 0xC0000142, errno 11  
make: \*\*\* [make/stanc:74: bin/stanc.exe] Error 127

Warnmeldung:  
There was a problem during installation. See the error message(s) above.

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [January 6, 2025, 1:34pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/14 "2025-01-06T13:34:59Z")

</div>

Looking at search results for the error code (`exit code 0xC0000142, errno 11`) apparently it can have something to do with the MSYS libs or Cygwin.

What do you get from:

```r
Sys.getenv("PATH")

```

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 1:44pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/15 "2025-01-06T13:44:01Z")

</div>

Yes indeed: in my second post, I mentioned that I have problems with opening the Rtools44 bash (MSYS). I cannot work with this shell, the following error appears:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/e/0/e06d691342e0ffd2817026289dbb0687ab8c7a04.png)

I get:

> Sys.getenv(“PATH”)  
> [1] “C:\rtools44\x86\_64-w64-mingw32.static.posix\bin;C:\rtools44\usr\bin;C:\rtools44\usr\bin;C:\rtools44\usr\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PuTTY;C:\Program Files (x86)\WinSCP;C:\Users\wuerth\AppData\Local\Programs\WingetUI\choco-cli\bin;C:\Users\wuerth\AppData\Local\Microsoft\WindowsApps;C:\Program Files\MATLAB\R2024a\bin;C:\Program Files\JAGS\JAGS-4.3.1;C:\Program Files\JAGS\JAGS-4.3.1\x64\bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64;C:\rtools44\usr\bin;C:\rtools44\x86\_64-w64-mingw32.static.posix\bin;C:\rtools44\mingw64\bin;C:\rtools44\ucrt64\bin;C:\Program Files\Git\cmd;C:\Program Files\RStudio\resources\app\bin\quarto\bin;C:\Program Files\RStudio\resources\app\bin\postback”

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 1:49pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/16 "2025-01-06T13:49:56Z")

</div>

By the way, when I open “Git Bash”, I get the same error in the shell.  
Online, I found : “it look like this is an issue with ASLR (a security feature), with which Git (perhaps all of Cygwin?) is incompatible”

→ Do you have any idea what I can do ? Thank you very much for your time and help!

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 6, 2025, 2:12pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/17 "2025-01-06T14:12:03Z")

</div>

I changed something in the security settings:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/a/9/a987cde1cdfc1043aa66da2c23fbba652b3d6b3b.png)

Now, the error message does not appear any longer (neither in GIT). But another error comes up (probably related again to “cygwin” ):  
screenshot from Rtools44 bash:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/7/f/7f30add6689dac7ad9e409db2dc07fc4078df80f.png)

code copy from Rstudio:

```no-highlight
>cmdstanr::install_cmdstan(overwrite=TRUE)
The C++ toolchain required for CmdStan is setup properly!
versuche URL 'https://api.github.com/repos/stan-dev/cmdstan/releases/latest'
downloaded 14 KB

* Latest CmdStan release is v2.36.0
* Installing CmdStan v2.36.0 in C:\Users\wuerth/.cmdstan/cmdstan-2.36.0
* Downloading cmdstan-2.36.0.tar.gz from GitHub...
* Removing the existing installation of CmdStan...
versuche URL 'https://github.com/stan-dev/cmdstan/releases/download/v2.36.0/cmdstan-2.36.0.tar.gz'
Content type 'application/octet-stream' length 43437905 bytes (41.4 MB)
downloaded 41.4 MB

* Download complete
* Unpacking archive...
* Building CmdStan binaries...
      1 [main] sh (10280) child_copy: cygheap read copy failed, 0x0..0x80000D988, done 0, windows pid 10280, Win32 error 299
      0 [main] sh 928 dofork: child -1 - forked process 10280 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
/bin/sh: fork: retry: Resource temporarily unavailable
INFO: Could not find files for the given pattern(s).
g++ -Wno-nonnull -D_UCRT -Wno-deprecated-declarations -std=c++17 -m64 -D_UCRT -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 -Wno-class-memaccess -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I stan/lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.4.0 -I stan/lib/stan_math/lib/boost_1.84.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/stansummary.o -M -E -MG -MP -MF src/cmdstan/stansummary.d src/cmdstan/stansummary.cpp
      1 [main] sh (3916) child_copy: cygheap read copy failed, 0x0..0x8000102A8, done 0, windows pid 3916, Win32 error 299
      0 [main] sh 949 dofork: child -1 - forked process 3916 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
/bin/sh: fork: retry: Resource temporarily unavailable
INFO: Could not find files for the given pattern(s).
cp bin/windows-stanc bin/stanc.exe
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/nvector/serial/nvector_serial.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/nvector/serial/nvector_serial.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_math.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_math.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea_io.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bandpre.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bandpre.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bbdpre.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bbdpre.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_diag.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_diag.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_direct.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_direct.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_io.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_ls.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_ls.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_sim.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_sim.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg1.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg1.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_spils.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_spils.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_band.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_band.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_context.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_context.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_dense.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_dense.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_direct.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_direct.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_futils.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_futils.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_iterative.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_iterative.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_linearsolver.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_linearsolver.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_matrix.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_matrix.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_memory.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_memory.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nonlinearsolver.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nonlinearsolver.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector_senswrapper.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector_senswrapper.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_version.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_version.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/band/sunmatrix_band.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/band/sunmatrix_band.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/dense/sunmatrix_dense.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/dense/sunmatrix_dense.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/band/sunlinsol_band.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/band/sunlinsol_band.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/dense/sunlinsol_dense.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/dense/sunlinsol_dense.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/newton/sunnonlinsol_newton.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/newton/sunnonlinsol_newton.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa_io.o
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas.o
      0 [main] sh (16680) child_copy: cygheap read copy failed, 0x0..0x800010420, done 0, windows pid 16680, Win32 error 299
g++ -pipe -m64 -D_UCRT -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -D_GLIBCXX11_USE_C99_COMPLEX -O3 -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_bbdpre.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_bbdpre.o
make: *** [stan/lib/stan_math/make/libraries:65: stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas.o] Error 127
make: *** Waiting for unfinished jobs....

Warnmeldung:
There was a problem during installation. See the error message(s) above.

```

---

<div class="post-metadata">

**Author:** ![AliW](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AliW](https://discourse.mc-stan.org/u/AliW)\
**Post date:** [January 7, 2025, 1:40pm UTC](https://discourse.mc-stan.org/t/trouble-installing-rstan/37677/18 "2025-01-07T13:40:34Z")

</div>

Hello again, good news : the problem is solved.  
It was related to the security settings and it was solved by running the following 3 commands in the power shell (as adminstrator):

![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/optimized/3X/b/8/b8446fa91a6d7f93e29fc0db68a70289ca6ac5d3_2_690x27.png)

Thank you very much for your help. I am so glad that it finally works now (also RSTAN not only cmdstan). Thank you also for your patience.
