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

cannot install v2.35.0 . Get missing libtbb.dylib error #1280

Closed MooersLab closed 2 months ago

MooersLab commented 2 months ago

Summary:

Fail to make build version 2.35.0 on Mac 13.6.7 with Xcode command line tools installed.

Description:

cd .cmdstan curl -OL https://github.com/stan-dev/cmdstan/releases/download/v2.35.0/cmdstan-2.35.0.tar.gz tar -xf cmdstan-2.35.0.tar.gz cd cmdstan-2.35.0 make -j$(nproc) build

Get the following error:

. . . tbb::internal::throw_exception_v4(tbb::internal::exception_id) in tbb_misc.o tbb::internal::throw_exception_v4(tbb::internal::exception_id) in tbb_misc.o tbb::internal::throw_exception_v4(tbb::internal::exception_id) in tbb_misc.o ... _dynamic_cast, referenced from: tbb::interface7::internal::task_arena_base::internal_execute(tbb::interface7::internal::delegatebase&) const in arena.o gxx_personality_v0, referenced from: /Users/blaine/.cmdstan/cmdstan-2.35.0/stan/lib/stan_math/lib/tbb/concurrent_queue.o clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: [libtbb.dylib] Error 1 make: [stan/lib/stan_math/lib/tbb/tbb.def] Error 2 make: *** Waiting for unfinished jobs.... /2m-28.1s

make buld

'clang' -std=c++17 -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I stan/lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.4.0 -I stan/lib/stan_math/lib/boost_1.84.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DBOOST_DISABLE_ASSERTS -Wl,-L,"/Users/blaine/.cmdstan/cmdstan-2.35.0/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/blaine/.cmdstan/cmdstan-2.35.0/stan/lib/stan_math/lib/tbb" bin/cmdstan/stansummary.o stan/lib/stan_math/lib/tbb/libtbb.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc_proxy.dylib -ltbb -o bin/stansummary clang: error: no such file or directory: 'stan/lib/stan_math/lib/tbb/libtbb.dylib' make: *** [bin/stansummary] Error 1 /0.5s

Yes, there is no ./stan/lib/stan_math/lib/tbb/libtbb.dylib.

Copying libtbb.dylib from version2.34.1 does not solve the problem.

Current Version:

v2.35.0

WardBrian commented 2 months ago

Is this the full error or is there some compiler output you did not include?

andrjohns commented 2 months ago

It looks like this may be related to the issue you reported in the bridgestan repo, where CXX was set to clang instead of clang++

MooersLab commented 2 months ago

@andrjohns You are right. My notes were incomplete. They lacked the step of editing the local file in the make directory.

For newbies and maybe my future self, this is what worked;

cd .cmdstan
curl -OL https://github.com/stan-dev/cmdstan/releases/download/v2.35.0/cmdstan-2.35.0.tar.gz
tar -xf cmdstan-2.35.0.tar.gz
cd cmdstan-2.35.0
cd make
cp local.example local

Uncomment CXX=clang++ in local.

cd ..
make # do this to get instructions for your system
/Library/Developer/CommandLineTools/usr/bin/make build -j4
MooersLab commented 2 months ago

All is well for me with installing version 2.35.0.