Skip to content

Commit

Permalink
Rel 7.0.2 - Prevent installing BridgeStan if Juile < v1.8, use make a…
Browse files Browse the repository at this point in the history
…nd stanc flags
  • Loading branch information
goedman committed Jan 19, 2023
1 parent 0c06387 commit fb5f1b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StanSample"
uuid = "c1514b29-d3a0-5178-b312-660c88baa699"
authors = ["Rob J Goedman <goedman@icloud.com>"]
version = "7.0.1"
version = "7.0.2"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
15 changes: 10 additions & 5 deletions src/StanSample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,16 @@ export
set_make_string

if isdir(joinpath(CMDSTAN_HOME, "..", "bridgestan"))
const BRIDGESTAN_PATH = get!(ENV, "BRIDGESTAN", abspath(joinpath(CMDSTAN_HOME, "..", "bridgestan")))
include(joinpath(BRIDGESTAN_PATH, "julia", "src", "BridgeStan.jl"))
const BS = BridgeStan
BS.set_bridgestan_path!(BRIDGESTAN_PATH)
export BS, BRIDGESTAN_HOME, StanModel
if Int(VERSION.minor) < 8
@warn "Julia-$VERSION < Julia-1.8 too old for BridgeStan, skipping inclusing support for BridgeStan."
else
@info "BridgeStan support available."
const BRIDGESTAN_PATH = get!(ENV, "BRIDGESTAN", abspath(joinpath(CMDSTAN_HOME, "..", "bridgestan")))
include(joinpath(BRIDGESTAN_PATH, "julia", "src", "BridgeStan.jl"))
const BS = BridgeStan
BS.set_bridgestan_path!(BRIDGESTAN_PATH)
export BS, BRIDGESTAN_HOME, StanModel
end
else
BRIDGESTAN_PATH = ""
end
Expand Down
4 changes: 3 additions & 1 deletion test/test_bridgestan/test_bridgestan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ if success(rc)
post = read_samples(sm, :dataframe)
end

smb = BS.StanModel(
smb = BS.StanModel(;
stan_file = joinpath(sm.tmpdir, sm.name*".stan"),
stanc_args=["--warn-pedantic --O1"],
make_args=["CXX=clang++", "STAN_THREADS=true"],
data = joinpath(sm.tmpdir, "$(sm.name)_data_1.json")
)

Expand Down

0 comments on commit fb5f1b8

Please sign in to comment.