Opened 11 years ago

Last modified 9 years ago

#5864 new Bugs

unable to compile boost::mpi under Windows using msvc-2008-compiller

Reported by: Slav Grig <armagvvg@…> Owned by: Douglas Gregor
Milestone: To Be Determined Component: mpi
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

My steps to reproduce:

  1. Setup environment for msvc-2008 compiler using bat-file for Visual Studio 2008 command line environment.
  2. Compile library openmpi-1.4.3 using cmake (as specified in its documentation) and install it to "d:\Libs\mpi-1.4.3\Release".
  3. Add path to "d:\Libs\mpi-1.4.3\Release\bin" to my PATH environment.
  4. Check, that mpic++ works good:
    > mpic++ --showme
    cl.exe /I"d:/Libs/mpi-1.4.3/Release/include" /TP /EHsc /D "OMPI_IMPORTS" /D "OPAL_IMPORTS" /D "ORTE_IMPORTS" /link /LIBPATH:"d:/Libs/mpi-1.4.3/Release/lib" libmpi.lib libopen-pal.lib libopenrte.lib libmpi_cxx.lib libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib
    
  5. Add string 'using mpi ;' to my <boost_dir>\tools\build\v2\user-config.jam file.
  6. Try to compile boost::mpi:
    > bjam.exe --prefix=d:\Programming\mpi-work\boost-mpi\installed --build-dir=d:\Programming\mpi-work\boost-mpi\bld --with-mpi install
    

As a result I got the error:

Системе не удается найти указанный путь.
Системе не удается найти указанный путь.
Системе не удается найти указанный путь.
Системе не удается найти указанный путь.
MPI auto-detection failed: unknown wrapper compiler mpic++
Please report this error to the Boost mailing list: http://www.boost.org
You will need to manually configure MPI support.

('Системе не удается найти указанный путь.' - means 'System can't find specified path')

The same result I got using b2.exe instead of bjam.exe.

I tried to read the documentation to setup exact paths to openmpi for mpi module in the user-config.jam. But I couldn't understand, where should I put include- and library-paths in it.

My environment - Windows XP SP2 x32, Visual Studio 2008 with compiler version 15.00.21022.08. I have attached partial command line environment as file to the bug report.

Attachments (4)

env.txt (2.0 KB ) - added by Slav Grig <armagvvg@…> 11 years ago.
Partial console environment
mpi-windows-build.patch (733 bytes ) - added by Taras Kozlov 9 years ago.
Fix build on windows
mpi-windows-build2.patch (717 bytes ) - added by Taras Kozlov 9 years ago.
Fix build on windows
mpi-windows-build3.patch (1.6 KB ) - added by Taras Kozlov 9 years ago.
Fix build on windows

Download all attachments as: .zip

Change History (7)

by Slav Grig <armagvvg@…>, 11 years ago

Attachment: env.txt added

Partial console environment

by Taras Kozlov, 9 years ago

Attachment: mpi-windows-build.patch added

Fix build on windows

comment:1 by Taras Kozlov, 9 years ago

After digging into mpi.jam I found what is the root of the problem.

# Determine if it is safe to execute the given shell command by trying
# to execute it and determining whether the exit code is zero or
# not. Returns true for an exit code of zero, false otherwise.
local rule safe-shell-command ( cmdline )
{
  local result = [ SHELL "$(cmdline) > /dev/null 2>/dev/null; if [ "$?" -eq "0" ]; then echo SSCOK; fi" ] ;
  return [ MATCH ".*(SSCOK).*" : $(result) ] ;
}

It silently always return false on windows, because this is not correct cmd.exe command. I have attached patch that made windows specific workaround.

by Taras Kozlov, 9 years ago

Attachment: mpi-windows-build2.patch added

Fix build on windows

comment:2 by anonymous, 9 years ago

Please use mpi-windows-build2.patch I have accidentally attached incorrect one.

by Taras Kozlov, 9 years ago

Attachment: mpi-windows-build3.patch added

Fix build on windows

comment:3 by Taras Kozlov, 9 years ago

msvc.link.dll bin.v2\libs\mpi\build\msvc-10.0\debug\threading-multi\boost_mpi-vc
100-mt-gd-1_53.dll
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'
Note: See TracTickets for help on using tickets.