CmdStanR wont sample

Mac Studio (2022)
Apple M1 Max
macOS Monterey

I’m trying sample from a model using CmdStanR and I get the following message every time:

Chain 1 dyld[3054]: Library not loaded: @rpath/libtbb.dylib
Chain 1 Referenced from: /Users/…
Chain 1 Reason: tried: ‘/Users/… .cmdstan/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb/libtbb.dylib’ (no such file), ‘/Users/…/.cmdstan/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb/libtbb.dylib’ (no such file), ‘/Users/…/.cmdstan/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb/libtbb.dylib’ (no such file), ‘/Users/…/.cmdstan/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb/libtbb.dylib’ (no such file), ‘/usr/local/lib/libtbb.dylib’ (no such file), ‘/usr/lib/libtbb.dylib’ (no such file)
Warning: Chain 1 finished unexpectedly!

What does cmdstan_version() return? My assumption is that the cmdstan you compiled the model with is no longer present. Recompiling the model should help fix the issue.

Hi Rok

[1] “2.30.1”

I’m able to compile the model and get the following message: Model executable is up to date!

That means that the model was not recompiled and that an existing executable was found. Try either touching the .stan file or set force_recompile = TRUE in cmdstan_model() temporarily. Remove it once it works so it does not keep recompiling.

It worked! Thank you very much


1 Like