Cannot install cmdstan: Mac OS Catalina

I cannot install cmdstan, and it seems to be a problem with boost. I cloned the repo, ran make build, and then get the output and error below. I’m running Mac OS 10.15.7, clang version 12.0.0 (clang-1200.0.32.2), and attempting to install cmdstan 2.22.

clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -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.9 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.5.0/include    -DBOOST_DISABLE_ASSERTS               -Wl,-L,"/Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/tbb"      bin/cmdstan/stansummary.o stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a         -o bin/stansummary
ld: warning: directory not found for option '-L/Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/tbb'
ld: warning: ignoring file stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
  "boost::program_options::validators::check_first_occurrence(boost::any const&)", referenced from:
      void boost::program_options::validate<int, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, int*, long) in stansummary.o
  "boost::program_options::to_internal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > boost::program_options::to_internal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in stansummary.o
  "boost::program_options::variables_map::variables_map()", referenced from:
      _main in stansummary.o
  "boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) in stansummary.o
  "boost::program_options::options_description::add_options()", referenced from:
      _main in stansummary.o
  "boost::program_options::options_description::m_default_line_length", referenced from:
      _main in stansummary.o
  "boost::program_options::options_description::options_description(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, unsigned int)", referenced from:
      _main in stansummary.o
  "boost::program_options::invalid_option_value::invalid_option_value(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      void boost::program_options::validate<int, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, int*, long) in stansummary.o
      void boost::program_options::validate<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*, int) in stansummary.o
  "boost::program_options::error_with_option_name::error_with_option_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) in stansummary.o
  "boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)", referenced from:
      _main in stansummary.o
  "boost::program_options::options_description_easy_init::operator()(char const*, char const*)", referenced from:
      _main in stansummary.o
  "boost::program_options::positional_options_description::add(char const*, int)", referenced from:
      _main in stansummary.o
  "boost::program_options::positional_options_description::positional_options_description()", referenced from:
      _main in stansummary.o
  "boost::program_options::arg", referenced from:
      boost::program_options::typed_value<int, char>::name() const in stansummary.o
      boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>::name() const in stansummary.o
      boost::program_options::typed_value<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char>::name() const in stansummary.o
  "boost::program_options::store(boost::program_options::basic_parsed_options<char> const&, boost::program_options::variables_map&, bool)", referenced from:
      _main in stansummary.o
  "boost::program_options::detail::cmdline::set_positional_options(boost::program_options::positional_options_description const&)", referenced from:
      _main in stansummary.o
  "boost::program_options::detail::cmdline::set_options_description(boost::program_options::options_description const&)", referenced from:
      _main in stansummary.o
  "boost::program_options::detail::cmdline::get_canonical_option_prefix()", referenced from:
      boost::program_options::basic_command_line_parser<char>::run() in stansummary.o
  "boost::program_options::detail::cmdline::run()", referenced from:
      boost::program_options::basic_command_line_parser<char>::run() in stansummary.o
  "boost::program_options::detail::cmdline::cmdline(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)", referenced from:
      boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*) in stansummary.o
  "boost::program_options::notify(boost::program_options::variables_map&)", referenced from:
      _main in stansummary.o
  "boost::program_options::validate(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, int)", referenced from:
      boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>::xparse(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) const in stansummary.o
      void boost::program_options::validate<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*, int) in stansummary.o
  "boost::program_options::abstract_variables_map::operator[](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
      _main in stansummary.o
  "boost::program_options::error_with_option_name::substitute_placeholders(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
      vtable for boost::exception_detail::error_info_injector<boost::program_options::validation_error> in stansummary.o
      vtable for boost::program_options::validation_error in stansummary.o
      vtable for boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      construction vtable for boost::exception_detail::clone_impl<boost::wrapexcept<boost::program_options::validation_error>::error_info_injector<boost::program_options::validation_error> >-in-boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::validation_error> > in stansummary.o
      vtable for boost::exception_detail::error_info_injector<boost::program_options::invalid_option_value> in stansummary.o
      vtable for boost::program_options::invalid_option_value in stansummary.o
      ...
  "boost::program_options::error_with_option_name::what() const", referenced from:
      vtable for boost::exception_detail::error_info_injector<boost::program_options::validation_error> in stansummary.o
      vtable for boost::program_options::validation_error in stansummary.o
      vtable for boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      construction vtable for boost::exception_detail::clone_impl<boost::wrapexcept<boost::program_options::validation_error>::error_info_injector<boost::program_options::validation_error> >-in-boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::validation_error> > in stansummary.o
      vtable for boost::exception_detail::error_info_injector<boost::program_options::invalid_option_value> in stansummary.o
      vtable for boost::program_options::invalid_option_value in stansummary.o
      ...
  "boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) const", referenced from:
      vtable for boost::program_options::typed_value<int, char> in stansummary.o
      vtable for boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char> in stansummary.o
      vtable for boost::program_options::typed_value<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char> in stansummary.o
  "typeinfo for boost::program_options::error_with_option_name", referenced from:
      typeinfo for boost::program_options::validation_error in stansummary.o
  "typeinfo for boost::program_options::value_semantic_codecvt_helper<char>", referenced from:
      typeinfo for boost::program_options::typed_value<int, char> in stansummary.o
      typeinfo for boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char> in stansummary.o
      typeinfo for boost::program_options::typed_value<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char> in stansummary.o
  "vtable for boost::program_options::variables_map", referenced from:
      _main in stansummary.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for boost::program_options::error_with_option_name", referenced from:
      void boost::program_options::validate<int, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, int*, long) in stansummary.o
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) in stansummary.o
      boost::program_options::invalid_option_value::~invalid_option_value() in stansummary.o
      boost::program_options::validation_error::~validation_error() in stansummary.o
      boost::program_options::error_with_option_name::error_with_option_name(boost::program_options::error_with_option_name const&) in stansummary.o
      boost::program_options::validation_error::~validation_error() in stansummary.o
      boost::exception_detail::error_info_injector<boost::program_options::validation_error>::error_info_injector(boost::exception_detail::error_info_injector<boost::program_options::validation_error> const&) in stansummary.o
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/stansummary] Error 1

