WardBrian / pybind_expose_stan_fns

Exposing Stan functions in Python
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Error in the expose #6

Closed wellington36 closed 1 month ago

wellington36 commented 1 month ago

Hi, I think the last commit (https://github.com/WardBrian/pybind_expose_stan_fns/commit/c85790f60e82fc678137803872238ecedef1a6a0) caused this error, I installed the previous one and used it normally. I updated the package locally with the latest version and this error occurred.

Traceback (most recent call last):
  File "/home/wellington/Documents/adaptive_truncation_table_generator/comp_Z_errors.py", line 66, in <module>
    brms_fixed_comp = psf.expose('stan/comp_Z_brms_fixed.stan')
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wellington/.local/lib/python3.12/site-packages/pybind_stan_fns/__init__.py", line 139, in expose
    raise RuntimeError("Build failed!\n" + " ".join(compile_command) + "\n" + res.stderr)
RuntimeError: Build failed!
g++ -std=c++1y -O3 -Wno-sign-compare -Wno-deprecated-builtins -Wno-ignored-attributes -shared -fPIC -fvisibility=hidden -D_REENTRANT -DBOOST_DISABLE_ASSERTS -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/src -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/rapidjson_1.1.0 -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/eigen_3.4.0 -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/boost_1.84.0 -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb_2020.3/include -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/sundials_6.1.1/include -I/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -I/usr/include/python3.12 -I/home/wellington/.local/lib/python3.12/site-packages/pybind11/include -o/home/wellington/Documents/adaptive_truncation_table_generator/stan/comp_Z_brms_fixed.cpython-312-x86_64-linux-gnu.so /home/wellington/Documents/adaptive_truncation_table_generator/stan/comp_Z_brms_fixed.cpp -Wl,-L,/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb -Wl,-L,/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/sundials_6.1.1/lib -Wl,-rpath,/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/lib/tbb -ltbb -lsundials_nvecserial -lsundials_cvodes -lsundials_idas -lsundials_kinsol
In file included from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math/prim/meta/return_type.hpp:5,
                 from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math/prim/meta/append_return_type.hpp:5,
                 from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math/prim/meta.hpp:72,
                 from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math/rev/core/accumulate_adjoints.hpp:4,
                 from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math/rev/core.hpp:4,
                 from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math/rev.hpp:10,
                 from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math.hpp:19,
                 from /home/wellington/.cmdstan/cmdstan-2.34.1/stan/src/stan/model/model_header.hpp:4,
                 from /home/wellington/Documents/adaptive_truncation_table_generator/stan/comp_Z_brms_fixed.cpp:2:
/home/wellington/.cmdstan/cmdstan-2.34.1/stan/lib/stan_math/stan/math/prim/meta/promote_args.hpp:4:10: fatal error: boost/math/tools/promotion.hpp: No such file or directory
    4 | #include <boost/math/tools/promotion.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
WardBrian commented 1 month ago

/home/wellington/.cmdstan/cmdstan-2.34.1

Yep, that would be expected. Some stuff changed between 2.34 and 2.35, and it would be rather difficult to support both versions at once. You can either continue using the prior commit, as you are doing, or update cmdstan