2012-02-24 33 views
1

我在C:\ Program Files \ OpenMPI_v1.5.4-win32 \中安装了openmpi,并且想编译boost以生成图形并行库。但得到了以下错误:在msvc 2010中构建boost MPI的错误

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 \工具MPI配置\建立\ V2 \用户config.jam中如下图所示:

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

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

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

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

我加入了

using mpi ; 

命令将用户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标志,否则将会出现nameclash错误。 (详情请参阅这里http://lists.boost.org/boost-build/2009/12/22854.php)。

这就是为我解决它。