| 1 |
project('Fortran coarray', 'fortran', |
| 2 |
meson_version: '>=0.50') |
| 3 |
|
| 4 |
fc = meson.get_compiler('fortran') |
| 5 |
|
| 6 |
if ['pgi', 'flang'].contains(fc.get_id()) |
| 7 |
error('MESON_SKIP_TEST: At least through PGI 19.10 and Flang 7.1 do not support Fortran Coarrays.') |
| 8 |
endif |
| 9 |
|
| 10 |
# coarray is required because single-image fallback is an intrinsic feature |
| 11 |
coarray = dependency('coarray') |
| 12 |
|
| 13 |
# check coarray, because user might not have all the library stack installed correctly |
| 14 |
# for example, conflicting library/compiler versions on PATH |
| 15 |
# this has to invoke a run of "sync all" to verify the MPI stack is functioning, |
| 16 |
# particularly for dynamic linking |
| 17 |
if fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() != 0 |
| 18 |
error('MESON_SKIP_TEST: coarray stack (including MPI) did not link correctly so that a simple test could run.') |
| 19 |
endif |
| 20 |
|
| 21 |
exe = executable('hello', 'main.f90', |
| 22 |
dependencies : coarray) |
| 23 |
|
| 24 |
test('Coarray hello world', exe, timeout: 10) |