在 msvc 2010 中构建 boost MPI 时出错

发布于 2025-01-08 16:30:06 字数 1131 浏览 0 评论 0原文

我已将 openmpi 安装在 C:\Program Files\OpenMPI_v1.5.4-win32\ 中,并希望编译 boost 以生成图形并行库。但出现以下错误:

The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
MPI auto-detection failed: unknown wrapper compiler C:/Program Files/OpenMPI_v1.
5.4-win32/bin/mpic++.exe
Please report this error to the Boost mailing list: http://www.boost.org
You will need to manually configure MPI support.
MPI launcher: mpirun -np

当我在 Visual Studio 2010 命令提示符中运行时:

b2 --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=32 stage --debug-configuration

我在 boost_1_48_0\tools\build\v2\user-config.jam 中添加了 MPI 配置,如下所示:

using mpi : "C:/Program Files/OpenMPI_v1.5.4-win32/bin/mpic++.exe" ;

我相信之前已经问过类似的问题,但得到了没有答案:

如何构建 boost::使用 Visual Studio 2010 在 Windows 上使用 Open MPI 的 mpi 库

I have installed openmpi in C:\Program Files\OpenMPI_v1.5.4-win32\ and want to compile boost to produce graph-parallel library. But got the following error:

The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
MPI auto-detection failed: unknown wrapper compiler C:/Program Files/OpenMPI_v1.
5.4-win32/bin/mpic++.exe
Please report this error to the Boost mailing list: http://www.boost.org
You will need to manually configure MPI support.
MPI launcher: mpirun -np

when I ran in a Visual Studio 2010 command prompt:

b2 --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=32 stage --debug-configuration

I added the MPI config in boost_1_48_0\tools\build\v2\user-config.jam as below:

using mpi : "C:/Program Files/OpenMPI_v1.5.4-win32/bin/mpic++.exe" ;

I believe this similar question has been asked before but got no answer:

How to build boost::mpi library with Open MPI on Windows with Visual Studio 2010

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

惯饮孤独 2025-01-15 16:30:06

如果您不介意,可以使用 MS MPI v6,从此处下载 https://www.microsoft.com/en-us/download/details.aspx?id=47259

然后你需要对 mpi.jam 文件进行一些调整。对于旧版本的boost,mpi.jam位于文件夹tools/build/v2/tools/中,对于新版本的boost,它位于tools/build/src/tools/中。

在第248行左右,需要进行如下调整。由于 MS 将 API 与 HPC 分开。

local win_ms_mpi_sdk = "C:\\Program Files (x86)\\Microsoft SDKs\\MPI" ;
local win_ms_mpi = "C:\\Program Files\\Microsoft MPI" ;

#local cluster_pack_path_native = "C:\\Program Files\\Microsoft Compute Cluster Pack" ;
#local cluster_pack_path = [ path.make $(cluster_pack_path_native) ] ;
if [ GLOB $(win_ms_mpi_sdk)\\Include : mpi.h ]
{
  if $(.debug-configuration)
  {
    ECHO "Found Microsoft Compute Cluster Pack: $(cluster_pack_path_native)" ;
  }

  # Pick up either the 32-bit or 64-bit library, depending on which address
  # model the user has selected. Default to 32-bit.
  options = <include>$(win_ms_mpi_sdk)/Include 
            <address-model>64:<library-path>$(win_ms_mpi_sdk)/Lib/x64
            <library-path>$(win_ms_mpi_sdk)/Lib/x86
            <find-static-library>msmpi
            <toolset>msvc:<define>_SECURE_SCL=0
          ;

  # Setup the "mpirun" equivalent (mpiexec)
  .mpirun = "\"$(win_ms_mpi)\\Bin\\mpiexec.exe"\" ;
  .mpirun_flags = -n ;
}

If you don't mind, you could use the MS MPI v6, downdload from here https://www.microsoft.com/en-us/download/details.aspx?id=47259

Then you need to make some adjustment to the mpi.jam file. For older version of boost, the mpi.jam is in folder tools/build/v2/tools/, and for new version of boost, it is in tools/build/src/tools/.

Around line 248, you need to make the following adjustment. Due to MS separate the API with the HPC.

