Visual studio 2010 在msvc 2010中构建boost MPI时出错

Visual studio 2010 在msvc 2010中构建boost MPI时出错,visual-studio-2010,boost,mpi,boost-graph,Visual Studio 2010,Boost,Mpi,Boost Graph,我已经在C:\Program Files\openmpi\U 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 speci

我已经在C:\Program Files\openmpi\U 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\u 1\u 48\u 0\tools\build\v2\user-config.jam中添加了MPI配置,如下所示:

using mpi : "C:/Program Files/OpenMPI_v1.5.4-win32/bin/mpic++.exe" ;
我相信以前也有人问过类似的问题,但没有得到答案:


如果您不介意,您可以从这里下载MS MPI v6

然后需要对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 ;
}
local-win\u-ms\u-mpi\u-sdk=“C:\\Program Files(x86)\\Microsoft sdk\\mpi”;
本地win\u ms\u mpi=“C:\\Program Files\\Microsoft mpi”;
#本地群集\u包\u路径\u native=“C:\\Program Files\\Microsoft Compute cluster pack”;
#本地集群_pack_path=[path.make$(集群_pack_path_native)];
如果[GLOB$(win\u ms\u mpi\u sdk)\\包括:mpi.h]
{
if$(.debug配置)
{
ECHO“找到Microsoft计算群集包:$(群集\u包\u路径\u本机)”;
}
#选择32位或64位库,具体取决于哪个地址
#用户选择的型号。默认为32位。
选项=$(win\u ms\u mpi\u sdk)/包括
64:$(win\u ms\u mpi\u sdk)/Lib/x64
$(win\u ms\u mpi\u sdk)/Lib/x86
msmpi
msvc:_SECURE_SCL=0
;
#设置“mpirun”等效项(mpiexec)
.mpirun=“\”$(win\u ms\u mpi)\\Bin\\mpiexec.exe“\”;
.mpirun_标志=-n;
}

我遇到了同样的问题,并用Microsoft MPI解决了它。我使用boost 1.61.0和Microsoft MPI v7.1(可在上获得)。下载并安装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文件的错误报告。将qotation标记添加到路径也没有帮助。但它使用mpi处理
语句,不添加任何内容

确保在path环境变量中列出MPI SDK Include、Lib和MPI Bin目录

下一步是构建boost.MPI。在boost根目录中打开一个命令提示符,并使用所需的参数和mpi调用bjam。请小心指定variant=debug或variant=release标志,否则会出现nameclash错误。(详见此处)

这就是我解决问题的原因