stan-dev / cmdstan

CmdStan, the command line interface to Stan
https://mc-stan.org/users/interfaces/cmdstan
BSD 3-Clause "New" or "Revised" License
210 stars 93 forks source link

problems with compiling stan after 2.34.0 on a server #1281

Closed aakhmetz closed 2 months ago

aakhmetz commented 2 months ago

Hello, may I ask you for some possible solutions? I have a VM and run my Stan programs there (it's Centos machine)

There were no problems doing it for Stan 2.33.1, but when I decided to install newer versions, I've got the following error:

src/cmdstan/main.o: In function `tbb::interface7::task_arena::~task_arena()':
main.cpp:(.text._ZN3tbb10interface710task_arenaD2Ev[_ZN3tbb10interface710task_arenaD5Ev]+0x11): undefined reference to `tbb::interface7::internal::task_arena_base::internal_terminate()'
src/cmdstan/main.o: In function `tbb::interface9::global_control::~global_control()':
main.cpp:(.text._ZN3tbb10interface914global_controlD2Ev[_ZN3tbb10interface914global_controlD5Ev]+0x1): undefined reference to `tbb::interface9::global_control::internal_destroy()'
src/cmdstan/main.o: In function `stan::math::init_threadpool_tbb(int)':
main.cpp:(.text._ZN4stan4math19init_threadpool_tbbEi[_ZN4stan4math19init_threadpool_tbbEi]+0x38): undefined reference to `tbb::interface7::internal::task_arena_base::internal_initialize()'
main.cpp:(.text._ZN4stan4math19init_threadpool_tbbEi[_ZN4stan4math19init_threadpool_tbbEi]+0xe6): undefined reference to `tbb::interface9::global_control::internal_create()'
collect2: error: ld returned 1 exit status
make: *** [make/program:80: examples/bernoulli/bernoulli] Error 1
rm examples/bernoulli/bernoulli.o examples/bernoulli/bernoulli.hpp

This error appears with versions 2.34.0 and later. So I wonder if something has been changed at that time.

There is a similar discussion topic on discourse https://discourse.mc-stan.org/t/cmdstan-linking-error-on-linux-server/34133, but I can't use the proposed solution via conda, because I don't have it on my server. Although I may try it or keep working with 2.33.1

My local make file is here: https://gist.github.com/aakhmetz/5d7a1e8280f11ef11347af5e0a713a82

aakhmetz commented 2 months ago

I've found it. Another system version of TBB was installed (4.1-9.20130314.el7), so I removed it and now it works