8

我正在尝试使用 Boost MPI 运行程序,但问题是我没有 .lib。所以我尝试按照http://www.boost.org/doc/libs/1_43_0/doc/html/mpi/getting_started.html#mpi.config上的说明创建一个

指令说“对于许多使用 LAM/MPI、MPICH 或 OpenMPI 的用户,配置几乎是自动的”,我在 C:\ 中得到了自己的 OpenMPI,但我没有用它做更多的事情。我们需要对它做些什么吗?我还在 Program Files 中找到了自己的 MPICH2,也没有对它做任何事情。在指令的这一点上,我非常不确定我们到底要做什么。

除此之外,指令中的另一条语句:“如果您的主目录中还没有文件 user-config.jam,请将 tools/build/v2/user-config.jam 复制到那里。” 好吧,我只是按照它说的去做。我在 C:\boost_1_43_0> 中找到了自己的“user-config.jam”以及“使用 mpi;” 到文件中。

接下来,这就是我所做的: bjam --with-mpi

C:\boost_1_43_0>bjam --with-mpi
WARNING: No python installation configured and autoconfiguration
         failed.  See http://www.boost.org/libs/python/doc/building.html
         for configuration instructions or pass --without-python to
         suppress this message and silently skip all Boost.Python targets

Building the Boost C++ Libraries.


warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
warning: Unable to construct ./stage-unversioned
warning: Unable to construct ./stage-unversioned

Component configuration:

    - date_time                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - math                     : not building
    - mpi                      : building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : not building
    - test                     : not building
    - thread                   : not building
    - wave                     : not building

...found 1 target...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    C:\boost_1_43_0

The following directory should be added to linker library paths:

    C:\boost_1_43_0\stage\lib


C:\boost_1_43_0>

我看到 C:\boost_1_43_0\stage\lib 中有很多库,但我根本看不到 libboost_mpi-vc100-mt-1_43.lib 或 libboost_mpi-vc100-mt-gd-1_43.lib 的痕迹。这些是在 mpi 应用程序中链接所需的库。

没有构建库时可能会出现什么问题?

4

2 回答 2

14

我怀疑它只是没有读取您的 user-config.jam ...当构建引用并搜索 user-config.jam 时,它会在 %HOME% 位置执行此操作。不在 Boost 源的根目录中,也不在当前目录中。但是您可以使用带有选项的特定 user-config.jam 文件:bjam --user-config=user-config.jam .... 它将仅在当前目录中查找它。或者您也可以指定文件的完整路径。您应该阅读 mpi.jam 工具文件 ( mpi.jam ) 中的注释,因为它解释了在哪些条件下它将自动设置 mpi 工具。mpic++特别是关于在你的路径中的注释。

于 2010-05-23T18:54:58.783 回答
0

我使用以下命令使用 mpi 构建了 boost 1.55: ./bjam link=shared --prefix=/software/boost_1.55 install

vim 工具/build/v2/user-config.jam

-->> 在 user-config.jam 的末尾“使用 mpi ;” (不带引号)

./b2 链接=共享 --prefix=/software/boost_1.55 安装

如果我提供 --with-mpi 我会遇到同样的问题,因此我是这样构建的。

于 2014-05-08T06:16:28.023 回答