@@ -18,51 +18,52 @@ The stanc3 compiler has the following command-line syntax:
18
18
```
19
19
> stanc (options) <model_file>
20
20
```
21
- where ` <model_file> ` is a path to either a Stan model
22
- file ending in suffix ` .stan ` _ or_ a Stan functions
23
- file which ends in ` .stanfunctions ` .
21
+
22
+ where ` <model_file> ` is either a path to a file ending in
23
+ ` .stan ` or ` .stanfunctions ` (which automatically sets
24
+ ` --standalone-functions ` ), or ` '-' ` to read from standard input.
24
25
25
26
The stanc3 options are:
26
27
27
- - ` --help ` - Displays the complete list of stanc3 options, then exits.
28
+ - ` --help ` / ` -? ` - Displays the complete list of stanc3 options, then exits.
28
29
29
30
- ` --version ` - Display stanc version number
30
31
31
32
- ` --info ` - Print information about the model, such
32
- as the type information for variables and the list of used distributions.
33
+ as the type information for variables and the list of used distributions.
33
34
34
35
- ` --name=<model_name> ` - Specify the name of the class
35
- used for the implementation of the Stan model in the generated C++ code.
36
-
37
- - ` --o=<file_name> ` - Specify a path to an output file for generated C++ code
38
- (default = <model_name>.hpp) or auto-formatting output (default: no file/print
39
- to stdout)
36
+ used for the implementation of the Stan model in the generated C++ code.
40
37
41
- - ` --allow-undefined ` - Do not throw a parser error if there is a function in
42
- the Stan program that is declared but not defined in the functions block.
43
-
44
- - ` --include_paths=<dir1,...dirN> ` - Takes a comma-separated list
45
- of directories that may contain a file in an ` #include ` directive.
46
-
47
- - ` --use-opencl ` - If set, will use additional Stan OpenCL
48
- features enabled in the Stan-to-C++ compiler.
38
+ - ` --o=<file_name> ` / ` -o=<filename> ` / ` --output=<filename> ` - Specify a
39
+ path to an output file for generated C++ code (default = <model_name>.hpp)
40
+ or auto-formatting output (default: no file/print to stdout)
49
41
50
42
- ` --auto-format ` - Pretty prints the program to the console. See [ more on auto
51
43
formatting] ( #stanc-pretty-printing ) .
52
44
45
+ - ` --allow-undefined ` - Do not throw a parser error if there is a function in
46
+ the Stan program that is declared but not defined in the functions block.
47
+
53
48
- ` --canonicalize ` - Make changes to the program before pretty-printing by
54
49
specifying options in a comma separated list. Options are 'deprecations',
55
- 'parentheses', 'braces', 'includes'.
50
+ 'parentheses', 'braces', 'includes', and 'strip-comments'.
51
+
52
+ - ` --include_paths=<dir1,...dirN> ` - Takes a comma-separated list
53
+ of directories that may contain a file in an ` #include ` directive.
56
54
57
55
- ` --max-line-length=<number> ` - Set the column number at which formatting with
58
56
` --auto-format ` attempts to split lines. The default value is 78, which
59
57
results in most lines being shorter than 80 characters.
60
58
61
- - ` --print-canonical ` - Synonymous with `--auto-format --canonicalize= [ all
62
- options ] `.
59
+ - ` --print-canonical ` - Synonymous with
60
+ ` --auto-format --canonicalize=deprecations,includes,parentheses,braces ` .
63
61
64
62
- ` --print-cpp ` - If set, output the generated C++ Stan model class to stdout.
65
63
64
+ - ` --filename-in-msg=<name> ` - Sets the filename used in compiler and runtime errors.
65
+ If absent, the ` <model_file> ` argument is used.
66
+
66
67
- ` --standalone-functions ` - If set, only generate the code for the functions
67
68
defined in the file. This is the default behavior for ` .stanfunctions ` files.
68
69
@@ -74,16 +75,19 @@ used for the implementation of the Stan model in the generated C++ code.
74
75
components are not thoroughly tested and may not improve a programs
75
76
performance!_ Allow the compiler to apply all [ optimizations] ( #optimization ) to the Stan code.
76
77
77
- - ` --O ` ** WARNING:** _ This is currently an experimental feature whose components
78
- are not thoroughly tested and may not improve a programs performance!_ Same as
79
- ` --Oexperimental ` . Allow the compiler to apply all [ optimizations] ( #optimization ) to the Stan
80
- code.
78
+ - ` --O ` Synonym for ` --O1 ` as of Stan 2.37. In earlier versions this was a synonym for
79
+ ` --Oexperimental ` .
81
80
82
- - ` --warn-uninitialized ` - Emit warnings about uninitialized variables
83
- to stderr. Currently an experimental feature .
81
+ - ` --use-opencl ` - If set, will use additional Stan OpenCL
82
+ features enabled in the Stan-to-C++ compiler .
84
83
85
84
- ` --warn-pedantic ` - Emit warnings in [ Pedantic mode] ( #pedantic-mode )
86
85
which warns of potential issues in the meaning of your program.
86
+ Note: This may produce false positive warnings.
87
+
88
+ - ` --warn-uninitialized ` - Emit warnings about uninitialized variables
89
+ to stderr. Currently an experimental feature.
90
+
87
91
88
92
The compiler also provides a number of debug options which are
89
93
primarily of interest to stanc3 developers; use the ` --help `
0 commit comments