在msvc 2010中构建boost MPI时出错

时间:2012-02-24 15:28:19

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

我在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

2 个答案:

答案 0 :(得分: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 ;
}

答案 1 :(得分:1)

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

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

我添加了

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标记也无济于事。但它与using mpi;语句一起使用,没有添加任何内容。

确保路径环境变量中列出了MPI SDK Include,Lib和MPI Bin目录。

下一步是构建boost.MPI。在boost根目录中打开命令提示符,并使用所需参数和--with-mpi调用bjam。请注意指定variant = debug或variant = release标志,否则会收到nameclash错误。 (详见http://lists.boost.org/boost-build/2009/12/22854.php)。

这就是为我解决的问题。

相关问题