Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos Can';t在OSX Mavericks下构建boost 1.55+;Xcode 5_Macos_C++11_Boost_Xcode5_Clang - Fatal编程技术网

Macos Can';t在OSX Mavericks下构建boost 1.55+;Xcode 5

Macos Can';t在OSX Mavericks下构建boost 1.55+;Xcode 5,macos,c++11,boost,xcode5,clang,Macos,C++11,Boost,Xcode5,Clang,当我尝试在我的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++ link

当我尝试在我的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
<代码> CLAN达尔文。编译。C++ /tmp/boost/build/boost/bin.v2/libs/acculators/test/valarray.test/clang-darwin-4.2.1/debug/link static/valarray.o 在valarray.cpp中包含的文件中:18: ../../../boost/acculators/statistics/weighted_-mean.hpp:73:13:错误:没有用于初始化“result_-type”(也称为“valarray”)的匹配构造函数 :平均( ^ ../../boost/acculators/framework/dependens_-on.hpp:319:17:注意:在函数模板专门化的实例化中,此处请求“boost::acculators::impl::immediate_-weighted_-mean_-impl::immediate_-weighted_-mean_-impl” :蓄能器(args) ^ ../../../boost/acculators/framework/dependens_-on.hpp:252:29:注意:在函数模板专门化的实例化中,此处请求“boost::acculators::detail::acculator_wrapper::acculator_wrapper” 其他人看到了吗?这是已知的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版上用这些标志编译boost,至少它通过了你提到的累加器测试。

你知道自制软件吗?我在10.9版上从那里安装了我的所有库。boost对brewAlas没有问题,我们的过程要求我们在内部构建库以“确保它们是使用正确的编译器和标志构建的“。尽管如此,您可以编辑boost.rb公式并放置您的标志。但最重要的是,您可以看看boost实际上是如何构建在mac 10.9上的,并看看您的安装有什么问题。这不是一个糟糕的安装,问题是我正试图让boost构建在一个尚不受支持的编译器上(来自Apple LLVM 5.1的clang)使用尚不支持的编译器标志(-std=c++11-stdlib=libc++).我站在最前沿,试图找出编译器不喜欢这段代码的原因。还有其他问题已经得到解决和修补-我甚至可以构建boost库的唯一方法是将这些修补程序应用到我的1.55源代码中。对我来说,没有一些扭曲,我甚至无法构建boost库,更不用说任何回归测试了。我怀疑你和我使用的是不同版本的编译器(我使用的是“Apple LLVM版本5.1(clang-503.0.38)(基于LLVM 3.4svn)”)。由于已知问题,boost构建失败(1.55后的补丁已经可以修复这些问题)但是一旦我应用了补丁,我可以使用您指定的标志构建boost,但是(1)我需要启用c++11,并且(2)我需要使用libc++而不是libstdc++。