diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-07-26 02:38:23 -0400 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-08-04 20:07:08 -0400 |
commit | 4cbfb9a08dd8b89aaec7fffd4efbe3a542a67a3d (patch) | |
tree | 41a19688fc4fc5876b45973be2df534f11cf8374 | |
parent | 271601124e22695bfa0b0791543473b7164948b1 (diff) | |
download | meson-4cbfb9a08dd8b89aaec7fffd4efbe3a542a67a3d.zip meson-4cbfb9a08dd8b89aaec7fffd4efbe3a542a67a3d.tar.gz meson-4cbfb9a08dd8b89aaec7fffd4efbe3a542a67a3d.tar.bz2 |
Add support for MS-MPI.
-rw-r--r-- | .appveyor.yml | 11 | ||||
-rw-r--r-- | mesonbuild/dependencies/misc.py | 35 | ||||
-rw-r--r-- | test cases/common/157 mpi/meson.build | 19 |
3 files changed, 60 insertions, 5 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 6551445..77d00af 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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" diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 4773f2f..f5cbb96 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -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): diff --git a/test cases/common/157 mpi/meson.build b/test cases/common/157 mpi/meson.build index f36b039..5e9bc56 100644 --- a/test cases/common/157 mpi/meson.build +++ b/test cases/common/157 mpi/meson.build @@ -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') |