Thanks for any help you can give!

That is quite an old cmdstan. The latest release version is 2.25: https://github.com/stan-dev/cmdstan/releases/tag/v2.25.0

Does 2.25 work? But you also said you cloned from develop so maybe I misunderstood the 2.22 thing. Is this a clone from develop or an old version?

I could absolutely have that version number wrong, it’s just something I saw in the README. I just cloned from dev so it’s likely the newer one. Sorry about that.

this looks like a TBB lib problem - could you try make clean-all before doing make build?

sorry you were confused by the note in the README - we’ll try to make it clear that there are more recent versions of CmdStan.

No need to apologise, this was just me rushing!

did you get things to work? instructions for installing from github dev branch here: https://mc-stan.org/docs/2_25/cmdstan-guide/cmdstan-installation.html#git-clone.section

critical step is this:

> git clone https://github.com/stan-dev/cmdstan.git --recursive

Unfortunately not. I started fresh by cloning with git clone https://github.com/stan-dev/cmdstan.git --recursive, but then calling make build from the cmdstan directory gave these same errors that seem to be related to boost (full text pasted below, including the steps preceding the errors that arose from running this ‘fresh’).

curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/mac-stanc -o bin/stanc --retry 5 --retry-delay 10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   635  100   635    0     0   2003      0 --:--:-- --:--:-- --:--:--  2003
100 10.5M  100 10.5M    0     0  3328k      0  0:00:03  0:00:03 --:--:-- 3730k
chmod +x bin/stanc
clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -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.9 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.5.0/include    -DBOOST_DISABLE_ASSERTS         -c -fvisibility=hidden -o bin/cmdstan/stansummary.o src/cmdstan/stansummary.cpp
cd stan/lib/stan_math/lib/boost_1.72.0; ./bootstrap.sh
Building Boost.Build engine with toolset clang... tools/build/src/engine/b2
Detecting Python version... 2.7
Detecting Python root... /usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam for clang...

Bootstrapping is done. To build, run:

    ./b2

To generate header files, run:

    ./b2 headers

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help

   - Getting started guide:
     http://www.boost.org/more/getting_started/unix-variants.html

   - Boost.Build documentation:
     http://www.boost.org/build/

cd stan/lib/stan_math/lib/boost_1.72.0; ./b2  toolset=clang --visibility=hidden --with-program_options cxxstd=11 variant=release link=static
Performing configuration checks

    - default address-model    : 64-bit
    - default architecture     : x86

Building the Boost C++ Libraries.



Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - contract                 : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - fiber                    : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - headers                  : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - stacktrace               : not building
    - system                   : not building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - type_erasure             : not building
    - wave                     : not building

