如何构建从git克隆的单个boost库? [英] How can I build an individual boost library forked cloned from git?
问题描述
基于"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:
- 递归地克隆Boost的全部(请参见此页面(这将创建一个
boost/
文件夹) -
cd boost
- 在
.git/modules/my_boost_lib/config
中,将原始URL更改为您的fork
在 - 中,将URL更改为您的fork
- 执行
git submodule update --init libs/my_boost_lib/
(也许在删除该库之后;不确定是否确实必要) -
cd libs/my_boost_lib/build
-
../../../b2
.gitmodules
中[submodule "my_boost_lib"]
下的- Clone all of Boost, recursively (see this page (this will create a
boost/
folder ) cd boost
- in
.git/modules/my_boost_lib/config
, change the origin URL to your fork - in
.gitmodules
, under[submodule "my_boost_lib"]
, change the URL to your fork - execute
git submodule update --init libs/my_boost_lib/
(perhaps after deleting that library; not sure if that's actually necessary) cd libs/my_boost_lib/build
../../../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屋!