Boost bjam 与 GNU make
我是 Boost C++ 库的新手。 我想知道 Boost bjam 相对于 GNU make 是否有任何优势? 如果我使用 make 来利用 Boost.Python 库构建 C++ 代码,有什么缺点?
I am a newbie to Boost C++ libraries. I was wondering if there are any advantages of Boost bjam over GNU make? And what are the cons if I use make for building C++ code utilizing Boost.Python libraries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
到目前为止,对于构建 boost 本身,bjam 是最佳选择。 只需按照自述文件构建命令行即可。 您可能(应该)只需在每个增强版本中执行一次。
但是,没有必要将您自己使用 boost 的项目与 boost 的构建系统联系起来。
使用 gmake 构建使用 Boost.Python 的 C++ 代码没有什么特别的缺点,优点是有大量使用 gmake 的示例。
For building boost itself, bjam is the way to go, by far. Just follow the readme and construct the command line. You may (should) only have to do it once per boost release.
But, there's no need whatever to tie your own project that uses boost to boost's build-system.
There are no particular cons to using gmake to build C++ code that uses Boost.Python, and the pro is that there are plenty of examples of using gmake around.
如果您打算使用其他 Boost 库,那么使用 bjam 可能是有意义的,但是,从简单的角度来看,对于复杂的项目来说,make 的使用非常复杂,这就是开发 ant 的原因。
Bjam 扩展了其他最初尝试取代 make 的项目。
但是,缺点是,每个 UNIX 操作系统上都可以找到 make,而 bjam 则不然,但是,如果您必须在项目中使用 Boost 库,那么您可以确保包含它。
对于你的项目,我认为 bjam 可能是最好的选择,但如果你正在编写一个其他人需要使用 ANSI C++ 编译的可移植项目,那么我建议也支持 GNU Make。
If you are going to use other Boost libraries then using bjam may make sense, but, from a simple point of view, make is very complicated to work with, for a complex project, which is why ant, for example was developed.
Bjam extends other projects that started with trying to replace make.
But, on the downside, make is found on every unix OS, bjam isn't, but, if you have to use Boost libraries for your project then you can make certain it is included.
For your project I think bjam may be the best option, but if you were writing a portable project that others would need to compile, using ANSI C++, then I would suggest also supporting GNU Make.
我使用 Make 和 BJam 构建了团队共享构建框架。
我的最终意见是,一旦我了解了基本设置,bjam 实现就更容易维护。 团队成员一开始可能会抗拒,但一旦他们使用它并发现它比 Make 简单得多(我的观点),他们就会被说服。 有些人会继续抵制。 您可以设置双构建系统,但这是额外的工作。
当我被迫使用 Make 时,我会使用中心规则集创建非递归 makefile 解决方案。 BJam 内置了这一切。
I've built team shared build frameworks using Make and BJam.
My final opinion was that the bjam implementation was easier to maintain, once I learned the basic setup. Team members may be resistant at first, but once they use it and see how it is far simpler than Make (my opinion), they are won over. Some will continue to resist. You can set up dual build systems, but that is extra effort.
When I am forced to use Make, I create non-recursive makefile solutions with central rule sets. BJam has all this built in.