Hey all,
I recently started having issues that any time I try to compile a Stan model using cmdstanpy in a linux environment I get an error a “No such file or directory” error.
I am trying to initialize a cmdstanpy model via stan_model_compiled = cmdstanpy.CmdStanModel(stan_file=model_file_path)
and have confirmed that I have a .stan
file at the model_file_path
prior to initializing the model (for example, I have a models/stan_models/model.stan
file).
When initializing, I get this following error:
--- Translating Stan model to C++ code ---
bin/stanc --o=/models/stan_models/model.hpp /models/stan_models/model.stan
Warning in '/models/stan_models/model.stan', line 4, column 4: Declaration
of arrays by placing brackets after a variable name is deprecated and
will be removed in Stan 2.32.0. Instead use the array keyword before the
type. This can be changed automatically using the auto-format flag to
stanc
Warning in '/models/stan_models/model.stan', line 8, column 4: Declaration
of arrays by placing brackets after a variable name is deprecated and
will be removed in Stan 2.32.0. Instead use the array keyword before the
type. This can be changed automatically using the auto-format flag to
stanc
Warning in '/models/stan_models/model.stan', line 10, column 4: Declaration
of arrays by placing brackets after a variable name is deprecated and
will be removed in Stan 2.32.0. Instead use the array keyword before the
type. This can be changed automatically using the auto-format flag to
stanc
--- Compiling, linking C++ code ---
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I /opt/conda/envs/mlaasflow/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.3.9 -I stan/lib/stan_math/lib/boost_1.78.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 -DTBB_INTERFACE_NEW -DTBB_INTERFACE_NEW -c -x c++ -o /models/stan_models/model.o /models/stan_models/model.hpp
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I /opt/conda/envs/mlaasflow/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.3.9 -I stan/lib/stan_math/lib/boost_1.78.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 -DTBB_INTERFACE_NEW -DTBB_INTERFACE_NEW -Wl,-L,"/opt/conda/envs/mlaasflow/lib/" -Wl,-rpath,"/opt/conda/envs/mlaasflow/lib/" -Wl,--disable-new-dtags -ltbb /models/stan_models/model.o src/cmdstan/main.o -Wl,-L,"/opt/conda/envs/mlaasflow/lib/" -Wl,-rpath,"/opt/conda/envs/mlaasflow/lib/" -Wl,--disable-new-dtags -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 -o /models/stan_models/model
/opt/conda/envs/mlaasflow/lib//libtbb.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
/opt/conda/envs/mlaasflow/lib//libtbb.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13'
collect2: error: ld returned 1 exit status
make: *** [make/program:59: /models/stan_models/model] Error 1
Command ['make', '/models/stan_models/model']
error during processing No such file or directory
If I handle the error and then do a listdir, then I can see that some new files have been created 'model.stan', 'model.hpp', 'model.o'
, but as the error suggests, there is no model
(without extension) file.
Can someone help me out with this error, I’ve been looking at it for a while now and am at a loss for what is going wrong.
GCC Version: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Make Version: GNU Make 4.3
Cmdstanpy Version: 1.1.0
Cmdstan Version: 2.31.0