如何编译Boost.Process库?
所以就有了 Boost.Process 2006、Boost.Process 2008 和最新的 Boost.Process 通过查看来源看起来像是 2009 年) 我需要某种关于如何进行的逐步指导编译那个野兽。因为我确实不知道如何做这样的事情。
因此,对于一般官方 Boost,我了解应该做什么
没有管理权限:
- 下载最新的 Boost 版本。
- 解压,将下载的内容提取到某个文件夹中。
- 在终端中打开该文件夹(例如,您可以使用
cd Absolute/path/to/directory/with/extracted/Boost
这样的命令打开“cmd”或“terminal”,而不是使用命令显示文件夹内容Unix 上的ls
(Mac、Linux)和 Windows 上的dir
- 在输出中您应该能够找到boost-build.jam
) - 创建两个文件夹(使用类似命令
mkdir
文件夹名称 )build-dir
和install-dir
- 运行命令
./booststrap
(Windows 上的booststrap.sh
或booststrap.bat
) - 现在我们可以编译 Boost 并使用
安装它。/bjam -j4 link=static threading=single,multi --builddir=./build-dir 安装 --without-mpi --prefix=./install-dir
- 这样的调用会将Boost的静态库编译到
build-dir
中。 (您可能无法从那里使用 Boost - 不会有包含标头和非常大的目录层次结构) - bjam 将为我们创建 Boost 到
install-dir
的“安装” - 将会出现包含所有 boost 库(静态版本)的文件夹,并包含包含所有内容的文件夹boost 标头。 - 我们设置 -j4 标志在 4 核上编译。使用 -j
N
,其中N
是编译过程中要使用的所需核心数量。 - 我们设置了
--without-mpi
标志,因为我们可能不使用它。
- 这样的调用会将Boost的静态库编译到
但是,将 Real Boost 解压、编译、安装在目录 A 中(bjam 位于文件夹 B 中),将 Boost.Process 下载、解压并提取到文件夹 C,如何编译这 3 个 Boost.Process 版本中的任何一个(没有管理权限)?
So there is Boost.Process 2006, Boost.Process 2008 and most recent Boost.Process seems like 2009 by looking at sources) I need some kind of step by step guidance on how to compile that beast. Because I deffenetly do not get how to do such thing.
So For generall official Boost I understand what shall be done
With out administration privileges:
- Download latest Boost release.
- Unpack, extract downloaded content into some folder.
- Open that folder in terminal (for example you ca open 'cmd' or 'terminal' an use command like
cd absolute/path/to/directory/with/extracted/Boost
than use command to show folder contentsls
on Unix like OS (Mac, Linux) anddir
on Windows - in output you should be capable to findboost-build.jam
) - Create two folders (using command like
mkdir
foldername )build-dir
andinstall-dir
- run command
./booststrap
(booststrap.sh
orbooststrap.bat
on windows) - now we can compile Boost and install it with
./bjam -j4 link=static threading=single,multi --builddir=./build-dir install --without-mpi --prefix=./install-dir
- Such call will compile static libraries of Boost into
build-dir
. (you probably will not be capable to use Boost out from there - there will be no includes headers and a really big directories hierarchy ) - Than bjam will create for us "installation" of Boost into
install-dir
- there will appear folder with all boost libs (static version) and includes folder with all of boost headers. - We set -j4 flag to compile on 4 cores. use -j
N
whereN
is number of desired cores to be used during compilation process. - We set
--without-mpi
flag because we probably do not use it.
- Such call will compile static libraries of Boost into
But having Real Boost unpacked, compiled, installed in dir A (bjam is in folder B ) Having Boost.Process Download , Unpacked and Extracted to folder C how to compile any of that 3 Boost.Process releases (with out administration privileges)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我这样做了一两次,这是我记得的:
从沙箱下载 boost libs 例如后,将 lib 解压到驱动器上,就像您所说的文件夹 C 一样。如果您打开 C 文件夹,它通常具有与以下相同的文件夹结构其余的升压源。至少在我尝试过的有限库中是这样的。
从那里将提取的源文件夹中的各个文件和文件夹复制到 boost 源中的相应文件夹中。
例如,在流程的情况下
- 将 C/boost/process.hpp 和 C/boost/process/ 复制到 boost_src_dir/boost/
- 将 C/libs/process/ 复制到 boost_src_dir/libs/。
从那里再次在 boost 根目录中执行 bjam (假设 bjam 可执行文件位于您的路径上),在我的情况下,它构建了包括新库在内的所有内容。我记得用升压日志和进程来完成此操作,并且想不出必须做任何其他事情。
这样做的缺点是所有内容都会重新编译。也许其他人有更好的方法来做到这一点。
至于管理员权限,它们应该不重要,因为您正在以与构建原始版本相同的方式构建 boost。
I did this once or twice and here's what I remember:
After downloading boost libs e.g. from the sandbox, unpack the lib onto the drive like you said e.g to folder C. If you open the C folder, it generally has the same folder structure as the rest of the boost source. At least this was the case in the limited libraries I tried.
From there copy the individual files and folders inside the extracted source folder into the corresponding folders in the boost source.
E.g. in the case of process
- copy C/boost/process.hpp and C/boost/process/ to boost_src_dir/boost/
- copy C/libs/process/ to boost_src_dir/libs/.
From there execute bjam (assuming the bjam executable is on your path) again in the boost root and that in my cases built everything including the new library. I remember doing this with boost log and process and can't think of having to do anything else.
The downside to doing this is that everything gets recompiled. Perhaps someone else has a better method of doing this.
As for the admin priviledges, they shouldn't matter since you're building boost in the same manner that you built the original version.