2019-06-21 13:24:54 +08:00
|
|
|
project('Fortran coarray', 'fortran',
|
|
|
|
meson_version: '>=0.50')
|
2019-02-14 03:09:18 +08:00
|
|
|
|
2019-07-29 13:00:04 +08:00
|
|
|
fc = meson.get_compiler('fortran')
|
|
|
|
|
2019-11-17 14:37:26 +08:00
|
|
|
if ['pgi', 'flang'].contains(fc.get_id())
|
|
|
|
error('MESON_SKIP_TEST: At least through PGI 19.10 and Flang 7.1 do not support Fortran Coarrays.')
|
2019-07-29 13:00:04 +08:00
|
|
|
endif
|
|
|
|
|
2019-02-14 03:09:18 +08:00
|
|
|
# coarray is required because single-image fallback is an intrinsic feature
|
2019-08-24 07:33:54 +08:00
|
|
|
coarray = dependency('coarray')
|
|
|
|
|
|
|
|
# check coarray, because user might not have all the library stack installed correctly
|
|
|
|
# for example, conflicting library/compiler versions on PATH
|
|
|
|
# this has to invoke a run of "sync all" to verify the MPI stack is functioning,
|
|
|
|
# particularly for dynamic linking
|
2019-11-17 14:37:26 +08:00
|
|
|
if fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() != 0
|
2019-12-19 13:29:49 +08:00
|
|
|
error('MESON_SKIP_TEST: coarray stack (including MPI) did not link correctly so that a simple test could run.')
|
2019-08-24 07:33:54 +08:00
|
|
|
endif
|
2019-02-14 03:09:18 +08:00
|
|
|
|
|
|
|
exe = executable('hello', 'main.f90',
|
|
|
|
dependencies : coarray)
|
|
|
|
|
2019-11-17 14:37:26 +08:00
|
|
|
test('Coarray hello world', exe, timeout: 10)
|