带有Boost库的C ++的Drone.io配置

时间:2014-02-05 13:44:24

标签: c++ continuous-integration

我想配置drone.io来自动测试我的C ++项目。不幸的是,每次构建失败,因为SCons找不到我刚刚安装的头文件。我从这开始:

sudo apt-get install g++ bison flex libgmp-dev glpk libboost-all-dev scons
echo 2 | sudo update-alternatives --config gcc
scons -Q runProgramsTests

但每次build failed都有一条消息:

$ scons -Q runProgramsTests
Your environment does not seem to have header <boost/container/map.hpp>!!
Your environment does not seem to have header <boost/container/set.hpp>!!
Your environment does not seem to have header <boost/container/vector.hpp>!!
Invalid compiler/libraries installation - build terminated!!

负责此消息的构建脚本部分如下所示:

# Assuming that instalation is valid unless proved otherwise
validInstallation = True

conf = Configure(env)

# C++ check
if not conf.CheckCXX():
    print('Your environment/C++ compiler is not configured/installed correctly!!')
    validInstallation = False

# Header check
for header in [
    # standard libraries
    'algorithm', 'cstdlib', 'iomanip',
    'iostream',  'fstream', 'sstream',
    'memory',
    'stdexcept', 'string',  'utility',
    # boost libraries
    'boost/scoped_ptr.hpp',
    'boost/shared_ptr.hpp',
    'boost/weak_ptr.hpp',
    'boost/algorithm/string.hpp',
    'boost/assign.hpp',
    'boost/bimap/bimap.hpp',
    'boost/container/map.hpp',
    'boost/container/set.hpp',
    'boost/container/vector.hpp',
    'boost/program_options.hpp',
    'boost/range/adaptor/map.hpp',
    'boost/range/adaptor/reversed.hpp',
    # Flex library
    'FlexLexer.h',
    # GNU Multiple Precision library
    'gmpxx.h',
    # GNU Linear Package Kit
    'glpk.h'
]:
    if not conf.CheckCXXHeader(header):
        print('Your environment does not seem to have header <'+header+'>!!')
        validInstallation = False

如果重要,可以找到整个SConstruct内容here

我不明白为什么会找到一些Boost包,而有些则没有。在droid.io页面上,我发现项目产生的归档工件不能超过10MB的信息 - 但是没有关于已安装库限制的信息。

在调用sudo ldconfig之前运行scons没有帮助,因此没有帮助手动设置环境变量:

C_INCLUDE_PATH=/usr/include
CPLUS_INCLUDE_PATH=/usr/include

我错过了什么吗?毕竟我安装了libboost-all-dev,其中应包含所有Boost库和标题。

1 个答案:

答案 0 :(得分:0)

最后找出原因:drone.io使用旧版本的Ubuntu(精确版)默认使用Boost库版本1.46,而在1.48版本中添加了Boost.Container包。

将设置修改为:

sudo apt-get install bison flex glpk libboost1.48-all-dev
echo 2 | sudo update-alternatives --config gcc
scons -Q runProgramsTests

一切都按预期工作。