You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Windows toolchain consists of programs `g++`, the C++ compiler, and `mingw32-make`, the GNU Make utility.
390
+
The Windows toolchain consists of programs `g++`, the C++ compiler, and `make`, the GNU Make utility.
403
391
To check if these are present,
404
392
open a command shell [^1]
405
393
and type:
406
394
```
407
395
g++ --version
408
-
mingw32-make --version
396
+
make --version
409
397
```
410
398
411
-
CmdStan is known compatible with the RTools40, RTools42, and RTools43 toolchains. These require slightly
412
-
different steps to configure, so please follow the appropriate steps below. All toolchains will require
399
+
CmdStan is known compatible with the RTools43 toolchain. The toolchain will require
413
400
updating your `PATH` variable, See [these instructions](https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/)
414
401
for details on changing the `PATH` if you are unfamiliar. The following instructions will assume that the default installation
415
402
directory was used, so be sure to update the paths accordingly if you have chosen a different
416
403
directory.
417
404
418
-
##### RTools40
419
-
420
-
RTools40 provides both a standard `g++-8` toolchain and a `g++-10` Universal C Runtime (UCRT) toolchain.
421
-
Note the that newer `g++-10` UCRT toolchain is only available for 64-bit systems, whereas the `g++-8`
422
-
toolchain is available for both. Additionally the UCRT is only natively supported on Windows 10 and newer,
423
-
older systems will require a [Microsoft update](https://support.microsoft.com/en-us/topic/update-for-universal-c-runtime-in-windows-c0514201-7fe6-95a3-b0a5-287930f3560c)
424
-
425
-
###### Installation
426
-
427
-
Download the [installer](https://github.com/r-windows/rtools-installer/releases/download/2022-02-06/rtools40-x86_64.exe)
428
-
and complete the prompts to install.
429
-
430
-
Next, you need to add the location of the toolchain to your `PATH` environment variable so that it
431
-
can be called from the command line. Add the following lines to your `PATH`:
432
-
```
433
-
C:\rtools40\usr\bin
434
405
435
-
# Add only one of the below
436
-
C:\rtools40\mingw32\bin # 32-bit g++-8
437
-
C:\rtools40\mingw64\bin # 64-bit g++-8
438
-
C:\rtools40\ucrt64\bin # 64-bit g++-10 (UCRT)
439
-
```
440
-
441
-
CmdStan additionally needs the `mingw32-make` utility, which you can install using RTools.
442
-
Navigate to the installation directory (e.g., `C:\rtools40`) and launch the `msys2.exe` file.
443
-
Execute the appropriate command below to install `mingw32-make` for your selected toolchain:
All required utilities (e.g., `make`, `g++`) for compiling and running CmdStan models on Windows are
409
+
provided by the RTools43 toolchain from the R Project. Installation steps are provided below,
410
+
and for more technical details on the toolchain refer to the [R Project documentation](https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html).
451
411
452
-
Both RTools42 & RTools43 provide 64-bit UCRT toolchains, where RTools42 provides g++-10 and
453
-
RTools43 provides g++-12. The installation/configuration is identical for both toolchains.
412
+
Note that the toolchain is only available for 64-bit systems, and uses the new Universal C Runtime (UCRT).
413
+
UCRT is only natively supported on Windows 10 and newer, older systems will require a
To open a Windows command shell, first open the __Start Menu__,
483
-
(usually in the lower left of the screen), select option __All Programs__,
484
-
then option __Accessories__, then program __Command Prompt__.
485
-
Alternatively, enter `[Windows+r]` (both keys together on the
486
-
keyboard), and enter `cmd` into the text field that pops up in the Run window,
487
-
then press `[Return]` on the keyboard to run.
488
-
489
428
490
429
## Using GNU Make {#gnu-make}
491
430
@@ -533,7 +472,7 @@ into a binary executable.
533
472
For example, to compile the Stan program `my_program.stan` in directory `../my_dir/`,
534
473
the make target is `../my_dir/my_program` or ` ../my_dir/my_program.exe` (on Windows).
535
474
536
-
To call Make, you invoke the utility name, either `make` or `mingw32-make`, followed by, in order:
475
+
To call Make, you invoke the utility name, `make`, followed by, in order:
537
476
538
477
- zero or more [Make program options](https://www.gnu.org/software/make/manual/html_node/Options-Summary.html), then specify any Make variables as a series of
539
478
@@ -552,7 +491,7 @@ Make targets can be preceded by any number of Makefile variable name=value pairs
552
491
For example, to compile `../my_dir/my_program.stan` for an OpenCL (GPU) machine,
553
492
set the makefile variable `STAN_OPENCL` to `TRUE`:
554
493
```
555
-
> make STAN_OPENCL=TRUE ../my_dir/my_program # on Windows use mingw32-make
494
+
> make STAN_OPENCL=TRUE ../my_dir/my_program
556
495
```
557
496
Makefile variables can also be set by creating a file named `local` in the
558
497
CmdStan `make` subdirectory which contains a list of `<VARIABLE>=<VALUE>` pairs,
@@ -567,7 +506,7 @@ __Make Targets__
567
506
568
507
When invoked without any arguments at all, Make prints a help message:
0 commit comments