Add support for MS-MPI.

pull/1895/head
Elliott Sales de Andrade 8 years ago
parent 271601124e
commit 4cbfb9a08d
  1. 11
      .appveyor.yml
  2. 35
      mesonbuild/dependencies/misc.py
  3. 19
      test cases/common/157 mpi/meson.build

@ -76,6 +76,17 @@ install:
- ps: If($Env:compiler -eq 'msys2-mingw') {(new-object Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:\projects\meson\get-pip.py')}
- cmd: if %compiler%==msys2-mingw ( %PYTHON% "C:\projects\meson\get-pip.py" )
- cmd: if %compiler%==cygwin ( call ci\appveyor-install.bat )
- ps: |
If($Env:compiler -like 'msvc*') {
(new-object net.webclient).DownloadFile(
"https://download.microsoft.com/download/D/B/B/DBB64BA1-7B51-43DB-8BF1-D1FB45EACF7A/msmpisdk.msi",
"C:\projects\msmpisdk.msi")
c:\windows\system32\msiexec.exe /i C:\projects\msmpisdk.msi /quiet
(new-object net.webclient).DownloadFile(
"https://download.microsoft.com/download/D/B/B/DBB64BA1-7B51-43DB-8BF1-D1FB45EACF7A/MSMpiSetup.exe",
"C:\projects\MSMpiSetup.exe")
c:\projects\MSMpiSetup.exe -unattend -full
}
# Install additional packages needed for all builds.
- cmd: "%WRAPPER% %PYTHON% -m pip install codecov"

@ -342,6 +342,12 @@ class MPIDependency(ExternalDependency):
self.link_args = self._filter_link_args(result[2])
break
if not self.is_found and mesonlib.is_windows():
result = self._try_msmpi()
if result is not None:
self.is_found = True
self.version, self.compile_args, self.link_args = result
if self.is_found:
mlog.log('Dependency', mlog.bold(self.name), 'for', self.language, 'found:', mlog.green('YES'), self.version)
else:
@ -447,6 +453,35 @@ class MPIDependency(ExternalDependency):
return version, args, args
def _try_msmpi(self):
if self.language == 'cpp':
# MS-MPI does not support the C++ version of MPI, only the standard C API.
return
if 'MSMPI_INC' not in os.environ:
return
incdir = os.environ['MSMPI_INC']
arch = detect_cpu_family(self.env.coredata.compilers)
if arch == 'x86':
if 'MSMPI_LIB32' not in os.environ:
return
libdir = os.environ['MSMPI_LIB32']
post = 'x86'
elif arch == 'x86_64':
if 'MSMPI_LIB64' not in os.environ:
return
libdir = os.environ['MSMPI_LIB64']
post = 'x64'
else:
return
if self.language == 'fortran':
return ('none',
['-I' + incdir, '-I' + os.path.join(incdir, post)],
[os.path.join(libdir, 'msmpi.lib'), os.path.join(libdir, 'msmpifec.lib')])
else:
return ('none',
['-I' + incdir, '-I' + os.path.join(incdir, post)],
[os.path.join(libdir, 'msmpi.lib')])
class ThreadDependency(ExternalDependency):
def __init__(self, environment, kwargs):

@ -1,5 +1,11 @@
project('mpi', 'c', 'cpp')
cc = meson.get_compiler('c')
if build_machine.system() == 'windows' and cc.get_id() != 'msvc'
error('MESON_SKIP_TEST: MPI not available on Windows without MSVC.')
endif
mpic = dependency('mpi', language : 'c')
exec = executable('exec',
'main.c',
@ -7,12 +13,15 @@ exec = executable('exec',
test('MPI C', exec)
mpicpp = dependency('mpi', language : 'cpp')
execpp = executable('execpp',
'main.cpp',
dependencies : [mpicpp])
if build_machine.system() != 'windows'
# C++ MPI not supported by MS-MPI used on AppVeyor.
mpicpp = dependency('mpi', language : 'cpp')
execpp = executable('execpp',
'main.cpp',
dependencies : [mpicpp])
test('MPI C++', execpp)
test('MPI C++', execpp)
endif
if add_languages('fortran', required : false)
mpifort = dependency('mpi', language : 'fortran')

Loading…
Cancel
Save