I wish my first post would not be about an installation issue… but here I am! Yesterday, I upgraded my linux system from Fedora 37 to Fedora 38 and noticed I could not compile Stan models with cmdstanr anymore. I have tried to reinstall cmdstan multiple ways (through cmdstanr in R, or using make on github downloads of v2.31.0 and v2.32.0-rc1) but it keeps failing. According to cmdstanr::check_cmdstan_toolchain(), my C++ toolchain is setup properly. The problem seems to be related with “tbb”.
example of error message with cmdstanr::install_cmdstan():
../tbb_2020.3/include/tbb/task.h:300:20: error: declaration of ‘tbb::task& tbb::internal::task_prefix::task()’ changes meaning of ‘task’ [-Wchanges-meaning]
example of error message using make on v2.32.0-rc1:
stan/lib/stan_math/lib/tbb_2020.3/include/tbb/task.h:300:20: error: declaration of ‘tbb::task& tbb::internal::task_prefix::task()’ changes meaning of ‘task’ [-Wchanges-meaning]
Fedora 38 seems to have updated to GCC 13, which is the source of this error. TBB themselves fixed it here:
The fix was to change this line:
to tbb::task* next_offloaded;
We should consider either applying this patch ourselves in the math library or updating our vendored copy of TBB. (pinging @andrjohns@rok_cesnovar@wds15 - how would we like to handle this?)
For now, if it’s acceptable to you, making this change to your downloaded copy should allow the build to succeed @Unlearned5341