...patience...
...found 1071 targets...
...updating 48 targets...
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/BoostDetectToolset-1.72.0.cmake
boost-install.generate-cmake-config-version- bin.v2/tools/boost_install/BoostConfigVersion.cmake
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/Boost-1.72.0/BoostConfig.cmake
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/Boost-1.72.0/BoostConfigVersion.cmake
boost-install.generate-cmake-config- bin.v2/libs/program_options/build/stage/boost_program_options-config.cmake
boost-install.generate-cmake-config- bin.v2/libs/headers/build/stage/boost_headers-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/headers/build/stage/boost_headers-config-version.cmake
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/boost_program_options-1.72.0/boost_program_options-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/program_options/build/stage/boost_program_options-config-version.cmake
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/boost_headers-1.72.0/boost_headers-config.cmake
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/boost_headers-1.72.0/boost_headers-config-version.cmake
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/boost_program_options-1.72.0/boost_program_options-config-version.cmake
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/config_file.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/cmdline.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/parsers.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/options_description.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/positional_options.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/utf8_codecvt_facet.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/variables_map.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/convert.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/winmain.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/value_semantic.o
clang-darwin.compile.c++ bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/split.o
clang-darwin.archive bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/libboost_program_options.a
ranlib: invalid option -- c
ranlib: invalid option -- s
boost-install.generate-cmake-variant- bin.v2/libs/program_options/build/clang-darwin-12.0/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/libboost_program_options-variant-static.cmake
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a
common.copy /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib/cmake/boost_program_options-1.72.0/libboost_program_options-variant-static.cmake
...updated 48 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0

The following directory should be added to linker library paths:

    /Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/boost_1.72.0/stage/lib

clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -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.9 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.5.0/include    -DBOOST_DISABLE_ASSERTS               -Wl,-L,"/Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/tbb"      bin/cmdstan/stansummary.o stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a         -o bin/stansummary
ld: warning: directory not found for option '-L/Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/tbb'
ld: warning: ignoring file stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
  "boost::program_options::validators::check_first_occurrence(boost::any const&)", referenced from:
      void boost::program_options::validate<int, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, int*, long) in stansummary.o
  "boost::program_options::to_internal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > boost::program_options::to_internal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in stansummary.o
  "boost::program_options::variables_map::variables_map()", referenced from:
      _main in stansummary.o
  "boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) in stansummary.o
  "boost::program_options::options_description::add_options()", referenced from:
      _main in stansummary.o
  "boost::program_options::options_description::m_default_line_length", referenced from:
      _main in stansummary.o
  "boost::program_options::options_description::options_description(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, unsigned int)", referenced from:
      _main in stansummary.o
  "boost::program_options::invalid_option_value::invalid_option_value(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      void boost::program_options::validate<int, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, int*, long) in stansummary.o
      void boost::program_options::validate<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*, int) in stansummary.o
  "boost::program_options::error_with_option_name::error_with_option_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) in stansummary.o
  "boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)", referenced from:
      _main in stansummary.o
  "boost::program_options::options_description_easy_init::operator()(char const*, char const*)", referenced from:
      _main in stansummary.o
  "boost::program_options::positional_options_description::add(char const*, int)", referenced from:
      _main in stansummary.o
  "boost::program_options::positional_options_description::positional_options_description()", referenced from:
      _main in stansummary.o
  "boost::program_options::arg", referenced from:
      boost::program_options::typed_value<int, char>::name() const in stansummary.o
      boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>::name() const in stansummary.o
      boost::program_options::typed_value<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char>::name() const in stansummary.o
  "boost::program_options::store(boost::program_options::basic_parsed_options<char> const&, boost::program_options::variables_map&, bool)", referenced from:
      _main in stansummary.o
  "boost::program_options::detail::cmdline::set_positional_options(boost::program_options::positional_options_description const&)", referenced from:
      _main in stansummary.o
  "boost::program_options::detail::cmdline::set_options_description(boost::program_options::options_description const&)", referenced from:
      _main in stansummary.o
  "boost::program_options::detail::cmdline::get_canonical_option_prefix()", referenced from:
      boost::program_options::basic_command_line_parser<char>::run() in stansummary.o
  "boost::program_options::detail::cmdline::run()", referenced from:
      boost::program_options::basic_command_line_parser<char>::run() in stansummary.o
  "boost::program_options::detail::cmdline::cmdline(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)", referenced from:
      boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*) in stansummary.o
  "boost::program_options::notify(boost::program_options::variables_map&)", referenced from:
      _main in stansummary.o
  "boost::program_options::validate(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, int)", referenced from:
      boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>::xparse(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) const in stansummary.o
      void boost::program_options::validate<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*, int) in stansummary.o
  "boost::program_options::abstract_variables_map::operator[](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
      _main in stansummary.o
  "boost::program_options::error_with_option_name::substitute_placeholders(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
      vtable for boost::exception_detail::error_info_injector<boost::program_options::validation_error> in stansummary.o
      vtable for boost::program_options::validation_error in stansummary.o
      vtable for boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      construction vtable for boost::exception_detail::clone_impl<boost::wrapexcept<boost::program_options::validation_error>::error_info_injector<boost::program_options::validation_error> >-in-boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::validation_error> > in stansummary.o
      vtable for boost::exception_detail::error_info_injector<boost::program_options::invalid_option_value> in stansummary.o
      vtable for boost::program_options::invalid_option_value in stansummary.o
      ...
  "boost::program_options::error_with_option_name::what() const", referenced from:
      vtable for boost::exception_detail::error_info_injector<boost::program_options::validation_error> in stansummary.o
      vtable for boost::program_options::validation_error in stansummary.o
      vtable for boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      construction vtable for boost::exception_detail::clone_impl<boost::wrapexcept<boost::program_options::validation_error>::error_info_injector<boost::program_options::validation_error> >-in-boost::wrapexcept<boost::program_options::validation_error> in stansummary.o
      vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::validation_error> > in stansummary.o
      vtable for boost::exception_detail::error_info_injector<boost::program_options::invalid_option_value> in stansummary.o
      vtable for boost::program_options::invalid_option_value in stansummary.o
      ...
  "boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) const", referenced from:
      vtable for boost::program_options::typed_value<int, char> in stansummary.o
      vtable for boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char> in stansummary.o
      vtable for boost::program_options::typed_value<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char> in stansummary.o
  "typeinfo for boost::program_options::error_with_option_name", referenced from:
      typeinfo for boost::program_options::validation_error in stansummary.o
  "typeinfo for boost::program_options::value_semantic_codecvt_helper<char>", referenced from:
      typeinfo for boost::program_options::typed_value<int, char> in stansummary.o
      typeinfo for boost::program_options::typed_value<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char> in stansummary.o
      typeinfo for boost::program_options::typed_value<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char> in stansummary.o
  "vtable for boost::program_options::variables_map", referenced from:
      _main in stansummary.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for boost::program_options::error_with_option_name", referenced from:
      void boost::program_options::validate<int, char>(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, int*, long) in stansummary.o
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) in stansummary.o
      boost::program_options::invalid_option_value::~invalid_option_value() in stansummary.o
      boost::program_options::validation_error::~validation_error() in stansummary.o
      boost::program_options::error_with_option_name::error_with_option_name(boost::program_options::error_with_option_name const&) in stansummary.o
      boost::program_options::validation_error::~validation_error() in stansummary.o
      boost::exception_detail::error_info_injector<boost::program_options::validation_error>::error_info_injector(boost::exception_detail::error_info_injector<boost::program_options::validation_error> const&) in stansummary.o
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/stansummary] Error 1

