MPI: don't excessively skip Windows test cases, which can hide real problems
This commit is contained in:
parent
88e77e69bc
commit
89ced3fe58
|
@ -1,4 +1,5 @@
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
project('mpi', 'c', 'cpp', default_options: ['b_asneeded=false'])
|
project('mpi', 'c', 'cpp', default_options: ['b_asneeded=false'])
|
||||||
|
|
||||||
cc = meson.get_compiler('c')
|
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', required : false)
|
mpic = dependency('mpi', language : 'c', required : false)
|
||||||
if not mpic.found()
|
if not mpic.found()
|
||||||
error('MESON_SKIP_TEST: MPI not found, skipping.')
|
error('MESON_SKIP_TEST: MPI not found, skipping.')
|
||||||
|
@ -14,31 +9,41 @@ exec = executable('exec',
|
||||||
'main.c',
|
'main.c',
|
||||||
dependencies : [mpic])
|
dependencies : [mpic])
|
||||||
|
|
||||||
test('MPI C', exec)
|
test('MPI C', exec, timeout: 10)
|
||||||
|
|
||||||
if build_machine.system() != 'windows'
|
|
||||||
# C++ MPI not supported by MS-MPI
|
# C++ MPI not supported by MS-MPI
|
||||||
mpicpp = dependency('mpi', language : 'cpp')
|
cpp = meson.get_compiler('cpp')
|
||||||
execpp = executable('execpp',
|
mpicpp = dependency('mpi', language : 'cpp', required: false)
|
||||||
|
if not cpp.links('''
|
||||||
|
#include <mpi.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
int main(int argc, char **argv) {MPI::Init(argc, argv);}
|
||||||
|
''', dependencies: mpicpp, name: 'C++ MPI')
|
||||||
|
mpicpp = disabler()
|
||||||
|
endif
|
||||||
|
execpp = executable('execpp',
|
||||||
'main.cpp',
|
'main.cpp',
|
||||||
dependencies : [mpicpp])
|
dependencies : [mpicpp])
|
||||||
|
|
||||||
test('MPI C++', execpp)
|
test('MPI C++', execpp, timeout: 10)
|
||||||
endif
|
|
||||||
|
|
||||||
# One of few feasible ways to use MPI for Fortran on Windows is via Intel compilers.
|
|
||||||
if build_machine.system() != 'windows' or cc.get_id() == 'intel'
|
if add_languages('fortran', required : false)
|
||||||
if add_languages('fortran', required : false)
|
fc = meson.get_compiler('fortran')
|
||||||
mpifort = dependency('mpi', language : 'fortran')
|
mpif = dependency('mpi', language : 'fortran', required: false)
|
||||||
|
if not fc.links('use mpi; end', dependencies: mpif, name: 'Fortran MPI')
|
||||||
|
mpif = disabler()
|
||||||
|
endif
|
||||||
|
|
||||||
exef = executable('exef',
|
exef = executable('exef',
|
||||||
'main.f90',
|
'main.f90',
|
||||||
dependencies : [mpifort])
|
dependencies : mpif)
|
||||||
|
|
||||||
test('MPI Fortran', exef)
|
test('MPI Fortran', exef, timeout: 10)
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Check we can apply a version constraint
|
# Check we can apply a version constraint
|
||||||
if mpic.version() != 'unknown'
|
if mpic.version() != 'unknown'
|
||||||
dependency('mpi', version: '>=@0@'.format(mpic.version()))
|
dependency('mpi', version: '>=@0@'.format(mpic.version()))
|
||||||
|
|
Loading…
Reference in New Issue