Reduce_sum running time error

Hello, I am trying to run the example shown here https://mc-stan.org/users/documentation/case-studies/reduce_sum_tutorial.html, however, I get a strange error during execution:

# prepare the data as described in the article...
# compile
logistic1 <- cmdstan_model("logistic1.stan", cpp_options = list(stan_threads = TRUE))
redcard_data$grainsize <- 1
# run the sampler
logistic1$sample(redcard_data,
                                             chains = 1,
                                             parallel_chains = 1,
                                             threads_per_chain = 2,
                                             refresh = 1000))
Running MCMC with 1 chain, with 2 thread(s) per chain...

Chain 1 ./logistic1_threads: symbol lookup error: ./logistic1_threads: undefined symbol: _ZN3tbb10interface78internal20isolate_within_arenaERNS1_13delegate_baseEl
Warning: Chain 1 finished unexpectedly!

Warning message:
No chains finished successfully. Unable to retrieve the fit.

seems some error due to compilation time, some missing library maybe?
I am using cmdstanr 2.28.1

thank you

Ok, I found the problem, cmdstanr would not work if another libtbb is installed on the system (maybe because it is an old one?), you have either to remove the other library or be sure it is the same version or find a way that cmdstanr actually uses its own version

Hi @blackrabite, I’m also seeing this problem on an Ubuntu machine. Did you remove libtbb-dev?

What version do you use? The new cmdstan 2.29 should avoid getting thrown over from other system tbb installs by now.

I’m using 2.29. FYI I already have another thread going about this Runtime error: symbol lookup error with multithreaded compile - #6 by karimn