Skip to content

Commit 94b12e2

Browse files
Update to Stan 2.37 (#287)
* Bump stan from `ef8374d` to `1357c13` Bumps [stan](https://github.com/stan-dev/stan) from `ef8374d` to `1357c13`. - [Release notes](https://github.com/stan-dev/stan/releases) - [Commits](stan-dev/stan@ef8374d...1357c13) --- updated-dependencies: - dependency-name: stan dependency-version: 1357c136bf22e3f0d25ed3529fea55fe76842eac dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Version bumps * Add new make flag to catch eigen runtime errors * resolve Rust lints * Doc tweaks --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brian Ward <brianmward99@gmail.com>
1 parent 972beec commit 94b12e2

File tree

10 files changed

+27
-21
lines changed

10 files changed

+27
-21
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ include $(MATH)make/libraries
2020
# Set -fPIC globally since we're always building a shared library
2121
override CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
2222
override CXXFLAGS_SUNDIALS += -fPIC
23-
override CPPFLAGS += -DBRIDGESTAN_EXPORT
23+
override CPPFLAGS += -DBRIDGESTAN_EXPORT -DSTAN_OVERRIDE_EIGEN_ASSERT
2424

25-
# set flags for stanc compiler (math calls MIGHT? set STAN_OPENCL)
2625
ifdef STAN_OPENCL
2726
override STANCFLAGS += --use-opencl
2827
STAN_FLAG_OPENCL=_opencl
@@ -136,7 +135,7 @@ print-% : ; @echo $* = $($*) ;
136135
STANC_DL_RETRY = 5
137136
STANC_DL_DELAY = 10
138137
STANC3_TEST_BIN_URL ?=
139-
STANC3_VERSION ?= v2.36.0
138+
STANC3_VERSION ?= v2.37.0
140139

141140
ifeq ($(OS),Windows_NT)
142141
OS_TAG := windows

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Stan is a probabilistic programming language for coding statistical
1717
models. For an introduction to what can be coded in Stan, see the
1818
[*Stan User's Guide*](https://mc-stan.org/docs/stan-users-guide/index.html).
1919

20-
BridgeStan is currently shipping with Stan version 2.36.0
20+
BridgeStan is currently shipping with Stan version 2.37.0
2121

2222
Documentation is available at https://roualdes.github.io/bridgestan/
2323

docs/getting-started.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ If you wish to use BridgeStan for an older released version, all you need to do
185185
3. Also in the ``stan`` submodule, run ``make math-update``
186186
4. In the top level BridgeStan directory, run ``make clean``
187187

188-
To return to the version of Stan currently used by BridgeStan, you can run ``make stan-update`` from the top level directory
189-
and remove :makevar:`STANC3_VERSION` from your ``make/local`` file, before running ``make clean`` again.
188+
To return to the version of Stan currently used by BridgeStan, you can run
189+
``make stan-update`` from the top level directory and remove :makevar:`STANC3_VERSION` from
190+
your ``make/local`` file, before running ``make clean`` again.
190191

191192
Using Pre-Existing Stan Installations
192193
_____________________________________

docs/internals/development.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@ they have the minimal C++ build tools required for working with BridgeStan.
1515
C++
1616
---
1717

18-
* We use the C++1y standard for compilation (``-std=c++1y`` in both clang and gcc). This is partway between C++11 and C++14, and is what Stan requires.
18+
* We use the C++17 standard for compilation (``-std=c++17`` in both clang and gcc).
19+
This is what Stan requires since version 2.36.
20+
21+
* We try to write standards-compliant code that does not depend on features of specific platforms
22+
(except where needed for compatibility).
1923

20-
* We try to write standards-compliant code that does not depend on features of specific platforms (except where needed for compatibility).
2124
Specifically, we do not use OS-dependent or compiler-dependent C++.
2225
Our C++ code does not depend on the ``R.h`` or ``Python.h`` headers, for example.
23-
On the other hand, adding new signatures to work with a specific language's style of foreign function interface is permitted
24-
(an example can be found in the :ref:`R compatibility functions <R-compat>`, which requires a particular pointer-based style).
26+
On the other hand, adding new signatures to work with a specific language's style of foreign
27+
function interface is permitted (an example can be found in the :ref:`R compatibility functions <R-compat>`,
28+
which requires a particular pointer-based style).
2529

26-
* We try to follow the `Google C++ Style Guide <https://google.github.io/styleguide/cppguide.html>`_, but (a) we allow C++ exceptions, and (b) we allow reference arguments.
30+
* We try to follow the `Google C++ Style Guide <https://google.github.io/styleguide/cppguide.html>`_, but
31+
(a) we allow C++ exceptions, and (b) we allow reference arguments.
2732

28-
* We recommend using `Clang format <https://clang.llvm.org/docs/ClangFormat.html>`_ with our config file `.clang-format <https://github.com/roualdes/bridgestan/blob/main/.clang-format>`_.
33+
* We recommend using `Clang format <https://clang.llvm.org/docs/ClangFormat.html>`_ with our config file
34+
`.clang-format <https://github.com/roualdes/bridgestan/blob/main/.clang-format>`_.
2935

3036
Python
3137
------

docs/languages/c-api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
C API
22
=====
33

4-
----
4+
---
55

66
Installation
77
------------

docs/languages/python.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The first time you compile a model, the BridgeStan source code for your current
2222
will be downloaded and placed in :file:`~/.bridgestan/`.
2323
If you prefer to use a source distribution of BridgeStan, consult the following section.
2424

25-
Note that the system pre-requisites from the :doc:`Getting Started guide <../getting-started>`
25+
Note that the system pre-requisites from the :doc:`Getting Started guide <../getting-started>`
2626
are still required and will not be automatically installed by this method.
2727

2828
From Source

rust/examples/example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn main() {
2525

2626
// The path to the compiled model
2727
let path = compile_model(&bs_path, &path, &[], &[]).expect("Could not compile Stan model.");
28-
println!("Compiled model: {:?}", path);
28+
println!("Compiled model: {path:?}");
2929

3030
let lib = open_library(path).expect("Could not load compiled Stan model.");
3131

@@ -54,5 +54,5 @@ fn main() {
5454
let logp = model
5555
.log_density_gradient(&point[..], true, true, &mut gradient_out[..])
5656
.expect("Stan failed to evaluate the logp function.");
57-
println!("logp: {}\ngrad: {:?}", logp, gradient_out);
57+
println!("logp: {logp}\ngrad: {gradient_out:?}");
5858
}

rust/tests/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ pub fn get_model<S: AsRef<str>>(name: S) -> (StanLibrary, Option<CString>) {
1717
let name = name.as_ref();
1818
let mut base = model_dir();
1919
base.push(name);
20-
let lib = base.join(format!("{}_model.so", name));
20+
let lib = base.join(format!("{name}_model.so"));
2121
if !lib.exists() {
22-
panic!("Could not find compiled model {}", name);
22+
panic!("Could not find compiled model {name}");
2323
}
2424
let lib = open_library(lib).unwrap();
2525

rust/tests/model.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ fn model_compiling() {
196196
let name = "stdnormal";
197197
let mut base = model_dir();
198198
base.push(name);
199-
let lib_path = base.join(format!("{}_model.so", name));
200-
let stan_path = base.join(format!("{}.stan", name));
199+
let lib_path = base.join(format!("{name}_model.so"));
200+
let stan_path = base.join(format!("{name}.stan"));
201201
remove_file(lib_path).unwrap_or_default();
202202

203203
let bs_path: PathBuf = std::env::var("BRIDGESTAN")

stan

Submodule stan updated 56 files

0 commit comments

Comments
 (0)