如何构建从git克隆的单个boost库? [英] How can I build an individual boost library forked cloned from git?

查看:152
本文介绍了如何构建从git克隆的单个boost库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于"Jam"文件,使用我不熟悉的此构建系统增强功能.现在,我分叉并克隆了一个特定的Boost库( program_options ),我想构建它并可能还会运行测试.我注意到build/Jamfile.v2-我该怎么办?

Boost using this build system I'm not otherwise familiar with, based on "Jam" files. Now, I've forked and cloned a specific Boost library (program_options), and I want to build it and perhaps also run the tests. I notice a build/Jamfile.v2 - what should I do with it?

我在发行版上尝试了apt-get install jam,但这并没有使我走得太远:

I tried apt-get install jam on my distribution, but that did not get me very far:

$ jam -fbuild/Jamfile.v2
warning: unknown rule project
warning: unknown rule boost-lib
don't know how to make all
...found 2 target(s)...
...can't find 1 target(s)...

此外,我是否必须获得所有Boost的绝对最新开发版本才能构建克隆的库,还是可以使用已经拥有的本地boost版本?

Also, do I have to get the absolute latest development version of all of Boost to build the cloned library against, or can I use a local boost release I already have?

注意:

  • 我正在使用最新的GNU/Linux发行版(薄荷18.3,但这无关紧要).

推荐答案

基于@SergeyA和其他人的建议,我所做的是:

What I've done, based on @SergeyA and others' advice, is:

  1. 递归地克隆Boost的全部(请参见此页面(这将创建一个boost/文件夹)
  2. cd boost
  3. .git/modules/my_boost_lib/config中,将原始URL更改为您的fork
  4. .gitmodules[submodule "my_boost_lib"]下的
  5. 中,将URL更改为您的fork
  6. 执行git submodule update --init libs/my_boost_lib/(也许在删除该库之后;不确定是否确实必要)
  7. cd libs/my_boost_lib/build
  8. ../../../b2
  1. Clone all of Boost, recursively (see this page (this will create a boost/ folder )
  2. cd boost
  3. in .git/modules/my_boost_lib/config, change the origin URL to your fork
  4. in .gitmodules, under [submodule "my_boost_lib"], change the URL to your fork
  5. execute git submodule update --init libs/my_boost_lib/ (perhaps after deleting that library; not sure if that's actually necessary)
  6. cd libs/my_boost_lib/build
  7. ../../../b2

后者之所以起作用,是因为b2在其当前工作目录中查找Jamfile.v2,并且该文件存在并且仅用于构建库.构建结果将位于libs/my_boost_lib之外.

The latter works because b2 looks for a Jamfile.v2 in its current working directory, and that file exists and is intended to build just the library. The build results will be located outside of libs/my_boost_lib though.

注意:要构建运行库测试,请使用与libs/my_boost_lib/test相同的方式构建.

Note: To build run the library tests, build the same way but from libs/my_boost_lib/test.

这篇关于如何构建从git克隆的单个boost库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