local win_ms_mpi_sdk = "C:\\Program Files (x86)\\Microsoft SDKs\\MPI" ;
local win_ms_mpi = "C:\\Program Files\\Microsoft MPI" ;

#local cluster_pack_path_native = "C:\\Program Files\\Microsoft Compute Cluster Pack" ;
#local cluster_pack_path = [ path.make $(cluster_pack_path_native) ] ;
if [ GLOB $(win_ms_mpi_sdk)\\Include : mpi.h ]
{
  if $(.debug-configuration)
  {
    ECHO "Found Microsoft Compute Cluster Pack: $(cluster_pack_path_native)" ;
  }

  # Pick up either the 32-bit or 64-bit library, depending on which address
  # model the user has selected. Default to 32-bit.
  options = <include>$(win_ms_mpi_sdk)/Include 
            <address-model>64:<library-path>$(win_ms_mpi_sdk)/Lib/x64
            <library-path>$(win_ms_mpi_sdk)/Lib/x86
            <find-static-library>msmpi
            <toolset>msvc:<define>_SECURE_SCL=0
          ;

  # Setup the "mpirun" equivalent (mpiexec)
  .mpirun = "\"$(win_ms_mpi)\\Bin\\mpiexec.exe"\" ;
  .mpirun_flags = -n ;
}
十级心震 2025-01-15 16:30:06

我也遇到了同样的问题,用Microsoft MPI解决了。我使用 boost 1.61.0 和 Microsoft MPI v7.1(可在 获取https://www.microsoft.com/en-us/download/details.aspx?id=52981)。下载并安装 SDK 和 MsMpi 安装程序。

我对位于 tools/build/src/tools 中的 mpi.jam 文件进行了与 William 提议的相同的更改。

我将该

using mpi ;

命令添加到 user-config.jam 中,该文件应位于您的用户目录中。否则,请转至 tools/build/src 并将其中的 user-config.jam 文件移至您的用户目录中。添加

using mpi : C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec.exe ;

会导致多个错误。首先,.jam 文件中不允许有空格,其次,如果我在没有空格的路径中找到该文件,则会

using mpi : C:\\MicrosoftMPI\\Bin\\mpiexec.exe ;

导致错误报告:mpi.jam 文件已被另一个进程使用。在路径中添加引号也没有帮助。但它可以与 using mpi; 语句一起使用,无需任何添加。

确保 MPI SDK Include、Lib 和 MPI Bin 目录列在路径环境变量中。

下一步是构建 boost.MPI。在 boost 根目录中打开命令提示符,并使用所需的参数和 --with-mpi 调用 bjam。请小心指定variant=debug 或variant=release 标志,否则您将收到名称冲突错误。 (有关详细信息,请参阅此处 http://lists.boost.org/boost- build/2009/12/22854.php)。

这就是为我解决的。

I encountered the same problem and solved it with Microsoft MPI. I use boost 1.61.0 and Microsoft MPI v7.1 (available at https://www.microsoft.com/en-us/download/details.aspx?id=52981). Download and install the SDK and MsMpi Setup.

I made the same changes as William proposed to the mpi.jam file which is located in tools/build/src/tools.

I added the

using mpi ;

command to the user-config.jam, which should be located in your user directory. Otherwise go to tools/build/src and move the user-config.jam file located there into your user directory. Adding

using mpi : C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec.exe ;

leads to multiple errors. First of all, whitespaces are not allowed in the .jam files and second, if i locate the file in a path without whitespaces, like

using mpi : C:\\MicrosoftMPI\\Bin\\mpiexec.exe ;

leads to the error report that the mpi.jam file is already in use by another process. Adding qotation marks to the path does not help either. But it worked with the using mpi; statement, without any additions.

Make sure the MPI SDK Include, Lib and the MPI Bin directory are listed in your path environment variable.

The next step is to build boost.MPI. Open up a command prompt in the boost root directory and invoke bjam with your desired parameters and --with-mpi. Be careful to specify the variant=debug or variant=release flag, since you will get a nameclash error otherwise. (See here for details http://lists.boost.org/boost-build/2009/12/22854.php).

That's what solved it for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文