2022-01-13 03:21:41 +08:00
|
|
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2014-01-13 01:19:18 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
|
|
|
# flake8: noqa
|
2013-12-10 12:17:08 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
# Spack documentation build configuration file, created by
|
|
|
|
# sphinx-quickstart on Mon Dec 9 15:32:41 2013.
|
|
|
|
#
|
|
|
|
# This file is execfile()d with the current directory set to its containing dir.
|
|
|
|
#
|
|
|
|
# Note that not all possible configuration values are present in this
|
|
|
|
# autogenerated file.
|
|
|
|
#
|
|
|
|
# All configuration values have a default; values that are commented out
|
|
|
|
# serve to show the default.
|
|
|
|
|
2015-02-19 06:29:55 +08:00
|
|
|
import os
|
2016-08-30 15:47:04 +08:00
|
|
|
import re
|
2015-02-19 06:29:55 +08:00
|
|
|
import subprocess
|
2021-07-09 06:12:30 +08:00
|
|
|
import sys
|
2016-08-30 15:47:04 +08:00
|
|
|
from glob import glob
|
2018-06-19 08:17:21 +08:00
|
|
|
|
Makefile generator for parallel spack install of environments (#30254)
`make` solves a lot of headaches that would otherwise have to be implemented in Spack:
1. Parallelism over packages through multiple `spack install` processes
2. Orderly output of parallel package installs thanks to `make --sync-output=recurse` or `make -Orecurse` (works well in GNU Make 4.3; macOS is unfortunately on a 16 years old 3.x version, but it's one `spack install gmake` away...)
3. Shared jobserver across packages, which means a single `-j` to rule them all, instead of manually finding a balance between `#spack install processes` & `#jobs per package` (See #30302).
This pr adds the `spack env depfile` command that generates a Makefile with dag hashes as
targets, and dag hashes of dependencies as prerequisites, and a command
along the lines of `spack install --only=packages /hash` to just install
a single package.
It exposes two convenient phony targets: `all`, `fetch-all`. The former installs the environment, the latter just fetches all sources. So one can either use `make all -j16` directly or run `make fetch-all -j16` on a login node and `make all -j16` on a compute node.
Example:
```yaml
spack:
specs: [perl]
view: false
```
running
```
$ spack -e . env depfile --make-target-prefix env | tee Makefile
```
generates
```Makefile
SPACK ?= spack
.PHONY: env/all env/fetch-all env/clean
env/all: env/env
env/fetch-all: env/fetch
env/env: env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww
@touch $@
env/fetch: env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc
@touch $@
env/dirs:
@mkdir -p env/.fetch env/.install
env/.fetch/%: | env/dirs
$(info Fetching $(SPEC))
$(SPACK) -e '/tmp/tmp.7PHPSIRACv' fetch $(SPACK_FETCH_FLAGS) /$(notdir $@) && touch $@
env/.install/%: env/.fetch/%
$(info Installing $(SPEC))
+$(SPACK) -e '/tmp/tmp.7PHPSIRACv' install $(SPACK_INSTALL_FLAGS) --only-concrete --only=package --no-add /$(notdir $@) && touch $@
# Set the human-readable spec for each target
env/%/cdqldivylyxocqymwnfzmzc5sx2zwvww: SPEC = perl@5.34.1%gcc@10.3.0+cpanm+shared+threads arch=linux-ubuntu20.04-zen2
env/%/gv5kin2xnn33uxyfte6k4a3bynhmtxze: SPEC = berkeley-db@18.1.40%gcc@10.3.0+cxx~docs+stl patches=b231fcc arch=linux-ubuntu20.04-zen2
env/%/cuymc7e5gupwyu7vza5d4vrbuslk277p: SPEC = bzip2@1.0.8%gcc@10.3.0~debug~pic+shared arch=linux-ubuntu20.04-zen2
env/%/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: SPEC = diffutils@3.8%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws: SPEC = libiconv@1.16%gcc@10.3.0 libs=shared,static arch=linux-ubuntu20.04-zen2
env/%/yfz2agazed7ohevqvnrmm7jfkmsgwjao: SPEC = gdbm@1.19%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/73t7ndb5w72hrat5hsax4caox2sgumzu: SPEC = readline@8.1%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/trvdyncxzfozxofpm3cwgq4vecpxixzs: SPEC = ncurses@6.2%gcc@10.3.0~symlinks+termlib abi=none arch=linux-ubuntu20.04-zen2
env/%/sbzszb7v557ohyd6c2ekirx2t3ctxfxp: SPEC = pkgconf@1.8.0%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/c4go4gxlcznh5p5nklpjm644epuh3pzc: SPEC = zlib@1.2.12%gcc@10.3.0+optimize+pic+shared patches=0d38234 arch=linux-ubuntu20.04-zen2
# Install dependencies
env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww: env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p: env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk
env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws
env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao: env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu
env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu: env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs
env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs: env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp
env/clean:
rm -f -- env/env env/fetch env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
```
Then with `make -O` you get very nice orderly output when packages are built in parallel:
```console
$ make -Orecurse -j16
spack -e . install --only-concrete --only=package /c4go4gxlcznh5p5nklpjm644epuh3pzc && touch c4go4gxlcznh5p5nklpjm644epuh3pzc
==> Installing zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
...
Fetch: 0.00s. Build: 0.88s. Total: 0.88s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
spack -e . install --only-concrete --only=package /sbzszb7v557ohyd6c2ekirx2t3ctxfxp && touch sbzszb7v557ohyd6c2ekirx2t3ctxfxp
==> Installing pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
...
Fetch: 0.00s. Build: 3.96s. Total: 3.96s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
```
For Perl, at least for me, using `make -j16` versus `spack -e . install -j16` speeds up the builds from 3m32.623s to 2m22.775s, as some configure scripts run in parallel.
Another nice feature is you can do Makefile "metaprogramming" and depend on packages built by Spack. This example fetches all sources (in parallel) first, print a message, and only then build packages (in parallel).
```Makefile
SPACK ?= spack
.PHONY: env
all: env
spack.lock: spack.yaml
$(SPACK) -e . concretize -f
env.mk: spack.lock
$(SPACK) -e . env depfile -o $@ --make-target-prefix spack
fetch: spack/fetch
@echo Fetched all packages && touch $@
env: fetch spack/env
@echo This executes after the environment has been installed
clean:
rm -rf spack/ env.mk spack.lock
ifeq (,$(filter clean,$(MAKECMDGOALS)))
include env.mk
endif
```
2022-05-06 01:45:21 +08:00
|
|
|
from docutils.statemachine import StringList
|
|
|
|
from sphinx.domains.python import PythonDomain
|
2019-05-22 14:36:41 +08:00
|
|
|
from sphinx.ext.apidoc import main as sphinx_apidoc
|
Makefile generator for parallel spack install of environments (#30254)
`make` solves a lot of headaches that would otherwise have to be implemented in Spack:
1. Parallelism over packages through multiple `spack install` processes
2. Orderly output of parallel package installs thanks to `make --sync-output=recurse` or `make -Orecurse` (works well in GNU Make 4.3; macOS is unfortunately on a 16 years old 3.x version, but it's one `spack install gmake` away...)
3. Shared jobserver across packages, which means a single `-j` to rule them all, instead of manually finding a balance between `#spack install processes` & `#jobs per package` (See #30302).
This pr adds the `spack env depfile` command that generates a Makefile with dag hashes as
targets, and dag hashes of dependencies as prerequisites, and a command
along the lines of `spack install --only=packages /hash` to just install
a single package.
It exposes two convenient phony targets: `all`, `fetch-all`. The former installs the environment, the latter just fetches all sources. So one can either use `make all -j16` directly or run `make fetch-all -j16` on a login node and `make all -j16` on a compute node.
Example:
```yaml
spack:
specs: [perl]
view: false
```
running
```
$ spack -e . env depfile --make-target-prefix env | tee Makefile
```
generates
```Makefile
SPACK ?= spack
.PHONY: env/all env/fetch-all env/clean
env/all: env/env
env/fetch-all: env/fetch
env/env: env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww
@touch $@
env/fetch: env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc
@touch $@
env/dirs:
@mkdir -p env/.fetch env/.install
env/.fetch/%: | env/dirs
$(info Fetching $(SPEC))
$(SPACK) -e '/tmp/tmp.7PHPSIRACv' fetch $(SPACK_FETCH_FLAGS) /$(notdir $@) && touch $@
env/.install/%: env/.fetch/%
$(info Installing $(SPEC))
+$(SPACK) -e '/tmp/tmp.7PHPSIRACv' install $(SPACK_INSTALL_FLAGS) --only-concrete --only=package --no-add /$(notdir $@) && touch $@
# Set the human-readable spec for each target
env/%/cdqldivylyxocqymwnfzmzc5sx2zwvww: SPEC = perl@5.34.1%gcc@10.3.0+cpanm+shared+threads arch=linux-ubuntu20.04-zen2
env/%/gv5kin2xnn33uxyfte6k4a3bynhmtxze: SPEC = berkeley-db@18.1.40%gcc@10.3.0+cxx~docs+stl patches=b231fcc arch=linux-ubuntu20.04-zen2
env/%/cuymc7e5gupwyu7vza5d4vrbuslk277p: SPEC = bzip2@1.0.8%gcc@10.3.0~debug~pic+shared arch=linux-ubuntu20.04-zen2
env/%/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: SPEC = diffutils@3.8%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws: SPEC = libiconv@1.16%gcc@10.3.0 libs=shared,static arch=linux-ubuntu20.04-zen2
env/%/yfz2agazed7ohevqvnrmm7jfkmsgwjao: SPEC = gdbm@1.19%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/73t7ndb5w72hrat5hsax4caox2sgumzu: SPEC = readline@8.1%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/trvdyncxzfozxofpm3cwgq4vecpxixzs: SPEC = ncurses@6.2%gcc@10.3.0~symlinks+termlib abi=none arch=linux-ubuntu20.04-zen2
env/%/sbzszb7v557ohyd6c2ekirx2t3ctxfxp: SPEC = pkgconf@1.8.0%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/c4go4gxlcznh5p5nklpjm644epuh3pzc: SPEC = zlib@1.2.12%gcc@10.3.0+optimize+pic+shared patches=0d38234 arch=linux-ubuntu20.04-zen2
# Install dependencies
env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww: env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p: env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk
env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws
env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao: env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu
env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu: env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs
env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs: env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp
env/clean:
rm -f -- env/env env/fetch env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
```
Then with `make -O` you get very nice orderly output when packages are built in parallel:
```console
$ make -Orecurse -j16
spack -e . install --only-concrete --only=package /c4go4gxlcznh5p5nklpjm644epuh3pzc && touch c4go4gxlcznh5p5nklpjm644epuh3pzc
==> Installing zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
...
Fetch: 0.00s. Build: 0.88s. Total: 0.88s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
spack -e . install --only-concrete --only=package /sbzszb7v557ohyd6c2ekirx2t3ctxfxp && touch sbzszb7v557ohyd6c2ekirx2t3ctxfxp
==> Installing pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
...
Fetch: 0.00s. Build: 3.96s. Total: 3.96s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
```
For Perl, at least for me, using `make -j16` versus `spack -e . install -j16` speeds up the builds from 3m32.623s to 2m22.775s, as some configure scripts run in parallel.
Another nice feature is you can do Makefile "metaprogramming" and depend on packages built by Spack. This example fetches all sources (in parallel) first, print a message, and only then build packages (in parallel).
```Makefile
SPACK ?= spack
.PHONY: env
all: env
spack.lock: spack.yaml
$(SPACK) -e . concretize -f
env.mk: spack.lock
$(SPACK) -e . env depfile -o $@ --make-target-prefix spack
fetch: spack/fetch
@echo Fetched all packages && touch $@
env: fetch spack/env
@echo This executes after the environment has been installed
clean:
rm -rf spack/ env.mk spack.lock
ifeq (,$(filter clean,$(MAKECMDGOALS)))
include env.mk
endif
```
2022-05-06 01:45:21 +08:00
|
|
|
from sphinx.parsers import RSTParser
|
2013-12-10 12:17:08 +08:00
|
|
|
|
2016-08-30 16:27:49 +08:00
|
|
|
# -- Spack customizations -----------------------------------------------------
|
2013-12-10 12:17:08 +08:00
|
|
|
# If extensions (or modules to document with autodoc) are in another directory,
|
|
|
|
# add these directories to sys.path here. If the directory is relative to the
|
|
|
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
2022-10-25 18:27:13 +08:00
|
|
|
link_name = os.path.abspath("_spack_root")
|
|
|
|
if not os.path.exists(link_name):
|
|
|
|
os.symlink(os.path.abspath("../../.."), link_name, target_is_directory=True)
|
2022-07-31 06:19:18 +08:00
|
|
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external"))
|
|
|
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/pytest-fallback"))
|
2019-05-22 14:45:54 +08:00
|
|
|
|
2017-03-08 01:32:43 +08:00
|
|
|
if sys.version_info[0] < 3:
|
2022-07-31 06:19:18 +08:00
|
|
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/yaml/lib"))
|
2017-03-08 01:32:43 +08:00
|
|
|
else:
|
2022-07-31 06:19:18 +08:00
|
|
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/yaml/lib3"))
|
2019-05-22 14:45:54 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
sys.path.append(os.path.abspath("_spack_root/lib/spack/"))
|
2013-12-19 03:02:31 +08:00
|
|
|
|
|
|
|
# Add the Spack bin directory to the path so that we can use its output in docs.
|
2022-07-31 06:19:18 +08:00
|
|
|
os.environ["SPACK_ROOT"] = os.path.abspath("_spack_root")
|
|
|
|
os.environ["PATH"] += "%s%s" % (os.pathsep, os.path.abspath("_spack_root/bin"))
|
2013-12-12 20:25:31 +08:00
|
|
|
|
2016-08-30 16:27:49 +08:00
|
|
|
# Set an environment variable so that colify will print output like it would to
|
|
|
|
# a terminal.
|
2022-07-31 06:19:18 +08:00
|
|
|
os.environ["COLIFY_SIZE"] = "25x120"
|
|
|
|
os.environ["COLUMNS"] = "120"
|
2016-08-30 16:27:49 +08:00
|
|
|
|
2019-05-21 03:44:36 +08:00
|
|
|
# Generate full package list if needed
|
2022-07-31 06:19:18 +08:00
|
|
|
subprocess.call(["spack", "list", "--format=html", "--update=package_list.html"])
|
2016-08-30 15:47:04 +08:00
|
|
|
|
2019-05-21 03:44:36 +08:00
|
|
|
# Generate a command index if an update is needed
|
2022-07-31 06:19:18 +08:00
|
|
|
subprocess.call(
|
|
|
|
[
|
|
|
|
"spack",
|
|
|
|
"commands",
|
|
|
|
"--format=rst",
|
|
|
|
"--header=command_index.in",
|
|
|
|
"--update=command_index.rst",
|
|
|
|
]
|
|
|
|
+ glob("*rst")
|
|
|
|
)
|
2016-08-30 15:47:04 +08:00
|
|
|
|
2017-04-26 13:24:02 +08:00
|
|
|
#
|
2016-08-31 12:02:34 +08:00
|
|
|
# Run sphinx-apidoc
|
2017-04-26 13:24:02 +08:00
|
|
|
#
|
|
|
|
# Remove any previous API docs
|
|
|
|
# Read the Docs doesn't clean up after previous builds
|
|
|
|
# Without this, the API Docs will never actually update
|
|
|
|
#
|
|
|
|
apidoc_args = [
|
2022-07-31 06:19:18 +08:00
|
|
|
"--force", # Overwrite existing files
|
|
|
|
"--no-toc", # Don't create a table of contents file
|
|
|
|
"--output-dir=.", # Directory to place all output
|
2017-04-26 13:24:02 +08:00
|
|
|
]
|
2022-07-31 06:19:18 +08:00
|
|
|
sphinx_apidoc(apidoc_args + ["_spack_root/lib/spack/spack"])
|
|
|
|
sphinx_apidoc(apidoc_args + ["_spack_root/lib/spack/llnl"])
|
2016-08-31 12:02:34 +08:00
|
|
|
|
2013-12-19 03:02:31 +08:00
|
|
|
# Enable todo items
|
2013-12-12 20:25:31 +08:00
|
|
|
todo_include_todos = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
2017-09-27 17:25:45 +08:00
|
|
|
#
|
|
|
|
# Disable duplicate cross-reference warnings.
|
|
|
|
#
|
|
|
|
class PatchedPythonDomain(PythonDomain):
|
|
|
|
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
|
2022-07-31 06:19:18 +08:00
|
|
|
if "refspecific" in node:
|
|
|
|
del node["refspecific"]
|
2017-09-27 17:25:45 +08:00
|
|
|
return super(PatchedPythonDomain, self).resolve_xref(
|
2022-07-31 06:19:18 +08:00
|
|
|
env, fromdocname, builder, typ, target, node, contnode
|
|
|
|
)
|
|
|
|
|
2017-09-27 17:25:45 +08:00
|
|
|
|
Makefile generator for parallel spack install of environments (#30254)
`make` solves a lot of headaches that would otherwise have to be implemented in Spack:
1. Parallelism over packages through multiple `spack install` processes
2. Orderly output of parallel package installs thanks to `make --sync-output=recurse` or `make -Orecurse` (works well in GNU Make 4.3; macOS is unfortunately on a 16 years old 3.x version, but it's one `spack install gmake` away...)
3. Shared jobserver across packages, which means a single `-j` to rule them all, instead of manually finding a balance between `#spack install processes` & `#jobs per package` (See #30302).
This pr adds the `spack env depfile` command that generates a Makefile with dag hashes as
targets, and dag hashes of dependencies as prerequisites, and a command
along the lines of `spack install --only=packages /hash` to just install
a single package.
It exposes two convenient phony targets: `all`, `fetch-all`. The former installs the environment, the latter just fetches all sources. So one can either use `make all -j16` directly or run `make fetch-all -j16` on a login node and `make all -j16` on a compute node.
Example:
```yaml
spack:
specs: [perl]
view: false
```
running
```
$ spack -e . env depfile --make-target-prefix env | tee Makefile
```
generates
```Makefile
SPACK ?= spack
.PHONY: env/all env/fetch-all env/clean
env/all: env/env
env/fetch-all: env/fetch
env/env: env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww
@touch $@
env/fetch: env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc
@touch $@
env/dirs:
@mkdir -p env/.fetch env/.install
env/.fetch/%: | env/dirs
$(info Fetching $(SPEC))
$(SPACK) -e '/tmp/tmp.7PHPSIRACv' fetch $(SPACK_FETCH_FLAGS) /$(notdir $@) && touch $@
env/.install/%: env/.fetch/%
$(info Installing $(SPEC))
+$(SPACK) -e '/tmp/tmp.7PHPSIRACv' install $(SPACK_INSTALL_FLAGS) --only-concrete --only=package --no-add /$(notdir $@) && touch $@
# Set the human-readable spec for each target
env/%/cdqldivylyxocqymwnfzmzc5sx2zwvww: SPEC = perl@5.34.1%gcc@10.3.0+cpanm+shared+threads arch=linux-ubuntu20.04-zen2
env/%/gv5kin2xnn33uxyfte6k4a3bynhmtxze: SPEC = berkeley-db@18.1.40%gcc@10.3.0+cxx~docs+stl patches=b231fcc arch=linux-ubuntu20.04-zen2
env/%/cuymc7e5gupwyu7vza5d4vrbuslk277p: SPEC = bzip2@1.0.8%gcc@10.3.0~debug~pic+shared arch=linux-ubuntu20.04-zen2
env/%/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: SPEC = diffutils@3.8%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws: SPEC = libiconv@1.16%gcc@10.3.0 libs=shared,static arch=linux-ubuntu20.04-zen2
env/%/yfz2agazed7ohevqvnrmm7jfkmsgwjao: SPEC = gdbm@1.19%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/73t7ndb5w72hrat5hsax4caox2sgumzu: SPEC = readline@8.1%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/trvdyncxzfozxofpm3cwgq4vecpxixzs: SPEC = ncurses@6.2%gcc@10.3.0~symlinks+termlib abi=none arch=linux-ubuntu20.04-zen2
env/%/sbzszb7v557ohyd6c2ekirx2t3ctxfxp: SPEC = pkgconf@1.8.0%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/c4go4gxlcznh5p5nklpjm644epuh3pzc: SPEC = zlib@1.2.12%gcc@10.3.0+optimize+pic+shared patches=0d38234 arch=linux-ubuntu20.04-zen2
# Install dependencies
env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww: env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p: env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk
env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws
env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao: env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu
env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu: env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs
env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs: env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp
env/clean:
rm -f -- env/env env/fetch env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
```
Then with `make -O` you get very nice orderly output when packages are built in parallel:
```console
$ make -Orecurse -j16
spack -e . install --only-concrete --only=package /c4go4gxlcznh5p5nklpjm644epuh3pzc && touch c4go4gxlcznh5p5nklpjm644epuh3pzc
==> Installing zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
...
Fetch: 0.00s. Build: 0.88s. Total: 0.88s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
spack -e . install --only-concrete --only=package /sbzszb7v557ohyd6c2ekirx2t3ctxfxp && touch sbzszb7v557ohyd6c2ekirx2t3ctxfxp
==> Installing pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
...
Fetch: 0.00s. Build: 3.96s. Total: 3.96s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
```
For Perl, at least for me, using `make -j16` versus `spack -e . install -j16` speeds up the builds from 3m32.623s to 2m22.775s, as some configure scripts run in parallel.
Another nice feature is you can do Makefile "metaprogramming" and depend on packages built by Spack. This example fetches all sources (in parallel) first, print a message, and only then build packages (in parallel).
```Makefile
SPACK ?= spack
.PHONY: env
all: env
spack.lock: spack.yaml
$(SPACK) -e . concretize -f
env.mk: spack.lock
$(SPACK) -e . env depfile -o $@ --make-target-prefix spack
fetch: spack/fetch
@echo Fetched all packages && touch $@
env: fetch spack/env
@echo This executes after the environment has been installed
clean:
rm -rf spack/ env.mk spack.lock
ifeq (,$(filter clean,$(MAKECMDGOALS)))
include env.mk
endif
```
2022-05-06 01:45:21 +08:00
|
|
|
#
|
|
|
|
# Disable tabs to space expansion in code blocks
|
|
|
|
# since Makefiles require tabs.
|
|
|
|
#
|
|
|
|
class NoTabExpansionRSTParser(RSTParser):
|
|
|
|
def parse(self, inputstring, document):
|
|
|
|
if isinstance(inputstring, str):
|
|
|
|
lines = inputstring.splitlines()
|
|
|
|
inputstring = StringList(lines, document.current_source)
|
|
|
|
super().parse(inputstring, document)
|
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2017-09-27 17:25:45 +08:00
|
|
|
def setup(sphinx):
|
2019-07-31 16:23:56 +08:00
|
|
|
sphinx.add_domain(PatchedPythonDomain, override=True)
|
Makefile generator for parallel spack install of environments (#30254)
`make` solves a lot of headaches that would otherwise have to be implemented in Spack:
1. Parallelism over packages through multiple `spack install` processes
2. Orderly output of parallel package installs thanks to `make --sync-output=recurse` or `make -Orecurse` (works well in GNU Make 4.3; macOS is unfortunately on a 16 years old 3.x version, but it's one `spack install gmake` away...)
3. Shared jobserver across packages, which means a single `-j` to rule them all, instead of manually finding a balance between `#spack install processes` & `#jobs per package` (See #30302).
This pr adds the `spack env depfile` command that generates a Makefile with dag hashes as
targets, and dag hashes of dependencies as prerequisites, and a command
along the lines of `spack install --only=packages /hash` to just install
a single package.
It exposes two convenient phony targets: `all`, `fetch-all`. The former installs the environment, the latter just fetches all sources. So one can either use `make all -j16` directly or run `make fetch-all -j16` on a login node and `make all -j16` on a compute node.
Example:
```yaml
spack:
specs: [perl]
view: false
```
running
```
$ spack -e . env depfile --make-target-prefix env | tee Makefile
```
generates
```Makefile
SPACK ?= spack
.PHONY: env/all env/fetch-all env/clean
env/all: env/env
env/fetch-all: env/fetch
env/env: env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww
@touch $@
env/fetch: env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc
@touch $@
env/dirs:
@mkdir -p env/.fetch env/.install
env/.fetch/%: | env/dirs
$(info Fetching $(SPEC))
$(SPACK) -e '/tmp/tmp.7PHPSIRACv' fetch $(SPACK_FETCH_FLAGS) /$(notdir $@) && touch $@
env/.install/%: env/.fetch/%
$(info Installing $(SPEC))
+$(SPACK) -e '/tmp/tmp.7PHPSIRACv' install $(SPACK_INSTALL_FLAGS) --only-concrete --only=package --no-add /$(notdir $@) && touch $@
# Set the human-readable spec for each target
env/%/cdqldivylyxocqymwnfzmzc5sx2zwvww: SPEC = perl@5.34.1%gcc@10.3.0+cpanm+shared+threads arch=linux-ubuntu20.04-zen2
env/%/gv5kin2xnn33uxyfte6k4a3bynhmtxze: SPEC = berkeley-db@18.1.40%gcc@10.3.0+cxx~docs+stl patches=b231fcc arch=linux-ubuntu20.04-zen2
env/%/cuymc7e5gupwyu7vza5d4vrbuslk277p: SPEC = bzip2@1.0.8%gcc@10.3.0~debug~pic+shared arch=linux-ubuntu20.04-zen2
env/%/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: SPEC = diffutils@3.8%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws: SPEC = libiconv@1.16%gcc@10.3.0 libs=shared,static arch=linux-ubuntu20.04-zen2
env/%/yfz2agazed7ohevqvnrmm7jfkmsgwjao: SPEC = gdbm@1.19%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/73t7ndb5w72hrat5hsax4caox2sgumzu: SPEC = readline@8.1%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/trvdyncxzfozxofpm3cwgq4vecpxixzs: SPEC = ncurses@6.2%gcc@10.3.0~symlinks+termlib abi=none arch=linux-ubuntu20.04-zen2
env/%/sbzszb7v557ohyd6c2ekirx2t3ctxfxp: SPEC = pkgconf@1.8.0%gcc@10.3.0 arch=linux-ubuntu20.04-zen2
env/%/c4go4gxlcznh5p5nklpjm644epuh3pzc: SPEC = zlib@1.2.12%gcc@10.3.0+optimize+pic+shared patches=0d38234 arch=linux-ubuntu20.04-zen2
# Install dependencies
env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww: env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p: env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk
env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk: env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws
env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao: env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu
env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu: env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs
env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs: env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp
env/clean:
rm -f -- env/env env/fetch env/.fetch/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.fetch/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.fetch/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.fetch/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.fetch/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.fetch/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.fetch/73t7ndb5w72hrat5hsax4caox2sgumzu env/.fetch/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.fetch/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.fetch/c4go4gxlcznh5p5nklpjm644epuh3pzc env/.install/cdqldivylyxocqymwnfzmzc5sx2zwvww env/.install/gv5kin2xnn33uxyfte6k4a3bynhmtxze env/.install/cuymc7e5gupwyu7vza5d4vrbuslk277p env/.install/7vangk4jvsdgw6u6oe6ob63pyjl5cbgk env/.install/hyb7ehxxyqqp2hiw56bzm5ampkw6cxws env/.install/yfz2agazed7ohevqvnrmm7jfkmsgwjao env/.install/73t7ndb5w72hrat5hsax4caox2sgumzu env/.install/trvdyncxzfozxofpm3cwgq4vecpxixzs env/.install/sbzszb7v557ohyd6c2ekirx2t3ctxfxp env/.install/c4go4gxlcznh5p5nklpjm644epuh3pzc
```
Then with `make -O` you get very nice orderly output when packages are built in parallel:
```console
$ make -Orecurse -j16
spack -e . install --only-concrete --only=package /c4go4gxlcznh5p5nklpjm644epuh3pzc && touch c4go4gxlcznh5p5nklpjm644epuh3pzc
==> Installing zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
...
Fetch: 0.00s. Build: 0.88s. Total: 0.88s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/zlib-1.2.12-c4go4gxlcznh5p5nklpjm644epuh3pzc
spack -e . install --only-concrete --only=package /sbzszb7v557ohyd6c2ekirx2t3ctxfxp && touch sbzszb7v557ohyd6c2ekirx2t3ctxfxp
==> Installing pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
...
Fetch: 0.00s. Build: 3.96s. Total: 3.96s.
[+] /tmp/tmp.b1eTyAOe85/store/linux-ubuntu20.04-zen2/gcc-10.3.0/pkgconf-1.8.0-sbzszb7v557ohyd6c2ekirx2t3ctxfxp
```
For Perl, at least for me, using `make -j16` versus `spack -e . install -j16` speeds up the builds from 3m32.623s to 2m22.775s, as some configure scripts run in parallel.
Another nice feature is you can do Makefile "metaprogramming" and depend on packages built by Spack. This example fetches all sources (in parallel) first, print a message, and only then build packages (in parallel).
```Makefile
SPACK ?= spack
.PHONY: env
all: env
spack.lock: spack.yaml
$(SPACK) -e . concretize -f
env.mk: spack.lock
$(SPACK) -e . env depfile -o $@ --make-target-prefix spack
fetch: spack/fetch
@echo Fetched all packages && touch $@
env: fetch spack/env
@echo This executes after the environment has been installed
clean:
rm -rf spack/ env.mk spack.lock
ifeq (,$(filter clean,$(MAKECMDGOALS)))
include env.mk
endif
```
2022-05-06 01:45:21 +08:00
|
|
|
sphinx.add_source_parser(NoTabExpansionRSTParser, override=True)
|
2017-09-27 17:25:45 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2013-12-10 12:17:08 +08:00
|
|
|
# -- General configuration -----------------------------------------------------
|
|
|
|
|
|
|
|
# If your documentation needs a minimal Sphinx version, state it here.
|
2022-07-31 06:19:18 +08:00
|
|
|
needs_sphinx = "3.4"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Add any Sphinx extension module names here, as strings. They can be extensions
|
|
|
|
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
2021-07-04 06:10:13 +08:00
|
|
|
extensions = [
|
2022-07-31 06:19:18 +08:00
|
|
|
"sphinx.ext.autodoc",
|
|
|
|
"sphinx.ext.graphviz",
|
|
|
|
"sphinx.ext.intersphinx",
|
|
|
|
"sphinx.ext.napoleon",
|
|
|
|
"sphinx.ext.todo",
|
|
|
|
"sphinx.ext.viewcode",
|
2022-10-11 07:25:37 +08:00
|
|
|
"sphinx_design",
|
2022-07-31 06:19:18 +08:00
|
|
|
"sphinxcontrib.programoutput",
|
2021-07-04 06:10:13 +08:00
|
|
|
]
|
2013-12-10 12:17:08 +08:00
|
|
|
|
2013-12-19 03:02:31 +08:00
|
|
|
# Set default graphviz options
|
|
|
|
graphviz_dot_args = [
|
2022-07-31 06:19:18 +08:00
|
|
|
"-Grankdir=LR",
|
|
|
|
"-Gbgcolor=transparent",
|
|
|
|
"-Nshape=box",
|
|
|
|
"-Nfontname=monaco",
|
|
|
|
"-Nfontsize=10",
|
|
|
|
]
|
2013-12-19 03:02:31 +08:00
|
|
|
|
|
|
|
# Get nice vector graphics
|
|
|
|
graphviz_output_format = "svg"
|
|
|
|
|
|
|
|
|
2013-12-10 12:17:08 +08:00
|
|
|
# Add any paths that contain templates here, relative to this directory.
|
2022-07-31 06:19:18 +08:00
|
|
|
templates_path = ["_templates"]
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The suffix of source filenames.
|
2022-07-31 06:19:18 +08:00
|
|
|
source_suffix = ".rst"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The encoding of source files.
|
2022-07-31 06:19:18 +08:00
|
|
|
source_encoding = "utf-8-sig"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The master toctree document.
|
2022-07-31 06:19:18 +08:00
|
|
|
master_doc = "index"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# General information about the project.
|
2022-07-31 06:19:18 +08:00
|
|
|
project = u"Spack"
|
|
|
|
copyright = u"2013-2021, Lawrence Livermore National Laboratory."
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The version info for the project you're documenting, acts as replacement for
|
|
|
|
# |version| and |release|, also used in various other places throughout the
|
|
|
|
# built documents.
|
|
|
|
#
|
|
|
|
# The short X.Y version.
|
2019-05-21 03:44:36 +08:00
|
|
|
import spack
|
2021-07-09 06:12:30 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
version = ".".join(str(s) for s in spack.spack_version_info[:2])
|
2013-12-10 12:17:08 +08:00
|
|
|
# The full version, including alpha/beta/rc tags.
|
2018-04-27 07:15:37 +08:00
|
|
|
release = spack.spack_version
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
|
|
# for a list of supported languages.
|
2022-07-31 06:19:18 +08:00
|
|
|
# language = None
|
2013-12-10 12:17:08 +08:00
|
|
|
|
2019-05-22 14:45:54 +08:00
|
|
|
# Places to look for .po/.mo files for doc translations
|
2022-07-31 06:19:18 +08:00
|
|
|
# locale_dirs = []
|
2019-05-22 14:45:54 +08:00
|
|
|
|
|
|
|
# Sphinx gettext settings
|
|
|
|
gettext_compact = True
|
2019-05-28 04:42:27 +08:00
|
|
|
gettext_uuid = False
|
2019-05-22 14:45:54 +08:00
|
|
|
|
2013-12-10 12:17:08 +08:00
|
|
|
# There are two options for replacing |today|: either, you set today to some
|
|
|
|
# non-false value, then it is used:
|
2022-07-31 06:19:18 +08:00
|
|
|
# today = ''
|
2013-12-10 12:17:08 +08:00
|
|
|
# Else, today_fmt is used as the format for a strftime call.
|
2022-07-31 06:19:18 +08:00
|
|
|
# today_fmt = '%B %d, %Y'
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# List of patterns, relative to source directory, that match files and
|
|
|
|
# directories to ignore when looking for source files.
|
2022-07-31 06:19:18 +08:00
|
|
|
exclude_patterns = ["_build", "_spack_root", ".spack-env"]
|
2013-12-10 12:17:08 +08:00
|
|
|
|
2021-07-04 06:10:13 +08:00
|
|
|
nitpicky = True
|
|
|
|
nitpick_ignore = [
|
|
|
|
# Python classes that intersphinx is unable to resolve
|
2022-07-31 06:19:18 +08:00
|
|
|
("py:class", "argparse.HelpFormatter"),
|
|
|
|
("py:class", "contextlib.contextmanager"),
|
|
|
|
("py:class", "module"),
|
|
|
|
("py:class", "_io.BufferedReader"),
|
|
|
|
("py:class", "unittest.case.TestCase"),
|
|
|
|
("py:class", "_frozen_importlib_external.SourceFileLoader"),
|
2022-06-20 23:49:33 +08:00
|
|
|
("py:class", "clingo.Control"),
|
2022-08-31 02:13:23 +08:00
|
|
|
("py:class", "six.moves.urllib.parse.ParseResult"),
|
2021-07-04 06:10:13 +08:00
|
|
|
# Spack classes that are private and we don't want to expose
|
2022-07-31 06:19:18 +08:00
|
|
|
("py:class", "spack.provider_index._IndexBase"),
|
|
|
|
("py:class", "spack.repo._PrependFileLoader"),
|
2022-10-19 06:51:38 +08:00
|
|
|
# Spack classes that intersphinx is unable to resolve
|
|
|
|
("py:class", "spack.version.VersionBase"),
|
2021-07-04 06:10:13 +08:00
|
|
|
]
|
|
|
|
|
2013-12-10 12:17:08 +08:00
|
|
|
# The reST default role (used for this markup: `text`) to use for all documents.
|
2022-07-31 06:19:18 +08:00
|
|
|
# default_role = None
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
2022-07-31 06:19:18 +08:00
|
|
|
# add_function_parentheses = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, the current module name will be prepended to all description
|
|
|
|
# unit titles (such as .. function::).
|
2022-07-31 06:19:18 +08:00
|
|
|
# add_module_names = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
|
|
|
# output. They are ignored by default.
|
2022-07-31 06:19:18 +08:00
|
|
|
# show_authors = False
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The name of the Pygments (syntax highlighting) style to use.
|
2019-11-13 10:18:41 +08:00
|
|
|
# We use our own extension of the default style with a few modifications
|
|
|
|
from pygments.style import Style
|
|
|
|
from pygments.styles.default import DefaultStyle
|
2021-07-09 06:12:30 +08:00
|
|
|
from pygments.token import Comment, Generic, Text
|
|
|
|
|
2019-11-13 10:18:41 +08:00
|
|
|
|
|
|
|
class SpackStyle(DefaultStyle):
|
|
|
|
styles = DefaultStyle.styles.copy()
|
2022-07-31 06:19:18 +08:00
|
|
|
background_color = "#f4f4f8"
|
2019-11-13 10:18:41 +08:00
|
|
|
styles[Generic.Output] = "#355"
|
|
|
|
styles[Generic.Prompt] = "bold #346ec9"
|
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2019-11-13 10:18:41 +08:00
|
|
|
import pkg_resources
|
2021-07-09 06:12:30 +08:00
|
|
|
|
2019-11-13 10:18:41 +08:00
|
|
|
dist = pkg_resources.Distribution(__file__)
|
2022-07-31 06:19:18 +08:00
|
|
|
sys.path.append(".") # make 'conf' module findable
|
|
|
|
ep = pkg_resources.EntryPoint.parse("spack = conf:SpackStyle", dist=dist)
|
|
|
|
dist._ep_map = {"pygments.styles": {"plugin1": ep}}
|
2019-11-13 10:18:41 +08:00
|
|
|
pkg_resources.working_set.add(dist)
|
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
pygments_style = "spack"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# A list of ignored prefixes for module index sorting.
|
2022-07-31 06:19:18 +08:00
|
|
|
# modindex_common_prefix = []
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
# -- Options for HTML output ---------------------------------------------------
|
|
|
|
|
|
|
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
|
|
# a list of builtin themes.
|
2022-07-31 06:19:18 +08:00
|
|
|
html_theme = "sphinx_rtd_theme"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Theme options are theme-specific and customize the look and feel of a theme
|
|
|
|
# further. For a list of options available for each theme, see the
|
|
|
|
# documentation.
|
2022-07-31 06:19:18 +08:00
|
|
|
html_theme_options = {"logo_only": True}
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Add any paths that contain custom themes here, relative to this directory.
|
2018-06-17 16:13:56 +08:00
|
|
|
# html_theme_path = ["_themes"]
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The name for this set of Sphinx documents. If None, it defaults to
|
|
|
|
# "<project> v<release> documentation".
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_title = None
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# A shorter title for the navigation bar. Default is the same as html_title.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_short_title = None
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The name of an image file (relative to this directory) to place at the top
|
|
|
|
# of the sidebar.
|
2022-07-31 06:19:18 +08:00
|
|
|
html_logo = "_spack_root/share/spack/logo/spack-logo-white-text.svg"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# The name of an image file (within the static path) to use as favicon of the
|
|
|
|
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
|
|
|
# pixels large.
|
2022-07-31 06:19:18 +08:00
|
|
|
html_favicon = "_spack_root/share/spack/logo/favicon.ico"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Add any paths that contain custom static files (such as style sheets) here,
|
|
|
|
# relative to this directory. They are copied after the builtin static files,
|
|
|
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
2022-07-31 06:19:18 +08:00
|
|
|
html_static_path = ["_static"]
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
|
|
|
# using the given strftime format.
|
2022-07-31 06:19:18 +08:00
|
|
|
html_last_updated_fmt = "%b %d, %Y"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, SmartyPants will be used to convert quotes and dashes to
|
|
|
|
# typographically correct entities.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_use_smartypants = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Custom sidebar templates, maps document names to template names.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_sidebars = {}
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Additional templates that should be rendered to pages, maps page names to
|
|
|
|
# template names.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_additional_pages = {}
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If false, no module index is generated.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_domain_indices = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If false, no index is generated.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_use_index = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, the index is split into individual pages for each letter.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_split_index = False
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, links to the reST sources are added to the pages.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_show_sourcelink = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_show_sphinx = False
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_show_copyright = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, an OpenSearch description file will be output, and all pages will
|
|
|
|
# contain a <link> tag referring to it. The value of this option must be the
|
|
|
|
# base URL from which the finished HTML is served.
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_use_opensearch = ''
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
2022-07-31 06:19:18 +08:00
|
|
|
# html_file_suffix = None
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Output file base name for HTML help builder.
|
2022-07-31 06:19:18 +08:00
|
|
|
htmlhelp_basename = "Spackdoc"
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
# -- Options for LaTeX output --------------------------------------------------
|
|
|
|
|
|
|
|
latex_elements = {
|
2022-07-31 06:19:18 +08:00
|
|
|
# The paper size ('letterpaper' or 'a4paper').
|
|
|
|
#'papersize': 'letterpaper',
|
|
|
|
# The font size ('10pt', '11pt' or '12pt').
|
|
|
|
#'pointsize': '10pt',
|
|
|
|
# Additional stuff for the LaTeX preamble.
|
|
|
|
#'preamble': '',
|
2013-12-10 12:17:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Grouping the document tree into LaTeX files. List of tuples
|
|
|
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
|
|
|
latex_documents = [
|
2022-07-31 06:19:18 +08:00
|
|
|
("index", "Spack.tex", u"Spack Documentation", u"Todd Gamblin", "manual"),
|
2013-12-10 12:17:08 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
# The name of an image file (relative to this directory) to place at the top of
|
|
|
|
# the title page.
|
2022-07-31 06:19:18 +08:00
|
|
|
# latex_logo = None
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# For "manual" documents, if this is true, then toplevel headings are parts,
|
|
|
|
# not chapters.
|
2022-07-31 06:19:18 +08:00
|
|
|
# latex_use_parts = False
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, show page references after internal links.
|
2022-07-31 06:19:18 +08:00
|
|
|
# latex_show_pagerefs = False
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, show URL addresses after external links.
|
2022-07-31 06:19:18 +08:00
|
|
|
# latex_show_urls = False
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# Documents to append as an appendix to all manuals.
|
2022-07-31 06:19:18 +08:00
|
|
|
# latex_appendices = []
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If false, no module index is generated.
|
2022-07-31 06:19:18 +08:00
|
|
|
# latex_domain_indices = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
# -- Options for manual page output --------------------------------------------
|
|
|
|
|
|
|
|
# One entry per manual page. List of tuples
|
|
|
|
# (source start file, name, description, authors, manual section).
|
2022-07-31 06:19:18 +08:00
|
|
|
man_pages = [("index", "spack", u"Spack Documentation", [u"Todd Gamblin"], 1)]
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If true, show URL addresses after external links.
|
2022-07-31 06:19:18 +08:00
|
|
|
# man_show_urls = False
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
# -- Options for Texinfo output ------------------------------------------------
|
|
|
|
|
|
|
|
# Grouping the document tree into Texinfo files. List of tuples
|
|
|
|
# (source start file, target name, title, author,
|
|
|
|
# dir menu entry, description, category)
|
|
|
|
texinfo_documents = [
|
2022-07-31 06:19:18 +08:00
|
|
|
(
|
|
|
|
"index",
|
|
|
|
"Spack",
|
|
|
|
u"Spack Documentation",
|
|
|
|
u"Todd Gamblin",
|
|
|
|
"Spack",
|
|
|
|
"One line description of project.",
|
|
|
|
"Miscellaneous",
|
|
|
|
),
|
2013-12-10 12:17:08 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
# Documents to append as an appendix to all manuals.
|
2022-07-31 06:19:18 +08:00
|
|
|
# texinfo_appendices = []
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# If false, no module index is generated.
|
2022-07-31 06:19:18 +08:00
|
|
|
# texinfo_domain_indices = True
|
2013-12-10 12:17:08 +08:00
|
|
|
|
|
|
|
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
2022-07-31 06:19:18 +08:00
|
|
|
# texinfo_show_urls = 'footnote'
|
2021-07-04 06:10:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
# -- Extension configuration -------------------------------------------------
|
|
|
|
|
|
|
|
# sphinx.ext.intersphinx
|
|
|
|
intersphinx_mapping = {
|
|
|
|
"python": ("https://docs.python.org/3", None),
|
|
|
|
}
|