Skip to content

Update Cmdstan doc to remove stanc2 references #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/cmdstan-guide/installation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ CmdStan v2.23.0 help
> make foo/bar

This target will:
1. Install the Stan compiler (bin/stanc or bin/stanc2), as needed.
1. Install the Stan compiler (bin/stanc), as needed.
2. Use the Stan compiler to generate C++ code, foo/bar.hpp.
3. Compile the C++ code using cc . to generate foo/bar

Expand All @@ -252,7 +252,6 @@ CmdStan v2.23.0 help
USER_HEADER: when STANCFLAGS has --allow_undefined, this is the name of the
header file that is included. This defaults to "user_header.hpp" in the
directory of the Stan program.
STANC2: When set, use bin/stanc2 to generate C++ code.


Example - bernoulli model: examples/bernoulli/bernoulli.stan
Expand Down
44 changes: 6 additions & 38 deletions src/cmdstan-guide/stanc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ OCaml. This compiler is called "stanc3" and has has its own
repository https://github.com/stan-dev/stanc3, from which pre-built
binaries for Linux, Mac, and Windows can be downloaded.

Prior to release 2.22, the Stan compiler program was compiled from C++
source code that was part of the core Stan library. This C++ compiler
is still available as program `bin/stanc2`. This compiler is no
longer being maintained, i.e., existing bugs will not be fixed and new
functions and features are only available in the stanc3 compiler. Its
intended use is as a diagnostic tool and backup for the new stanc3 compiler.
For some future version, it will be dropped from the release altogether.

## Instantiating the `stanc` binary

Expand All @@ -29,10 +22,7 @@ For Windows:
```
make bin/stanc.exe
```
To build the `bin/stanc2` program, specify:
```
make bin/stanc2
```


## The Stan compiler program

Expand Down Expand Up @@ -88,11 +78,6 @@ override the default arguments to stanc, e.g.,
```
> make STANCFLAGS="--include-paths=~/foo" examples/bernoulli/bernoulli
```
To use the stanc2 compiler instead of the stanc3 compiler, set the
make option `STANC2`:
```
> make STANC2=TRUE examples/bernoulli/bernoulli
```

## Command-line options for stanc3

Expand All @@ -110,6 +95,9 @@ The stanc3 options are:

- `--version` - Display stanc version number

- `--info` - Print information about the model, such
as the type information for variables and the list of used distributions.

- `--name=<model_name>` - Specify the name of the class
used for the implementation of the Stan model in the generated C++ code.

Expand Down Expand Up @@ -138,33 +126,13 @@ code. **WARNING:** _This is currently an experimental feature!_
- `--warn-uninitialized` - Emit warnings about uninitialized variables
to stderr. Currently an experimental feature.

- `--warn-pedantic` - Emit warnings in [Pedantic mode](https://mc-stan.org/docs/reference-manual/pedantic-mode.html)
which warns of potential issues in the meaning of your program.

The compiler also provides a number of debug options which are
primarily of interest to stanc3 developers; use the `--help`
option to see the full set.

## Command-line options for stanc2

The stanc2 compiler has the same command-line syntax as the
stanc3 compiler, but has fewer options:

- `--help` - Displays the complete list of stanc3 options, then exits.

- `--version` - Display stanc version number

- `--name=<model_name>` - Specify the name of the class
used for the implementation of the Stan model in the generated C++ code.

- `--o=<file_name>` - Specify the name of the file into
which the generated C++ is written.

- `--allow_undefined` - Do not throw a parser error
if there is a function in the Stan program
that is declared but not defined in the functions block.

- `--include_paths=<dir1,...dirN>` - Takes a comma-separated list
of directories that may contain a file in an `#include` directive.

## Using external C++ code

The `--allow_undefined` flag can be passed to the call to stanc,
Expand Down