Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
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:
- extracts the pinned s-dftd3 and mctc-lib release tarballs shipped under
vendor/(SHA-256 verified) unlessDFTD3_DIRor a maintainer-ownedDFTD3_SYS_UPSTREAM_DIRis used, - builds both as static archives with meson/ninja
(
--wrap-mode=nodownload, OpenMP off — no new dynamic dependencies), - renames all
__mctc_*symbols of this mctc-lib copy to a private__fasd3mctc_*namespace, becausedftd4-sysembeds its own, incompatible mctc-lib build: without the rename, mixing the two Fortran module vtable/copy/finalise thunks in one binary causes reproducible SIGSEGVs, - 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 underOUT_DIR. This is the crates.io-safe default and runs fully offline. - Maintainer source tree: set
DFTD3_SYS_UPSTREAM_DIR=/path/to/simple-dftd3to build from a hand-extracted tree. The version is validated against the pin. - System prefix:
DFTD3_DIR=/prefixwith staticlibs-dftd3.aandlibmctc-lib.a(orlibmctc.a) underlib/lib64. Shared-only installs are rejected on purpose — static linking is the contract.
Usage
[]
= { = "../dftd3-sys", = "0.1.0" }
= { = "0", = 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.