trexio_ocaml is the OCaml binding for the TREXIO file format and C library for wave functions and quantum-chemistry integrals.
One OPAM record: trexio (the binding: C stubs over the TREXIO C library).
opam install trexio works out of the box: a system TREXIO visible to pkg-config (API >= 2.6.1) is used if present; otherwise the record builds the vendored external/trexio-<Ctag>.tar.gz statically, offline — into ./_c-prefix during build: and into the opam switch during install:.
Binding version A.B.CNN = TREXIO release A.B.C + binding revision NN (e.g. 2.6.101 = TREXIO 2.6.1, revision 01). dune-project is the single source of truth; the .opam file must always state the same version.
opam install trexio # from the OPAM repository
opam install . --with-test # from a checkoutmake bootstrap # vendored C library into ./_prefix (offline, static)
export PKG_CONFIG_PATH="$PWD/_prefix/lib/pkgconfig" # for manual dune runs
make # build (committed generated sources)
make test # TEXT + HDF5 round-trips, byte + native
make install # into the current OPAM switchdune-project and trexio.opam.external/trexio-<Ctag>.tar.gz and regenerate its .sha256../update.sh — fetches, asserts the version, regenerates trex.json + lib/, runs the test suite.Full playbook: UPGRADING.md.
gcc, pkg-config, dune >= 3.1, dune-configurator; HDF5 headers optional (without them the C library is TEXT-only and the tests print SKIP HDF5)./update.sh: additionally curl, tar, python3, network (only when _fetch/ is not cached)make bootstrap: a C compiler + make (the tarball ships its own configure + libtool)dune-project # package/version definitions (source of truth)
trexio.opam
trex.json # generator input (committed; refreshed by ./update.sh)
src/ # hand-written binding templates (code-gen markers)
lib/ # generated + committed sources (+ dune-configurator setup)
read_json.py # generator: trex.json + src/ -> lib/
update.sh # fetch + regenerate + test (only place that fetches)
setup.sh # C bootstrap (make bootstrap / opam build step)
external/ # vendored TREXIO C tarball + .sha256
Makefile # dev convenience targetsThe binding previously lived in TREX-CoE/trexio under ocaml/trexio/ (removed in fa86b5e).
BSD-3-Clause (see LICENSE).