【问题标题】:Error in building boost MPI in msvc 2010在 msvc 2010 中构建 boost MPI 时出错
【发布时间】:2012-03-15 01:18:14
【问题描述】:

我已经在 C:\Program Files\OpenMPI_v1.5.4-win32\ 中安装了 openmpi,并想编译 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" ;

我相信以前有人问过类似的问题,但没有得到答案:

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

【问题讨论】:

    标签: visual-studio-2010 boost mpi boost-graph


    【解决方案1】:

    我遇到了同样的问题,并用 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)。

    这就是为我解决的问题。

    【讨论】:

      【解决方案2】:

      如果你不介意,你可以使用 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 ;
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-20
        • 2012-03-12
        • 1970-01-01
        • 1970-01-01
        • 2010-09-22
        • 1970-01-01
        • 2018-11-26
        • 2018-07-26
        相关资源
        最近更新 更多