I wonder what this means:

That seems to be the error. The program options got built, but it’s not linkable.

I think the program options thing is something we’re trying to remove right now (https://github.com/stan-dev/cmdstan/pull/965)

You can try that branch out by doing this in your cmdstan folder:

make clean-all
git checkout feature/929-stansummary-cli11
make build

If this is a boost program_options problem then maybe that solves it (and that branch will be merged into develop soon anyway).

1 Like

just merged the PR to get rid of use of the boost::program_options.
if you have the time and patience, it would be great if you could try again w/ develop.

1 Like

It seems to have worked, thanks so much for your help! FYI I did see this warning quite a few times: I mention it just in case this indicates any sort of problem, but I’ve been able to compile a Stan programme OK so it seems alright for now.

ld: warning: directory not found for option '-L/Users/hamedbh/github/cmdstan/stan/lib/stan_math/lib/tbb'

I’ll mark @bbbales2 answer as the solution just because it has some detail on why the error happened, but I ended up building from develop as you suggested, @mitzimorris.

1 Like

thanks for reporting this. we’ll look into it - there’s a lot of Makefile logic around the use of the Intel TBB library - @rok_cesnovar might have some insight.

regarding solution - that branch has been merged to master and will be deleted,
so technically, solution that worked, but won’t work in the future.

not sure what the semantics of “solution” are - that’s a problem with the “gamification” of the system. agreed that Ben Bales deserves full credit on this one. but in the future, users on Catalina should be able to build from develop without encountering this particular problem.

Is there a chance cmdstan was built and later moved or something like that? That seems the most plausible?

1 Like