-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
# SPDX-Identifier: BSD-2-Clause | ||
|
||
from os import environ, listdir, makedirs | ||
from os.path import join, isdir, exists | ||
from sys import argv | ||
from shutil import copy | ||
|
||
if "MESON_INSTALL_DESTDIR_PREFIX" in environ: | ||
install_dir = environ["MESON_INSTALL_DESTDIR_PREFIX"] | ||
else: | ||
install_dir = environ["MESON_INSTALL_PREFIX"] | ||
|
||
include_dir = argv[1] if len(argv) > 1 else "include" | ||
build_dir = argv[2] if len(argv) > 2 else environ["MESON_BUILD_ROOT"] | ||
module_dir = join(install_dir, include_dir) | ||
|
||
modules = [] | ||
for d in listdir(build_dir): | ||
bd = join(build_dir, d) | ||
if isdir(bd): | ||
for f in listdir(bd): | ||
if f.endswith(".mod"): | ||
modules.append(join(bd, f)) | ||
|
||
if not exists(module_dir): | ||
makedirs(module_dir) | ||
|
||
for mod in modules: | ||
print("Installing", mod, "to", module_dir) | ||
copy(mod, module_dir) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# SPDX-Identifier: BSD-2-Clause | ||
|
||
sources_fpp = files( | ||
'module.fpp', | ||
'mpifx_abort.fpp', | ||
'mpifx_allgather.fpp', | ||
'mpifx_allgatherv.fpp', | ||
'mpifx_allreduce.fpp', | ||
'mpifx_barrier.fpp', | ||
'mpifx_bcast.fpp', | ||
'mpifx_comm.fpp', | ||
'mpifx_common.fpp', | ||
'mpifx_constants.fpp', | ||
'mpifx_finalize.fpp', | ||
'mpifx_gather.fpp', | ||
'mpifx_gatherv.fpp', | ||
'mpifx_get_processor_name.fpp', | ||
'mpifx_helper.fpp', | ||
'mpifx_init.fpp', | ||
'mpifx_recv.fpp', | ||
'mpifx_reduce.fpp', | ||
'mpifx_scatter.fpp', | ||
'mpifx_scatterv.fpp', | ||
'mpifx_send.fpp', | ||
) | ||
sources_f90 = [] | ||
foreach src : sources_fpp | ||
sources_f90 += configure_file( | ||
command: ['fypp', '@INPUT@', '@OUTPUT@'], | ||
input: src, | ||
output: '@[email protected]', | ||
) | ||
endforeach | ||
|
||
mpifx_lib = library( | ||
meson.project_name(), | ||
sources: sources_f90, | ||
dependencies: mpi_dep, | ||
install: install, | ||
) | ||
|
||
mpifx_inc = mpifx_lib.private_dir_include() | ||
mpifx_dep = declare_dependency( | ||
link_with: mpifx_lib, | ||
include_directories: mpifx_inc, | ||
dependencies: mpi_dep, | ||
) | ||
|
||
if install | ||
module_id = meson.project_name() | ||
meson.add_install_script( | ||
'../cmake/install-mod.py', | ||
get_option('includedir') / module_id, | ||
meson.current_build_dir(), | ||
) | ||
|
||
pkg = import('pkgconfig') | ||
pkg.generate( | ||
mpifx_lib, | ||
description: 'Modern Fortran Interface for MPI', | ||
subdirs: ['', module_id], | ||
) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# SPDX-Identifier: BSD-2-Clause | ||
|
||
project( | ||
'mpifx', | ||
'Fortran', | ||
version: files('VERSION'), | ||
license: 'BSD-2-Clause', | ||
meson_version: '>=0.57.2', | ||
default_options: [ | ||
'buildtype=debugoptimized', | ||
'default_library=both', | ||
], | ||
) | ||
install = not (meson.is_subproject() and get_option('default_library') == 'static') | ||
|
||
# Prerequisites | ||
mpi_dep = dependency('mpi', language: 'fortran') | ||
fypp = find_program('fypp') | ||
|
||
# Build instructions | ||
subdir('lib') | ||
|
||
mpifx_lic = files('LICENSE') | ||
|
||
if install | ||
install_data( | ||
mpifx_lic, | ||
install_dir: get_option('datadir')/'licenses'/meson.project_name() | ||
) | ||
endif | ||
|
||
subdir('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-Identifier: BSD-2-Clause | ||
|
||
tests = [ | ||
'allgather', | ||
'allgatherv', | ||
'allreduce', | ||
'bcast', | ||
'comm_split', | ||
'gather', | ||
'gatherv', | ||
'reduce', | ||
'scatter', | ||
'scatterv', | ||
] | ||
|
||
foreach t : tests | ||
executable( | ||
'test_@0@'.format(t), | ||
sources: files('test_@[email protected]'.format(t)), | ||
dependencies: mpifx_dep, | ||
) | ||
endforeach |