dftd3-sys 0.1.1

Pinned static build of the simple-dftd3 (s-dftd3) Fortran library for the `dftd3` bindings
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 921.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 26.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nilsholle

dftd3-sys

Pinned, fully static build of the simple-dftd3 (s-dftd3) Fortran dispersion-correction library and its mctc-lib dependency, for use with the dftd3 Rust bindings (without their dynamic_loading feature).

Extracted from the fastatomstruct workspace as crates/dftd3-build at 4c6ec0fc; renamed to dftd3-sys.

What this crate is

A build-script-only support crate. It has no Rust API beyond one constant, SDFTD3_VERSION (derived from the build pin, so it always matches the library that was actually linked). Its build.rs:

  1. extracts the pinned s-dftd3 and mctc-lib release tarballs shipped under vendor/ (SHA-256 verified) unless DFTD3_DIR or a maintainer-owned DFTD3_SYS_UPSTREAM_DIR is used,
  2. builds both as static archives with meson/ninja (--wrap-mode=nodownload, OpenMP off — no new dynamic dependencies),
  3. renames all __mctc_* symbols of this mctc-lib copy to a private __fasd3mctc_* namespace, because dftd4-sys embeds its own, incompatible mctc-lib build: without the rename, mixing the two Fortran module vtable/copy/finalise thunks in one binary causes reproducible SIGSEGVs,
  4. emits cargo:rustc-link-lib=static=... flags plus the gfortran runtime.

The contract: everything ends up inside the final binary — no libs-dftd3.so ever appears next to a wheel.

Requirements

Tool Used for Notes
meson, ninja building the Fortran sources
gfortran compiling s-dftd3/mctc-lib; runtime linked as libgfortran
ar, nm, objcopy static-archive symbol namespacing GNU binutils; llvm-objcopy is probed and works; OBJCOPY=... overrides
tar, sha256sum/shasum unpacking and pin verification shasum -a 256 fallback for macOS/BSD
vendored tarballs providing pinned upstream sources offline vendor/simple-dftd3-v1.4.0.tar.gz and vendor/mctc-lib-v0.5.1.tar.gz are packaged with this crate

Linux is the supported and CI-tested platform. See docs/PUBLISHING.md for the platform policy.

Offline / override builds

  • Default vendored build: the package includes the pinned tarballs under vendor/; the build script verifies SHA-256 and extracts them under OUT_DIR. This is the crates.io-safe default and runs fully offline.
  • Maintainer source tree: set DFTD3_SYS_UPSTREAM_DIR=/path/to/simple-dftd3 to build from a hand-extracted tree. The version is validated against the pin.
  • System prefix: DFTD3_DIR=/prefix with static libs-dftd3.a and libmctc-lib.a (or libmctc.a) under lib/lib64. Shared-only installs are rejected on purpose — static linking is the contract.

Usage

[dependencies]
dftd3-sys = "0.1"
dftd3 = { version = "0", default-features = false }

Reference dftd3_sys::SDFTD3_VERSION somewhere in your final crate so the link flags are not pruned (rustc drops unreferenced crates). See USAGE.md — including the fastatomstruct migration notes.

License

LGPL-3.0-or-later (this crate). The linked upstream libraries are under their own licenses: simple-dftd3 is LGPL-3.0-or-later and mctc-lib is Apache-2.0. Their license texts travel inside the vendored release tarballs.