roualdes / bridgestan

BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.
https://roualdes.github.io/bridgestan
BSD 3-Clause "New" or "Revised" License
88 stars 12 forks source link

clang: error: no such file or directory: './stan/lib/stan_math/lib/tbb/libtbb.dylib' #214

Closed MooersLab closed 7 months ago

MooersLab commented 7 months ago

After downloading bridgestan via git, setting CXX=clang in make/local on a Mac with Xcode command line tools, and running make test_models/multi/multi_model.so, I get the following error:

--- Translating Stan model to C++ code --- ./bin/stanc --o=test_models/multi/multi.hpp test_models/multi/multi.stan

--- Compiling C++ code --- 'clang' -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -DSTAN_THREADS -I ./stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I ./stan/src -I ./stan/lib/rapidjson_1.1.0/ -I ./stan/lib/stan_math/ -I ./stan/lib/stan_math/lib/eigen_3.4.0 -I ./stan/lib/stan_math/lib/boost_1.81.0 -I ./stan/lib/stan_math/lib/sundials_6.1.1/include -I ./stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_DISABLE_ASSERTS -DBRIDGESTAN_EXPORT -c -x c++ -o test_models/multi/multi.o test_models/multi/multi.hpp In file included from test_models/multi/multi.hpp:2: In file included from ./stan/src/stan/model/model_header.hpp:4: In file included from ./stan/lib/stan_math/stan/math.hpp:19: In file included from ./stan/lib/stan_math/stan/math/rev.hpp:10: In file included from ./stan/lib/stan_math/stan/math/rev/core.hpp:10: In file included from ./stan/lib/stan_math/stan/math/rev/core/chainable_object.hpp:6: In file included from ./stan/lib/stan_math/stan/math/rev/core/typedefs.hpp:7: In file included from ./stan/lib/stan_math/stan/math/rev/core/Eigen_NumTraits.hpp:5: In file included from ./stan/lib/stan_math/stan/math/prim/core.hpp:4: In file included from ./stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:6: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast.hpp:32: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/try_lexical_convert.hpp:44: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/detail/converter_lexical.hpp:54: ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:285:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(begin, ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'

define deprecated_msg(_msg) attribute((deprecated__(_msg)))

                                                  ^

In file included from test_models/multi/multi.hpp:2: In file included from ./stan/src/stan/model/model_header.hpp:4: In file included from ./stan/lib/stan_math/stan/math.hpp:19: In file included from ./stan/lib/stan_math/stan/math/rev.hpp:10: In file included from ./stan/lib/stan_math/stan/math/rev/core.hpp:10: In file included from ./stan/lib/stan_math/stan/math/rev/core/chainable_object.hpp:6: In file included from ./stan/lib/stan_math/stan/math/rev/core/typedefs.hpp:7: In file included from ./stan/lib/stan_math/stan/math/rev/core/Eigen_NumTraits.hpp:5: In file included from ./stan/lib/stan_math/stan/math/prim/core.hpp:4: In file included from ./stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:6: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast.hpp:32: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/try_lexical_convert.hpp:44: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/detail/converter_lexical.hpp:54: ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:297:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(begin, ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'

define deprecated_msg(_msg) attribute((deprecated__(_msg)))

                                                  ^

In file included from test_models/multi/multi.hpp:2: In file included from ./stan/src/stan/model/model_header.hpp:4: In file included from ./stan/lib/stan_math/stan/math.hpp:19: In file included from ./stan/lib/stan_math/stan/math/rev.hpp:10: In file included from ./stan/lib/stan_math/stan/math/rev/core.hpp:10: In file included from ./stan/lib/stan_math/stan/math/rev/core/chainable_object.hpp:6: In file included from ./stan/lib/stan_math/stan/math/rev/core/typedefs.hpp:7: In file included from ./stan/lib/stan_math/stan/math/rev/core/Eigen_NumTraits.hpp:5: In file included from ./stan/lib/stan_math/stan/math/prim/core.hpp:4: In file included from ./stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:6: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast.hpp:32: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/try_lexical_convert.hpp:44: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/detail/converter_lexical.hpp:54: ./stan/lib/stan_math/lib/boost_1.81.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:310:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(begin, ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'

define deprecated_msg(_msg) attribute((deprecated__(_msg)))

                                                  ^

In file included from test_models/multi/multi.hpp:2: In file included from ./stan/src/stan/model/model_header.hpp:4: In file included from ./stan/lib/stan_math/stan/math.hpp:19: In file included from ./stan/lib/stan_math/stan/math/rev.hpp:12: In file included from ./stan/lib/stan_math/stan/math/rev/fun.hpp:200: In file included from ./stan/lib/stan_math/stan/math/prim/functor.hpp:16: In file included from ./stan/lib/stan_math/stan/math/prim/functor/integrate_ode_rk45.hpp:6: In file included from ./stan/lib/stan_math/stan/math/prim/functor/ode_rk45.hpp:9: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/numeric/odeint.hpp:37: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp:40: ./stan/lib/stan_math/lib/boost_1.81.0/boost/numeric/odeint/integrate/max_step_checker.hpp:72:18: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] std::sprintf(error_msg, "Max number of iterations exceeded (%d).", m_max_steps); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'

define deprecated_msg(_msg) attribute((deprecated__(_msg)))

                                                  ^

In file included from test_models/multi/multi.hpp:2: In file included from ./stan/src/stan/model/model_header.hpp:4: In file included from ./stan/lib/stan_math/stan/math.hpp:19: In file included from ./stan/lib/stan_math/stan/math/rev.hpp:12: In file included from ./stan/lib/stan_math/stan/math/rev/fun.hpp:200: In file included from ./stan/lib/stan_math/stan/math/prim/functor.hpp:16: In file included from ./stan/lib/stan_math/stan/math/prim/functor/integrate_ode_rk45.hpp:6: In file included from ./stan/lib/stan_math/stan/math/prim/functor/ode_rk45.hpp:9: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/numeric/odeint.hpp:37: In file included from ./stan/lib/stan_math/lib/boost_1.81.0/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp:40: ./stan/lib/stan_math/lib/boost_1.81.0/boost/numeric/odeint/integrate/max_step_checker.hpp:104:18: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] std::sprintf(error_msg, "Max number of iterations exceeded (%d). A new step size was not found.", m_max_steps); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'

define deprecated_msg(_msg) attribute((deprecated__(_msg)))

                                                  ^

5 warnings generated.

--- Linking C++ code --- 'clang' -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -DSTAN_THREADS -I ./stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I ./stan/src -I ./stan/lib/rapidjson_1.1.0/ -I ./stan/lib/stan_math/ -I ./stan/lib/stan_math/lib/eigen_3.4.0 -I ./stan/lib/stan_math/lib/boost_1.81.0 -I ./stan/lib/stan_math/lib/sundials_6.1.1/include -I ./stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_DISABLE_ASSERTS -DBRIDGESTAN_EXPORT -Wl,-L,"/Users/blaine/software/bridgestan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/blaine/software/bridgestan/stan/lib/stan_math/lib/tbb" -shared -lm -o test_models/multi/multi_model.so test_models/multi/multi.o ./src/bridgestan_threads.o -ltbb ./stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_nvecserial.a ./stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_cvodes.a ./stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_idas.a ./stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_kinsol.a ./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 clang: error: no such file or directory: './stan/lib/stan_math/lib/tbb/libtbb.dylib' make: *** [test_models/multi/multi_model.so] Error 1 rm test_models/multi/multi.hpp test_models/multi/multi.o

MooersLab commented 7 months ago

My bad. I forgot that you have to use clang++ on a Mac. I set CXX='clang++' in the file make/local. This fixed the issue. I am closing this issue.

bob-carpenter commented 7 months ago

I forgot that you have to use clang++ on a Mac.

Xcode gives you clang++, but you can use GCC on Mac OS X by installing GCC. You can install through brew.

MooersLab commented 7 months ago

I was not aware of that alternative approach. Thank you very much!!