【问题标题】:How to install boost on Linux with custom location of gcc?如何使用 gcc 的自定义位置在 Linux 上安装 boost?
【发布时间】:2011-11-06 15:00:46
【问题描述】:

我的 gcc 编译器位于自定义位置 /my/path/hpgcc

我已经下载了增强源。执行了 bootstrap.sh,但是因为默认 gcc 运行而失败。

查看它,我发现它做的第一件事就失败了:构建 Boost.Build 引擎:

gcc -o bootstrap/jam0 command.c compile.c debug.c expand.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c

(失败,因为使用默认 gcc 执行,而不是我的 gcc 版本)。

我尝试更改 user-config.jam 文件中的 gcc 路径,但没有帮助。可能是因为 Boost.Build 的构建脚本 boost_1_47_0/tools/build/v2/engine/build.sh 没有使用 user-config.jam,只使用了默认位置。

有什么办法吗?

【问题讨论】:

  • 这真的无法产生有效的 bjam 吗?您可以使用与您用于编译 boost 的工具集不同的工具集来构建 boost.build。
  • 作为黑客,您可以修改您的$PATH,或编辑boost_1_47_0/tools/build/v2/engine/build.sh
  • Mankarse:如何使用我的编译器构建 boost.build?
  • 为什么要使用你的特殊编译器来构建 boost.build?
  • Mankrase:正如你所建议的,我编辑了 boost_1_47_0/tools/build/v2/engine/build.sh 并解决了问题。谢谢!

标签: linux gcc boost build installation


【解决方案1】:

我们通过简单地定义 PATH 和 LD_LIBRARY_PATH 环境变量来在我们的构建环境中执行此操作,以首先获取我们所需的 GCC。

【讨论】:

    【解决方案2】:

    添加行:

    using gcc : : /my/path/hpgcc ;
    

    user-config.jamuser-config.jam 通常在 /path/to/boost/tools/build/v2/ 中,但您可以将自定义 user-config.jamsite-config.jam 放在列出的任何位置 here

    /my/path/hpgcc 应该是 g++ 可执行文件的完整路径。


    编辑(Igor Oks):最终解决问题的是我编辑了 boost_1_47_0/tools/build/v2/engine/build.sh 以使其使用我的自定义 gcc。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-19
      • 2015-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多