无法在 OSX Mavericks + Xcode 5 下构建 boost 1.55



当我尝试在Mac机器上构建boost时,库本身构建良好,但随后甚至无法构建累加器回归测试。 这是我的工作:

tar -xzf ../boost_1_55_0.tar.gz
mkdir /tmp/boost
mkdir /tmp/boost/build
mkdir /tmp/boost/install
cd boost_1_55_0
./bootstrap.sh
./b2 toolset=clang cxxflags=-std=c++11 cxxflags=-stdlib=libc++ linkflags=-stdlib=libc++ -j2 --prefix=/tmp/boost/install --build-dir=/tmp/boost/build variant=release link=static threading=multi install
cd libs/accumulators/test
../../../b2 toolset=clang cxxflags=-std=c++11 cxxflags=-stdlib=libc++ linkflags=-stdlib=libc++ -j2 --build-dir=/tmp/boost/build

我得到的错误是:

clang-darwin.compile.c++ 
/tmp/boost/build/boost/bin.v2/libs/accumulators/test/valarray.test/clang-darwin-4.2.1/debug/link-static/valarray.o
In file included from valarray.cpp:18:
../../../boost/accumulators/statistics/weighted_mean.hpp:73:13: error: no matching constructor for initialization of 'result_type' (aka 'valarray<typename divides<left_value_type, const double>::result_type>')
      : mean(
        ^
../../../boost/accumulators/framework/depends_on.hpp:319:17: note: in instantiation of function template specialization 'boost::accumulators::impl::immediate_weighted_mean_impl<std::__1::valarray<int>, int, boost::accumulators::tag::sample>::immediate_weighted_mean_impl<boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<boost::accumulators::tag::sample, const std::__1::valarray<int> >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<std::__1::valarray<int>, boost::accumulators::stats<boost::accumulators::tag::weighted_mean (boost::accumulators::immediate), mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, int> >, boost::parameter::aux::empty_arg_list> > >' requested here
          : Accumulator(args)
            ^
../../../boost/accumulators/framework/depends_on.hpp:252:29: note: in instantiation of function template specialization 'boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::immediate_weighted_mean_impl<std::__1::valarray<int>, int, boost::accumulators::tag::sample>, boost::accumulators::tag::immediate_weighted_mean>::accumulator_wrapper<boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<boost::accumulators::tag::sample, const std::__1::valarray<int> >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<std::__1::valarray<int>, boost::accumulators::stats<boost::accumulators::tag::weighted_mean (boost::accumulators::immediate), mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, int> >, boost::parameter::aux::empty_arg_list> > >' requested here

还有其他人看到这个吗? 这是一个已知的 boost 错误吗?

试试:

./b2 toolset=clang cxxflags=-stdlib=libstdc++ linkflags=-stdlib=libstdc++ -j2 --prefix=/tmp/boost/install --build-dir=/tmp/boost/build variant=release link=static threading=multi install

我已经有了使用这些标志在 10.9.2 上进行编译的提升,它似乎至少通过了您提到的累加器测试。

最新更新