dseams is the fpm package for the d-SEAMS C API
(libseams, header include/seams.h in
seams-core). It labels ice and
clathrate structures (CHILL, CHILL+) and computes Steinhardt order
parameters, rings, cages, RDFs and related analyses on frames held in
Fortran arrays.
seams is the module programs use. seams_c is the iso_c_binding
image of include/seams.h. Kinds are seams_real (real64) and
seams_int (int32). Coordinates have shape (3, n).
A handle is a derived type. Assignment shares it. The last finalizer,
or close, destroys the C object. Pass stat and errmsg to catch a
failure. Omit both and a failure stops the program with the library
message.
The package links an installed libseams 2.14.1 and does not build it.
From a seams-core checkout at v2.14.1:
meson setup build --prefix="$PREFIX" --libdir=lib
meson install -C buildThat installs libseams.so and seams.pc under $PREFIX/lib.
[dependencies]
dseams = { git = "https://github.com/d-SEAMS/dseams-fortran", tag = "v2.14.1" }fpm needs the library directory on the link line, and the loader needs
it at run time. With seams.pc on PKG_CONFIG_PATH:
export FPM_LDFLAGS="$(pkg-config --libs-only-L seams) -Wl,-rpath,$(pkg-config --variable=libdir seams)"
fpm buildWithout pkg-config, name the directory that holds libseams.so:
export FPM_LDFLAGS="-L$SEAMS_LIB_DIR -Wl,-rpath,$SEAMS_LIB_DIR"A meson install leaves the libraries libseams loads beside it without a
RUNPATH, so also set LD_LIBRARY_PATH="$PREFIX/lib" to run the
programs.
examples/downstream is a project with a path dependency on this one:
$ cd examples/downstream && fpm run
downstream: 8 of 8 waters are cubic iceOMP_NUM_THREADS=1 fpm test
fpm run --example cubic
fpm run --example minimal -- input/traj/genice_sI.lammpstrjfpm test runs check_dseams (the C interface on a cubic cell and ice
Ih, prints dseams fortran ok), capi (every bind(C) procedure,
prints fortran ok) and high (the derived-type API, prints
fortran high ok). lang_tasks binds libseams_lang, the
language-front C ABI installed beside libseams, and prints
pairs 512 rings 0 0 0 0 0 0 256 chill 0 128 0 0 0 0 0 0 0 for ice Ih
(docs/lang/task-fortran.rst). The tests read the trajectories under
input/, copied from seams-core.
meson.build builds the same modules for projects that take this
repository as a subproject, and runs the same programs plus the
single-file build:
meson setup build/meson # finds libseams and libseams_lang through pkg-config
meson test -C build/mesonWhen pkg-config cannot resolve them (for example seams-core.pc names
an eigen3.pc that is not on the path), name the directories instead:
meson setup build/meson -Dseams_libdir="$PREFIX/lib".
A parent project calls subproject('dseams-fortran') and then
dependency('dseams-fortran').
seams.f90 includes every module source in dependency order, for a
build that compiles one file:
gfortran -c seams.f90
gfortran your_program.f90 seams.o -L"$SEAMS_LIB_DIR" -lseams- Site: https://fortran.dseams.info/, the manual with the
FORD symbol pages under
api/generated/. - Engine manual: the Fortran page of docs.dseams.info.
- Video: Fortran on ice Ih.
A push to main builds the manual and deploys it to the site.
The manual has four parts: getting started, the user guide (tutorials and how-tos), the API reference, and development. From this directory:
ford ford.md
sphinx-build -b html docs build/html
python3 docs/assemble_site.py build/html build/fordOpen build/html/index.html. docs/api/fortran.md is the narrative
reference. FORD writes the symbol pages to build/ford, and the
assemble step copies them to build/html/api/generated. The engine
manual is docs.dseams.info.
This repository holds only the Fortran side. The engine, the C API
(libseams, include/seams.h) and the language-front ABI
(libseams_lang) are developed in
d-SEAMS/seams-core; an analysis
or a C API change lands there first and is bound here afterwards.
The contributing guide at the repository root has the full contract.
To build against a local seams-core checkout, build it in place and point both builds at its build tree:
(cd ../seams-core && meson setup bbdir && ninja -C bbdir)
SC=$PWD/../seams-core/bbdir
export FPM_LDFLAGS="-L$SC/src -L$SC/bindings -Wl,-rpath,$SC/src -Wl,-rpath,$SC/bindings"
export LD_LIBRARY_PATH=$SC/src:$SC/bindings
fpm test
meson setup build/meson -Dseams_libdir=$SC/src,$SC/bindings
meson test -C build/mesonCI builds seams-core tag v2.14.1 on d-SEAMS/seams-core, named by
SEAMS_CORE_REPOSITORY and SEAMS_CORE_REF in
.github/workflows/ci.yml.
Releases go in this order:
- seams-core tags
vX.Y.Zon d-SEAMS/seams-core. - This repository moves
SEAMS_CORE_REFto that tag, sets the version infpm.tomlandmeson.build, foldschangelog.d/intoCHANGELOG.mdwithtowncrier build --version X.Y.Z, and tagsvX.Y.Zonce CI passes. - The fpm registry entry from
packaging/fpm/registry.tomlgoes to fortran-lang/fpm-registry, naming that tag.
MIT. See LICENSE.