Apache Mesos make errors

来源:互联网 发布:淘宝怎么删除差评 编辑:程序博客网 时间:2024/05/01 00:50

OS: Ubuntu 12.04

Kernel Version: 3.0.0-12-generic

GCC Version: 4.6.3

Mesos Version: 0.12.0

在主目录下 执行 make 命令时,出现如下异常:

../../src/files/files.cpp:278:
56: error: no matching function for call to 'min(ssize_t&, long int)'
../../src/files/files.cpp:278:56: note: candidates are:
/usr/include/c++/4.6/bits/stl_algobase.h:187:5: note: template<class _Tp>
const _Tp& std::min(const _Tp&, const _Tp&)
/usr/include/c++/4.6/bits/stl_algobase.h:233:5: note: template<class _Tp,
class _Compare> const _Tp&
std::min(const _Tp&, const _Tp&, _Compare)
make[2]: *** [files/libmesos_no_third_party_la-files.lo] Error 1
make[2]: Leaving directory


红色加粗部分提示 std::min 有错误。

原因以及解决方法如下(官方提供的答案,经测试OK):

Got it, unfortunately we don't run CI against gcc 4.6 so bugs likethis creep up on trunk. I'd advise getting off trunk, the 0.10.0release candidate is here:http://people.apache.org/~benh/mesos-0.10.0-incubating-RC2/mesos-0.10.0-incubating.tar.gzIf even that doesn't work, try the following fix to files.cpp:Before:  length = std::min(length, sysconf(_SC_PAGE_SIZE) * 16);After:  length = std::min(length, (ssize_t) sysconf(_SC_PAGE_SIZE) * 16);

按照以上提示修改后,再次执行,已经OK!

详情请参考:

http://mail-archives.apache.org/mod_mbox/incubator-mesos-dev/201303.mbox/%3CCA+8RcoRzFA7e_PMuFOchnS12AXRe24nWu_WvKHKHroHwqqty1A@mail.gmail.com%3E


附注:(Overview of Mesos )

https://github.com/apache/incubator-mesos/blob/trunk/docs/Home.md

原创粉丝点击