Cmdstan 2.24.1 Compile Error

I installed cmdstan-2.24.1 on our cluster and it issues a number of compilation errors on the bernoulli example. The first ~30 lines of output are shown below. The example runs fine with cmdstan-2.18 on the same cluster. Any ideas on what is causing the problem and how to fix it? Thanks in advance for any suggestions.

[labone@login001 cmdstan-home]$ make examples/bernoulli/bernoulli

--- Compiling the main object file. This might take up to a minute. ---
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.7 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include    -DBOOST_DISABLE_ASSERTS      -c -o src/cmdstan/main.o src/cmdstan/main.cpp
In file included from stan/lib/stan_math/stan/math/prim/meta.hpp:168:0,
                 from stan/lib/stan_math/stan/math/prim/err/invalid_argument.hpp:4,
                 from stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:4,
                 from src/cmdstan/write_parallel_info.hpp:5,
                 from src/cmdstan/command.hpp:13,
                 from src/cmdstan/main.cpp:1:
stan/lib/stan_math/stan/math/prim/meta/ad_promotable.hpp:21:31: error: ‘decay_t’ is not a member of ‘std’
           std::is_convertible<std::decay_t<From>, std::decay_t<To>>::value> {};
                               ^
stan/lib/stan_math/stan/math/prim/meta/ad_promotable.hpp:21:31: error: ‘decay_t’ is not a member of ‘std’
stan/lib/stan_math/stan/math/prim/meta/ad_promotable.hpp:21:48: error: wrong number of template arguments (1, should be 2)
           std::is_convertible<std::decay_t<From>, std::decay_t<To>>::value> {};
                                                ^
In file included from /usr/include/c++/4.8.2/bits/stl_iterator_base_types.h:67:0,
                 from /usr/include/c++/4.8.2/iterator:61,
                 from stan/lib/stan_math/lib/boost_1.72.0/boost/iterator/iterator_traits.hpp:10,
                 from stan/lib/stan_math/lib/boost_1.72.0/boost/range/iterator_range_core.hpp:26,
                 from stan/lib/stan_math/lib/boost_1.72.0/boost/lexical_cast.hpp:30,
                 from stan/src/stan/callbacks/writer.hpp:4,
                 from src/cmdstan/arguments/argument.hpp:4,
                 from src/cmdstan/arguments/categorical_argument.hpp:4,
                 from src/cmdstan/arguments/arg_data.hpp:4,
                 from src/cmdstan/command.hpp:4,
                 from src/cmdstan/main.cpp:1:
/usr/include/c++/4.8.2/type_traits:1317:12: error: provided for ‘template<class _From, class _To> struct std::is_convertible’
     struct is_convertible
            ^

If possible, add also code to simulate data or attach a (subset of) the dataset you work with.

Please provide this additional information in addition to your question:

  • Operating System:
  • CmdStan Version:
  • Compiler/Toolkit:

Don’t forget to add relevant tags to your topic (top right of this form) especially for application area. Delete this text before posting your topic. Thx!

Looking forward to your topic!

Hi Thomas,

This looks an issue with an out-of-date compiler, since Stan now requires a c++14-compatible toolchain.

What g++/clang++ version are you using on the cluster?

2 Likes

gcc --version gives me 4.8.5

Tom

Hi, the minimum required version as of 2.19 or 2.20 is g++ 4.9.3. You will need to upgrade g++ on the cluster or request the administrators to do it.

2 Likes