From e2d9d11c108fa379ffd3d2a2e8b82c599541bb39 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert Date: Thu, 18 Jun 2026 12:06:09 +0200 Subject: [PATCH 1/2] Move to conda based RTD builds --- .readthedocs.yaml | 25 +++++++++++++------------ doc/conf.py | 1 - doc/environment.yml | 29 +++++++++++++++++++++++++++++ doc/requirements.txt | 9 --------- 4 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 doc/environment.yml delete mode 100644 doc/requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3803a410d..68c8eb264 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -2,21 +2,22 @@ # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details -# Required version: 2 -# Set the version of Python and other tools you might need +# Configuration file for build in doc/ subdirectory +sphinx: + configuration: doc/conf.py + +# Specify mambaforge such that we can install dependencies via mamba package manager build: os: ubuntu-22.04 tools: - python: "3.11" - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: doc/conf.py + python: "mambaforge-22.9" + jobs: + install: + - tar --exclude=./python -cvf ./python/s-dftd3.tar . && mkdir -p ./python/subprojects/s-dftd3 && tar xvf ./python/s-dftd3.tar -C ./python/subprojects/s-dftd3 + - pip install ./python -# We recommend specifying your dependencies to enable reproducible builds: -# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -python: - install: - - requirements: doc/requirements.txt +# Get dependencies for docs, package and build from conda-forge +conda: + environment: doc/environment.yml diff --git a/doc/conf.py b/doc/conf.py index 6ea76bcce..43181a45e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -41,7 +41,6 @@ html_static_path = ["_static"] templates_path = ["_templates"] locale_dirs = ["locales"] -autodoc_mock_imports = ["dftd3.library"] bibtex_bibfiles = ["_static/references.bib"] master_doc = "index" diff --git a/doc/environment.yml b/doc/environment.yml new file mode 100644 index 000000000..e15d45faf --- /dev/null +++ b/doc/environment.yml @@ -0,0 +1,29 @@ +name: dftd3-docs +channels: + - conda-forge + - nodefaults +dependencies: + # documentation dependencies + - breathe + - myst-nb + - sphinx-book-theme + - sphinx-copybutton + - sphinx-design + - sphinxcontrib-bibtex + # package dependencies + - ase + - cffi + - numpy + - qcelemental + - pyscf + # extra dependencies for notebooks + - ipython + # build dependencies + - c-compiler + - fortran-compiler + - meson !=1.8.0 + - ninja + - pkg-config + - pip + - toml-f-devel + - mctc-lib-devel diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 641f257a8..000000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -sphinx-book-theme -sphinx-copybutton -sphinx-design -sphinxcontrib-bibtex -numpy -ase -cffi -qcelemental -pyscf From 885abf9fdefc846616097ebedf32810dc12d0067 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert Date: Thu, 18 Jun 2026 12:20:16 +0200 Subject: [PATCH 2/2] Include shared libs as necessary --- config/meson.build | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/meson.build b/config/meson.build index 84ceeb9e9..db306607d 100644 --- a/config/meson.build +++ b/config/meson.build @@ -17,6 +17,10 @@ os = host_machine.system() fc = meson.get_compiler('fortran') fc_id = fc.get_id() +cc = fc +if has_cc + cc = meson.get_compiler('c') +endif if fc_id == 'gcc' add_project_arguments( @@ -24,6 +28,18 @@ if fc_id == 'gcc' '-fbacktrace', language: 'fortran', ) + if os == 'linux' + lib_deps += cc.find_library('gfortran') + quadmath_dep = cc.find_library('quadmath', required: false) + if quadmath_dep.found() + lib_deps += quadmath_dep + endif + mvec_dep = cc.find_library('mvec', required: false) + if mvec_dep.found() + lib_deps += mvec_dep + endif + lib_deps += cc.find_library('m') + endif elif fc_id == 'intel' add_project_arguments( '-traceback',