Apache Mesos make errors

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 like
this creep up on trunk. I'd advise getting off trunk, the 0.10.0
release candidate is here:

http://people.apache.org/~benh/mesos-0.10.0-incubating-RC2/mesos-0.10.0-incubating.tar.gz

If 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值