summaryrefslogtreecommitdiff
path: root/test cases/frameworks/17 mpi/meson.build
blob: 17acd713d8372e7e07e3b066b2f72c360a8594f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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',
  dependencies : [mpic])

test('MPI C', exec)

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)
endif

# OpenMPI is broken with Fortran on Ubuntu Artful.
# Remove this once the following bug has been fixed:
#
# https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1727474

ubudetector = find_program('is_artful.py')
uburesult = run_command(ubudetector)

if uburesult.returncode() != 0 and add_languages('fortran', required : false)
  mpifort = dependency('mpi', language : 'fortran')
  exef = executable('exef',
    'main.f90',
    dependencies : [mpifort])

  test('MPI Fortran', exef)
endif