spack_repo.builtin.build_systems package

Submodules

spack_repo.builtin.build_systems.aspell_dict module

class spack_repo.builtin.build_systems.aspell_dict.AspellBuilder(pkg: PackageBase)[source]

Bases: AutotoolsBuilder

The Aspell builder is close enough to an autotools builder to allow specializing the builder class, so to use variables that are specific to the Aspell extensions.

configure(pkg: AspellDictPackage, spec: Spec, prefix: Prefix)[source]

Run “configure”, with the arguments specified by the builder and an appropriately set prefix.

class spack_repo.builtin.build_systems.aspell_dict.AspellDictPackage(spec: Spec)[source]

Bases: AutotoolsPackage

Specialized class for building aspell dictionairies.

AutotoolsBuilder

Override the default autotools builder

alias of AspellBuilder

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patch()[source]
patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.autotools module

class spack_repo.builtin.build_systems.autotools.AutotoolsBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The autotools builder encodes the default way of installing software built with autotools. It has four phases that can be overridden, if need be:

They all have sensible defaults and for many packages the only thing necessary is to override the helper method configure_args().

For a finer tuning you may also override:

Method

Purpose

build_targets

Specify make targets for the build phase

install_targets

Specify make targets for the install phase

check()

Run build time tests if required

property archive_files: List[str]

Files to archive for packages based on autotools

autoreconf(pkg: AutotoolsPackage, spec: Spec, prefix: Prefix) None[source]

Not needed usually, configure should be already there

autoreconf_extra_args: List[str]

Options to be passed to autoreconf when using the default implementation

property autoreconf_search_path_args: List[str]

Search path includes for autoreconf. Add an -I flag for all aclocal dirs of build deps, skips the default path of automake, move external include flags to the back, since they might pull in unrelated m4 files shadowing spack dependencies.

build(pkg: AutotoolsPackage, spec: Spec, prefix: Prefix) None[source]

Run “make” on the build targets specified by the builder.

property build_directory: str

Override to provide another place to build the package

build_system: str | None

Build system name. Must also be defined in derived classes.

build_targets: List[str]

Targets for make during the build() phase

build_time_test_callbacks: List[str]

Callback names for build-time test

check() None[source]

Run “make” on the test and check targets, if found.

configure(pkg: AutotoolsPackage, spec: Spec, prefix: Prefix) None[source]

Run “configure”, with the arguments specified by the builder and an appropriately set prefix.

property configure_abs_path: str
configure_args() List[str][source]

Return the list of all the arguments that must be passed to configure, except --prefix which will be pre-pended to the list.

property configure_directory: str

Return the directory where ‘configure’ resides.

enable_or_disable(name: str, activation_value: Callable | str | None = None, variant: str | None = None) List[str][source]

Same as with_or_without() but substitute with with enable and without with disable.

Parameters:
  • name – name of a valid multi-valued variant

  • activation_value

    if present accepts a single value and returns the parameter to be used leading to an entry of the type --enable-{name}={parameter}

    The special value “prefix” can also be assigned and will return spec[name].prefix as activation parameter.

Returns:

list of arguments to configure

force_autoreconf

Set to true to force the autoreconf step even if configure is present

install(pkg: AutotoolsPackage, spec: Spec, prefix: Prefix) None[source]

Run “make” on the install targets specified by the builder.

install_libtool_archives

If False deletes all the .la files in the prefix folder after the installation. If True instead it installs them.

install_targets

Targets for make during the install() phase

install_time_test_callbacks: List[str]

Callback names for install-time test

installcheck() None[source]

Run “make” on the installcheck target, if found.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

property patch_config_files: bool

Whether to update old config.guess and config.sub files distributed with the tarball.

This currently only applies to ppc64le:, aarch64:, and riscv64 target architectures.

The substitutes are taken from the gnuconfig package, which is automatically added as a build dependency for these architectures. In case system versions of these config files are required, the gnuconfig package can be marked external, with a prefix pointing to the directory containing the system config.guess and config.sub files.

patch_libtool

Whether to update libtool (e.g. for Arm/Clang/Fujitsu/NVHPC compilers)

phases: Tuple[str, ...]

Phases of a GNU Autotools package

setup_build_environment(env: EnvironmentModifications) None[source]

Sets up the build environment for a package.

This method will be called before the current package prefix exists in Spack’s store.

Parameters:

env – environment modifications to be applied when the package is built. Package authors can call methods on it to alter the build environment.

with_or_without(name: str, activation_value: Callable | str | None = None, variant: str | None = None) List[str][source]

Inspects a variant and returns the arguments that activate or deactivate the selected feature(s) for the configure options.

This function works on all type of variants. For bool-valued variants it will return by default --with-{name} or --without-{name}. For other kinds of variants it will cycle over the allowed values and return either --with-{value} or --without-{value}.

If activation_value is given, then for each possible value of the variant, the option --with-{value}=activation_value(value) or --without-{value} will be added depending on whether or not variant=value is in the spec.

Parameters:
  • name – name of a valid multi-valued variant

  • activation_value

    callable that accepts a single value and returns the parameter to be used leading to an entry of the type --with-{name}={parameter}.

    The special value “prefix” can also be assigned and will return spec[name].prefix as activation parameter.

Returns:

list of arguments to configure

class spack_repo.builtin.build_systems.autotools.AutotoolsPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using GNU Autotools.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

enable_or_disable(*args, **kwargs)[source]
extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

flags_to_build_system_args(flags)[source]

Produces a list of all command line arguments to pass specified compiler flags to configure.

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

with_or_without(*args, **kwargs)[source]

spack_repo.builtin.build_systems.bundle module

class spack_repo.builtin.build_systems.bundle.BundleBuilder(pkg: PackageBase)[source]

Bases: Builder

build_system: str | None

Build system name. Must also be defined in derived classes.

install(pkg: BundlePackage, spec: Spec, prefix: Prefix) None[source]
phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

class spack_repo.builtin.build_systems.bundle.BundlePackage(spec: Spec)[source]

Bases: PackageBase

General purpose bundle, or no-code, package class.

build_system_class: str

This attribute is used in UI queries that require to know which build-system class we are using

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

has_code: bool

Bundle packages do not have associated source or binary code.

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.cached_cmake module

class spack_repo.builtin.build_systems.cached_cmake.CachedCMakeBuilder(pkg: PackageBase)[source]

Bases: CMakeBuilder

class Scheduler(*values)[source]

Bases: Enum

FLUX
LSF
SLURM
property cache_name
property cache_path
define_cmake_cache_from_variant(cmake_var, variant=None, comment='')[source]

Return a Cached CMake field from the given variant’s value. See define_from_variant in lib/spack/spack/build_systems/cmake.py package

get_mpi_exec() str | None[source]
get_mpi_exec_num_proc() str[source]
get_scheduler() Scheduler | None[source]
initconfig(pkg: CachedCMakePackage, spec: Spec, prefix: Prefix) None[source]
initconfig_compiler_entries()[source]
initconfig_hardware_entries()[source]
initconfig_mpi_entries()[source]
initconfig_package_entries()[source]

This method is to be overwritten by the package

install_cmake_cache()[source]
package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Phases of a Cached CMake package Note: the initconfig phase is used for developer builds as a final phase to stop on

property std_cmake_args

Standard cmake arguments provided as a property for convenience of package writers

std_initconfig_entries()[source]
class spack_repo.builtin.build_systems.cached_cmake.CachedCMakePackage(spec: Spec)[source]

Bases: CMakePackage

Specialized class for packages built using CMake initial cache.

This feature of CMake allows packages to increase reproducibility, especially between Spack- and manual builds. It also allows packages to sidestep certain parsing bugs in extremely long cmake commands, and to avoid system limits on the length of the command line.

CMakeBuilder

alias of CachedCMakeBuilder

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

flag_handler(name, flags)[source]
licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.cached_cmake.cmake_cache_filepath(name, value, comment='')[source]

Generate a string for a cmake cache variable of type FILEPATH

spack_repo.builtin.build_systems.cached_cmake.cmake_cache_option(name, boolean_value, comment='', force=False)[source]

Generate a string for a cmake configuration option

spack_repo.builtin.build_systems.cached_cmake.cmake_cache_path(name, value, comment='', force=False)[source]

Generate a string for a cmake cache variable

spack_repo.builtin.build_systems.cached_cmake.cmake_cache_string(name, value, comment='', force=False)[source]

Generate a string for a cmake cache variable

spack_repo.builtin.build_systems.cached_cmake.spec_uses_toolchain(spec)[source]

spack_repo.builtin.build_systems.cargo module

class spack_repo.builtin.build_systems.cargo.CargoBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The Cargo builder encodes the most common way of building software with a rust Cargo.toml file. It has two phases that can be overridden, if need be:

For a finer tuning you may override:

Method

Purpose

build_args()

Specify arguments to cargo install

check_args()

Specify arguments to cargo test

build(pkg: CargoPackage, spec: Spec, prefix: Prefix) None[source]

Runs cargo install in the source directory

property build_args

Arguments for cargo build.

property build_directory

Return the directory containing the main Cargo.toml.

build_system: str | None

Build system name. Must also be defined in derived classes.

check()[source]

Run “cargo test”.

property check_args

Argument for cargo test during check phase

install(pkg: CargoPackage, spec: Spec, prefix: Prefix) None[source]

Copy build files into package prefix.

install_time_test_callbacks: List[str]

Callback names for install-time test

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

property std_build_args

Standard arguments for cargo build provided as a property for convenience of package writers.

class spack_repo.builtin.build_systems.cargo.CargoPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using cargo.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Must be defined as a fallback for old specs that don’t have the build_system variant

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.cmake module

class spack_repo.builtin.build_systems.cmake.CMakeBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The cmake builder encodes the default way of building software with CMake. IT has three phases that can be overridden:

They all have sensible defaults and for many packages the only thing necessary will be to override cmake_args().

For a finer tuning you may also override:

Method

Purpose

root_cmakelists_dir()

Location of the root CMakeLists.txt

build_directory()

Directory where to build the package

property archive_files: List[str]

Files to archive for packages based on CMake

build(pkg: CMakePackage, spec: Spec, prefix: Prefix) None[source]

Make the build targets

property build_directory: str

Full-path to the directory to use when building the package.

property build_dirname: str

Directory name to use when building the package.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_targets: List[str]

Targets to be used during the build phase

build_time_test_callbacks: List[str]

Callback names for build-time test

check() None[source]

Search the CMake-generated files for the targets test and check, and runs them if found.

cmake(pkg: CMakePackage, spec: Spec, prefix: Prefix) None[source]

Runs cmake in the build directory

cmake_args() List[str][source]

List of all the arguments that must be passed to cmake, except:

  • CMAKE_INSTALL_PREFIX

  • CMAKE_BUILD_TYPE

which will be set automatically.

static define(cmake_var: str, value: Any) str[source]
static define_cuda_architectures(pkg: PackageBase) str[source]
define_from_variant(cmake_var: str, variant: str | None = None) str[source]
static define_hip_architectures(pkg: PackageBase) str[source]
property generator: str
install(pkg: CMakePackage, spec: Spec, prefix: Prefix) None[source]

Make the install targets

install_targets

Targets to be used during the install phase

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Phases of a CMake package

property root_cmakelists_dir: str

The relative path to the directory containing CMakeLists.txt

This path is relative to the root of the extracted tarball, not to the build_directory. Defaults to the current directory.

static std_args(pkg: PackageBase, generator: str | None = None) List[str][source]

Computes the standard cmake arguments for a generic package

property std_cmake_args: List[str]

Standard cmake arguments provided as a property for convenience of package writers

class spack_repo.builtin.build_systems.cmake.CMakePackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using CMake

For more information on the CMake build system, see: https://cmake.org/cmake/help/latest/

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

define(cmake_var: str, value: Any) str[source]
define_from_variant(cmake_var: str, variant: str | None = None) str[source]
dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_cmake_hints_from: List[str]

List of package names for which CMake argument injection should be disabled

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

flags_to_build_system_args(flags)[source]

Return a list of all command line arguments to pass the specified compiler flags to cmake. Note CMAKE does not have a cppflags option, so cppflags will be added to cflags, cxxflags, and fflags to mimic the behavior in other tools.

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.cmake.define(cmake_var: str, value: Any) str[source]

Return a CMake command line argument that defines a variable.

The resulting argument will convert boolean values to OFF/ON and lists/tuples to CMake semicolon-separated string lists. All other values will be interpreted as strings.

Examples

[define("BUILD_SHARED_LIBS", True),
    define("CMAKE_CXX_STANDARD", 14),
    define("swr", ["avx", "avx2"])]

will generate the following configuration options:

["-DBUILD_SHARED_LIBS:BOOL=ON",
    "-DCMAKE_CXX_STANDARD:STRING=14",
    "-DSWR:STRING=avx;avx2]
spack_repo.builtin.build_systems.cmake.define_cuda_architectures(pkg: PackageBase) str[source]

Returns the str -DCMAKE_CUDA_ARCHITECTURES:STRING=(expanded cuda_arch).

cuda_arch is variant composed of a list of target CUDA architectures and it is declared in the cuda package.

This method is no-op for cmake<3.18 and when cuda_arch variant is not set.

spack_repo.builtin.build_systems.cmake.define_from_variant(pkg: PackageBase, cmake_var: str, variant: str | None = None) str[source]

Return a CMake command line argument from the given variant’s value.

The optional variant argument defaults to the lower-case transform of cmake_var.

Examples

Given a package with:

variant("cxxstd", default="11", values=("11", "14"),
        multi=False, description="")
variant("shared", default=True, description="")
variant("swr", values=any_combination_of("avx", "avx2"),
        description="")

calling this function like:

[
    self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
    self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"),
    self.define_from_variant("SWR"),
]

will generate the following configuration options:

[
    "-DBUILD_SHARED_LIBS:BOOL=ON",
    "-DCMAKE_CXX_STANDARD:STRING=14",
    "-DSWR:STRING=avx;avx2",
]

for <spec-name> cxxstd=14 +shared swr=avx,avx2

Note: if the provided variant is conditional, and the condition is not met, this function

returns an empty string. CMake discards empty strings provided on the command line.

spack_repo.builtin.build_systems.cmake.define_hip_architectures(pkg: PackageBase) str[source]

Returns the str -DCMAKE_HIP_ARCHITECTURES:STRING=(expanded amdgpu_target).

amdgpu_target is variant composed of a list of the target HIP architectures and it is declared in the rocm package.

This method is no-op for cmake<3.18 and when amdgpu_target variant is not set.

spack_repo.builtin.build_systems.cmake.generator(*names: str, default: str | None = None) None[source]

The build system generator to use.

See cmake --help for a list of valid generators. Currently, “Unix Makefiles” and “Ninja” are the only generators that Spack supports. Defaults to “Unix Makefiles”.

See https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html for more information.

Parameters:
  • names – allowed generators for this package

  • default – default generator

spack_repo.builtin.build_systems.compiler module

class spack_repo.builtin.build_systems.compiler.CompilerPackage(spec: Spec)[source]

Bases: PackageBase

A Package mixin for all common logic for packages that implement compilers

archspec_name() str[source]

Name that archspec uses to refer to this compiler

property cc: str | None
classmethod compiler_bindir(prefix: str | Path) str | Path[source]

Overridable method for the location of the compiler bindir within the prefix

compiler_languages: Sequence[str]

Static definition of languages supported by this class

compiler_names

Construct list of compiler names from per-language names

compiler_prefixes: List[str]

Optional prefix regexes for searching for this compiler

compiler_suffixes: List[str]

Optional suffix regexes for searching for this type of compiler. Suffixes are used by some frameworks, e.g. macports uses an ‘-mp-X.Y’ version suffix for gcc.

compiler_version_argument: str | Tuple[str, ...]

Compiler argument(s) that produces version information If multiple arguments, the earlier arguments must produce errors when invalid

compiler_version_regex: str

Regex used to extract version from compiler’s output

Relative path to compiler wrappers

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

property cxx: str | None
debug_flags: Sequence[str]

Flags for generating debug information

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

classmethod determine_compiler_paths(exes: Sequence[str | Path]) Dict[str, str | Path][source]

Compute the paths to compiler executables associated with this package

This is a helper method for determine_variants to compute the extra_attributes to include with each spec object.

classmethod determine_spec_details(prefix, objs_in_prefix)

Allow spack external find ... to locate installations.

Parameters:
  • prefix (str) – the directory containing the executables or libraries

  • objs_in_prefix (set) – the executables or libraries that match the regex

Returns:

The list of detected specs for this package

classmethod determine_variants(exes: Sequence[str | Path], version_str: str) Tuple[source]
classmethod determine_version(exe: str | Path) str[source]
disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

executables

Construct executables for external detection from names, prefixes, and suffixes.

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

property fortran
implicit_rpath_libs: List[str]
licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

linker_arg: str

Flag that needs to be used to pass an argument to the linker

openmp_flag: str

Flag to activate OpenMP support

opt_flags: Sequence[str]

Optimization flags

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

pic_flag: str

Flag used to produce Position Independent Code

classmethod platform_executables()
provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

rpath_arg: str | None

Returns the argument needed to set the RPATH, or None if it does not exist

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

standard_flag(*, language: str, standard: str) str[source]

Returns the flag used to enforce a given standard for a language

property supported_languages: Sequence[str]

Dynamic definition of languages supported by this package

tags: Sequence[str]
variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

verbose_flags: str

Flag used to get verbose output

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.compiler.compiler_output(compiler_path: str | Path, *, version_argument: str, ignore_errors: Tuple[int, ...] = ()) str[source]

Wrapper for _get_compiler_version_output().

spack_repo.builtin.build_systems.cuda module

class spack_repo.builtin.build_systems.cuda.CudaPackage(spec: Spec)[source]

Bases: PackageBase

Auxiliary class which contains CUDA variant, dependencies and conflicts and is meant to unify and facilitate its usage.

Maintainers: ax3l, Rombur, davidbeckingsale, pauleonix

static compute_capabilities(arch_list: Iterable[str]) List[str][source]

Adds a decimal place to each CUDA arch.

>>> compute_capabilities(['90', '90a', '100f'])
['9.0', '9.0a', '10.0f']
Parameters:

arch_list – A list of integer strings, optionally followed by a suffix.

Returns:

A list of float strings, optionally followed by a suffix

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

cuda_arch_values
static cuda_flags(arch_list)[source]
default_buildsystem: str

Must be defined as a fallback for old specs that don’t have the build_system variant

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.gnu module

class spack_repo.builtin.build_systems.gnu.GNUMirrorPackage(spec: Spec)[source]

Bases: PackageBase

Mixin that takes care of setting url and mirrors for GNU packages.

base_mirrors

List of GNU mirrors used by Spack

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

gnu_mirror_path: str | None

Path of the package in a GNU mirror

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

property urls
variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.go module

class spack_repo.builtin.build_systems.go.GoBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The Go builder encodes the most common way of building software with a golang go.mod file. It has two phases that can be overridden, if need be:

For a finer tuning you may override:

Method

Purpose

build_args

Specify arguments to go build

check_args

Specify arguments to go test

build(pkg: GoPackage, spec: Spec, prefix: Prefix) None[source]

Runs go build in the source directory

property build_args

Arguments for go build.

property build_directory

Return the directory containing the main go.mod.

build_system: str | None

Build system name. Must also be defined in derived classes.

check()[source]

Run go test . in the source directory

property check_args

Argument for go test during check phase

install(pkg: GoPackage, spec: Spec, prefix: Prefix) None[source]

Install built binaries into prefix bin.

install_time_test_callbacks: List[str]

Callback names for install-time test

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

setup_build_environment(env: EnvironmentModifications) None[source]

Setup build environment variables

class spack_repo.builtin.build_systems.go.GoPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using the Go toolchain.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.lua module

class spack_repo.builtin.build_systems.lua.LuaBuilder(pkg: PackageBase)[source]

Bases: Builder

build_system: str | None

Build system name. Must also be defined in derived classes.

generate_luarocks_config(pkg: LuaPackage, spec: Spec, prefix: Prefix) None[source]
install(pkg: LuaPackage, spec: Spec, prefix: Prefix) None[source]
luarocks_args()[source]
package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

preprocess(pkg: LuaPackage, spec: Spec, prefix: Prefix) None[source]

Override this to preprocess source before building with luarocks

setup_build_environment(env: EnvironmentModifications) None[source]

Sets up the build environment for a package.

This method will be called before the current package prefix exists in Spack’s store.

Parameters:

env – environment modifications to be applied when the package is built. Package authors can call methods on it to alter the build environment.

unpack(pkg: LuaPackage, spec: Spec, prefix: Prefix) None[source]
class spack_repo.builtin.build_systems.lua.LuaPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for lua packages

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

list_depth: int

Link depth to which list_url should be searched for new versions

property lua
property luarocks
patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.makefile module

class spack_repo.builtin.build_systems.makefile.MakefileBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The Makefile builder encodes the most common way of building software with Makefiles. It has three phases that can be overridden, if need be:

It is usually necessary to override the edit() phase (which is by default a no-op), while the other two have sensible defaults.

For a finer tuning you may override:

Method

Purpose

build_targets

Specify make targets for the build phase

install_targets

Specify make targets for the install phase

build_directory()

Directory where the Makefile is located

build(pkg: MakefilePackage, spec: Spec, prefix: Prefix) None[source]

Run “make” on the build targets specified by the builder.

property build_directory: str

Return the directory containing the main Makefile.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_targets: List[str]

Targets for make during the build() phase

build_time_test_callbacks: List[str]

Callback names for build-time test

check() None[source]

Run “make” on the test and check targets, if found.

edit(pkg: MakefilePackage, spec: Spec, prefix: Prefix) None[source]

Edit the Makefile before calling make. The default is a no-op.

install(pkg: MakefilePackage, spec: Spec, prefix: Prefix) None[source]

Run “make” on the install targets specified by the builder.

install_targets

Targets for make during the install() phase

install_time_test_callbacks: List[str]

Callback names for install-time test

installcheck() None[source]

Searches the Makefile for an installcheck target and runs it if found.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

class spack_repo.builtin.build_systems.makefile.MakefilePackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using Makefiles.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.maven module

class spack_repo.builtin.build_systems.maven.MavenBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The Maven builder encodes the default way to build software with Maven. It has two phases that can be overridden, if need be:

build(pkg: MavenPackage, spec: Spec, prefix: Prefix) None[source]

Compile code and package into a JAR file.

build_args()[source]

List of args to pass to build phase.

property build_directory

The directory containing the pom.xml file.

build_system: str | None

Build system name. Must also be defined in derived classes.

install(pkg: MavenPackage, spec: Spec, prefix: Prefix) None[source]

Copy to installation prefix.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

class spack_repo.builtin.build_systems.maven.MavenPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages that are built using the Maven build system. See https://maven.apache.org/index.html for more information.

build_system_class: str

Used when reporting the build system to users

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.meson module

class spack_repo.builtin.build_systems.meson.MesonBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The Meson builder encodes the default way to build software with Meson. The builder has three phases that can be overridden, if need be:

They all have sensible defaults and for many packages the only thing necessary will be to override meson_args().

For a finer tuning you may also override:

Method

Purpose

root_mesonlists_dir()

Location of the root MesonLists.txt

build_directory()

Directory where to build the package

property archive_files

Files to archive for packages based on Meson

build(pkg: MesonPackage, spec: Spec, prefix: Prefix) None[source]

Make the build targets

property build_directory

Directory to use when building the package.

property build_dirname

Returns the directory name to use when building the package.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_targets: List[str]
build_time_test_callbacks: List[str]
check() None[source]

Search Meson-generated files for the target test and run it if found.

install(pkg: MesonPackage, spec: Spec, prefix: Prefix) None[source]

Make the install targets

install_targets
meson(pkg: MesonPackage, spec: Spec, prefix: Prefix) None[source]

Run meson in the build directory

meson_args() List[str][source]

List of arguments that must be passed to meson, except:

  • --prefix

  • --libdir

  • --buildtype

  • --strip

  • --default_library

which will be set automatically.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

property root_mesonlists_dir: str

Relative path to the directory containing meson.build

This path is relative to the root of the extracted tarball, not to the build_directory. Defaults to the current directory.

static std_args(pkg) List[str][source]

Standard meson arguments for a generic package.

property std_meson_args: List[str]

Standard meson arguments provided as a property for convenience of package writers.

class spack_repo.builtin.build_systems.meson.MesonPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using Meson. For more information on the Meson build system, see https://mesonbuild.com/

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

flags_to_build_system_args(flags)[source]

Produces a list of all command line arguments to pass the specified compiler flags to meson.

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

plat
provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.msbuild module

class spack_repo.builtin.build_systems.msbuild.MSBuildBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The MSBuild builder encodes the most common way of building software with Mircosoft’s MSBuild tool. It has two phases that can be overridden, if need be:

It is usually necessary to override the install() phase as many packages with MSBuild systems neglect to provide an install target. The default install phase will attempt to invoke an install target from MSBuild. If none exists, this will result in a build failure

For a finer tuning you may override:

Method

Purpose

build_targets

Specify msbuild targets for the build phase

install_targets

Specify msbuild targets for the install phase

build_directory()

Directory where the project sln/vcxproj is located

build(pkg: MSBuildPackage, spec: Spec, prefix: Prefix) None[source]

Run “msbuild” on the build targets specified by the builder.

property build_directory

Return the directory containing the MSBuild solution or vcxproj.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_targets: List[str]

Targets for make during the build() phase

define(msbuild_arg, value)[source]
define_targets(*targets)[source]
install(pkg: MSBuildPackage, spec: Spec, prefix: Prefix) None[source]

Run “msbuild” on the install targets specified by the builder. This is INSTALL by default

install_targets: List[str]

Targets for msbuild during the install() phase

msbuild_args()[source]

Define build arguments to MSbuild. This is an empty list by default. Individual packages should override to specify MSBuild args to command line PlatformToolset is already defined an can be controlled via the toolchain_version property

msbuild_install_args()[source]

Define install arguments to MSBuild outside of the INSTALL target. This is the same as msbuild_args by default.

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

property std_msbuild_args

Return common msbuild cl arguments, for now just toolchain

property toolchain_version

Return currently targeted version of MSVC toolchain Override this method to select a specific version of the toolchain or change selection heuristics. Default is whatever version of msvc has been selected by concretization

class spack_repo.builtin.build_systems.msbuild.MSBuildPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using Visual Studio project files or solutions.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Must be defined as a fallback for old specs that don’t have the build_system variant

define(msbuild_arg, value)[source]
dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.msbuild.define(msbuild_arg, value)[source]

spack_repo.builtin.build_systems.nmake module

class spack_repo.builtin.build_systems.nmake.NMakeBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The NMake builder encodes the most common way of building software with Mircosoft’s NMake tool. It has two phases that can be overridden, if need be:

It is usually necessary to override the install() phase as many packages with NMake systems neglect to provide an install target. The default install phase will attempt to invoke an install target from NMake. If none exists, this will result in a build failure

For a finer tuning you may override:

Method

Purpose

build_targets

Specify nmake targets for the build phase

install_targets

Specify nmake targets for the install phase

build_directory()

Directory where the project makefile is located

build(pkg: NMakePackage, spec: Spec, prefix: Prefix) None[source]

Run “nmake” on the build targets specified by the builder.

property build_directory

Return the directory containing the makefile.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_targets: List[str]

Targets for make during the build() phase

define(nmake_arg, value)[source]

Helper method to format arguments to nmake command line

property ignore_quotes

Control whether or not Spack warns about quoted arguments passed to build utilities. If this is True, spack will not warn about quotes. This is useful in cases with a space in the path or when build scripts require quoted arugments.

install(pkg: NMakePackage, spec: Spec, prefix: Prefix) None[source]

Run “nmake” on the install targets specified by the builder. This is INSTALL by default

install_targets: List[str]

Targets for make during the install() phase

property makefile_name

Name of the current makefile. This is currently an empty value. If a project defines this value, it will be used with the /f argument to provide nmake an explicit makefile. This is usefule in scenarios where there are multiple nmake files in the same directory.

property makefile_root

The relative path to the directory containing nmake makefile

This path is relative to the root of the extracted tarball, not to the build_directory. Defaults to the current directory.

nmake_args()[source]

Define build arguments to NMake. This is an empty list by default. Individual packages should override to specify NMake args to command line

nmake_install_args()[source]

Define arguments appropriate only for install phase to NMake. This is an empty list by default. Individual packages should override to specify NMake args to command line

override_env(var_name, new_value)[source]

Helper method to format arguments for overridding env variables on the nmake command line. Returns properly formatted argument

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

property std_nmake_args

Returns list of standards arguments provided to NMake Currently is only /NOLOGO

class spack_repo.builtin.build_systems.nmake.NMakePackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using a Makefiles.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Must be defined as a fallback for old specs that don’t have the build_system variant

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.octave module

class spack_repo.builtin.build_systems.octave.OctaveBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The octave builder provides the following phases that can be overridden:

  1. install()

build_system: str | None

Build system name. Must also be defined in derived classes.

install(pkg: OctavePackage, spec: Spec, prefix: Prefix) None[source]

Install the package from the archive file

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

setup_build_environment(env: EnvironmentModifications) None[source]

Sets up the build environment for a package.

This method will be called before the current package prefix exists in Spack’s store.

Parameters:

env – environment modifications to be applied when the package is built. Package authors can call methods on it to alter the build environment.

class spack_repo.builtin.build_systems.octave.OctavePackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for Octave packages. See https://www.gnu.org/software/octave/doc/v4.2.0/Installing-and-Removing-Packages.html for more information.

build_system_class: str

Used when reporting the build system to users

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.oneapi module

Common utilities for managing intel oneapi packages.

spack_repo.builtin.build_systems.oneapi.INTEL_MATH_LIBRARIES

Tuple of Intel math libraries, exported to packages

class spack_repo.builtin.build_systems.oneapi.IntelOneApiLibraryPackage(spec: Spec)[source]

Bases: IntelOneApiPackage

Base class for Intel oneAPI library packages.

Contains some convenient default implementations for libraries. Implement the method directly in the package if something different is needed.

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

header_directories(dirs)[source]
property headers
legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

property libs
licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

openmp_libs()[source]

Supply LibraryList for linking OpenMP

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

class spack_repo.builtin.build_systems.oneapi.IntelOneApiLibraryPackageWithSdk(spec: Spec)[source]

Bases: IntelOneApiLibraryPackage

Base class for Intel oneAPI library packages with SDK components.

Contains some convenient default implementations for libraries that expose functionality in sdk subdirectories. Implement the method directly in the package if something different is needed.

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

property headers
legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

property libs
licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

class spack_repo.builtin.build_systems.oneapi.IntelOneApiPackage(spec: Spec)[source]

Bases: Package

Base class for Intel oneAPI packages.

c
property component_dir

Subdirectory for this component in the install prefix.

property component_prefix

Path to component <prefix>/<component>/<version>.

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

property env_script_args

Additional arguments to pass to vars.sh script.

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

homepage: str | None | classproperty[str | None]

Package homepage where users can find more information about the package

install(spec, prefix)[source]
install_component(installer_path)[source]

Shared install method for all oneapi packages.

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

setup_run_environment(env: EnvironmentModifications) None[source]

Adds environment variables to the generated module file.

These environment variables come from running:

$ source {prefix}/{component}/{version}/env/vars.sh
splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

unresolved_libraries: List[str]

List of fnmatch patterns of library file names (specifically DT_NEEDED entries) that are not expected to be locatable in RPATHs. Generally this is a problem, and Spack install with config:shared_linking:strict will cause install failures if such libraries are found. However, in certain cases it can be hard if not impossible to avoid accidental linking against system libraries; until that is resolved, this attribute can be used to suppress errors.

static update_description(cls)[source]

Updates oneapi package descriptions with common text.

property v2_layout

Returns true if this version implements the v2 directory layout.

property v2_layout_versions

Version that implements the v2 directory layout.

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

class spack_repo.builtin.build_systems.oneapi.IntelOneApiStaticLibraryList(static_libs, dynamic_libs)[source]

Bases: LibraryList

Provides ld_flags when static linking is needed

Oneapi puts static and dynamic libraries in the same directory, so -l will default to finding the dynamic library. Use absolute paths, as recommended by oneapi documentation.

Allow both static and dynamic libraries to be supplied by the package.

property directories

Stable de-duplication of the directories where the files reside.

>>> l = LibraryList(["/dir1/liba.a", "/dir2/libb.a", "/dir1/libc.a"])
>>> l.directories
["/dir1", "/dir2"]
>>> h = HeaderList(["/dir1/a.h", "/dir1/b.h", "/dir2/c.h"])
>>> h.directories
["/dir1", "/dir2"]
Returns:

A list of directories

property ld_flags

Search flags + link flags

>>> l = LibraryList(["/dir1/liba.a", "/dir2/libb.a", "/dir1/liba.so"])
>>> l.ld_flags
"-L/dir1 -L/dir2 -la -lb"
Returns:

A joined list of search flags and link flags

Link flags for the libraries

>>> l = LibraryList(["/dir1/liba.a", "/dir2/libb.a", "/dir1/liba.so"])
>>> l.link_flags
"-la -lb"
Returns:

A joined list of link flags

property search_flags

Search flags for the libraries

>>> l = LibraryList(["/dir1/liba.a", "/dir2/libb.a", "/dir1/liba.so"])
>>> l.search_flags
"-L/dir1 -L/dir2"
Returns:

A joined list of search flags

spack_repo.builtin.build_systems.perl module

class spack_repo.builtin.build_systems.perl.PerlBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The perl builder provides four phases that can be overridden, if required:

The default methods use, in order of preference:
  1. Makefile.PL,

  2. Build.PL.

Some packages may need to override configure_args(), which produces a list of arguments for configure().

Arguments should not include the installation base directory.

build(pkg: PerlPackage, spec: Spec, prefix: Prefix) None[source]

Builds a Perl package.

property build_executable

Returns the executable method to build the perl package

property build_method

Searches the package for either a Makefile.PL or Build.PL.

Raises:

RuntimeError – if neither Makefile.PL nor Build.PL exist

build_system: str | None

Build system name. Must also be defined in derived classes.

build_time_test_callbacks: List[str]

Callback names for build-time test

check()[source]

Runs built-in tests of a Perl package.

configure(pkg: PerlPackage, spec: Spec, prefix: Prefix) None[source]

Run Makefile.PL or Build.PL with arguments consisting of an appropriate installation base directory followed by the list returned by configure_args().

configure_args()[source]

List of arguments passed to configure().

Arguments should not include the installation base directory, which is prepended automatically.

fix_shebang()[source]
install(pkg: PerlPackage, spec: Spec, prefix: Prefix) None[source]

Installs a Perl package.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Phases of a Perl package

class spack_repo.builtin.build_systems.perl.PerlPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages that are built using Perl.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

property skip_modules: Iterable[str]

Names of modules that should be skipped when running tests.

These are a subset of use_modules.

Returns:

List of strings of module names.

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

test_use()[source]

Test ‘use module’

property use_modules: Iterable[str]

Names of the package’s perl modules.

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.python module

class spack_repo.builtin.build_systems.python.PythonExtension(spec: Spec)[source]

Bases: PackageBase

add_files_to_view(view, merge_map, skip_if_exists=True)[source]

Given a map of package files to destination paths in the view, add the files to the view. By default this adds all files. Alternative implementations may skip some files, for example if other packages linked into the view already include the file.

Parameters:
  • view (spack.filesystem_view.FilesystemView) – the view that’s updated

  • merge_map (dict) – maps absolute source paths to absolute dest paths for all files in from this package.

  • skip_if_exists (bool) – when True, don’t link files in view when they already exist. When False, always link files, without checking if they already exist.

property bindir: str

Path to Python package’s bindir, bin on unix like OS’s Scripts on Windows

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Must be defined as a fallback for old specs that don’t have the build_system variant

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

property import_modules: Iterable[str]

Names of modules that the Python package provides.

These are used to test whether or not the installation succeeded. These names generally come from running:

>> import setuptools
>> setuptools.find_packages()

in the source tarball directory. If the module names are incorrectly detected, this property can be overridden by the package.

Returns:

List of strings of module names.

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

property skip_modules: Iterable[str]

Names of modules that should be skipped when running tests.

These are a subset of import_modules. If a module has submodules, they are skipped as well (meaning a.b is skipped if a is contained).

Returns:

List of strings of module names.

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

test_imports() None[source]

Attempts to import modules of the installed package.

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

class spack_repo.builtin.build_systems.python.PythonPackage(spec: Spec)[source]

Bases: PythonExtension

Specialized class for packages that are built using pip.

build_system_class: str

Used when reporting the build system to users

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

property headers: HeaderList
homepage: str | None | classproperty[str | None]

Package homepage where users can find more information about the package

install_time_test_callbacks

Callback names for install-time test

property libs: LibraryList
licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

list_url: str | None | classproperty[str | None]

Default list URL (place to find available versions)

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

pypi: str | None

Package name, version, and extension on PyPI

property python_spec: Spec

Get python-venv if it exists or python otherwise.

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

url: str | None | classproperty[str | None]
variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

class spack_repo.builtin.build_systems.python.PythonPipBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

property build_directory: str

The root directory of the Python package.

This is usually the directory containing one of the following files:

  • pyproject.toml

  • setup.cfg

  • setup.py

build_system: str | None

Build system name. Must also be defined in derived classes.

config_settings(spec: Spec, prefix: Prefix) Dict[str, object][source]

Configuration settings to be passed to the PEP 517 build backend.

Requires pip 22.1 or newer for keys that appear only a single time, or pip 23.1 or newer if the same key appears multiple times.

Parameters:
  • spec – Build spec.

  • prefix – Installation prefix.

Returns:

Possibly nested dictionary of KEY, VALUE settings.

global_options(spec: Spec, prefix: Prefix) Iterable[str][source]

Extra global options to be supplied to the setup.py call before the install or bdist_wheel command.

Deprecated in pip 23.1.

Parameters:
  • spec – Build spec.

  • prefix – Installation prefix.

Returns:

List of options.

install(pkg: PythonPackage, spec: Spec, prefix: Prefix) None[source]

Install everything from build directory.

install_options(spec: Spec, prefix: Prefix) Iterable[str][source]

Extra arguments to be supplied to the setup.py install command.

Requires pip 23.0 or older.

Parameters:
  • spec – Build spec.

  • prefix – Installation prefix.

Returns:

List of options.

install_time_test_callbacks: List[str]

Callback names for install-time test

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_long_methods: Tuple[str, ...]

Same as package_methods, but the signature is different

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

static std_args(cls) List[str][source]

spack_repo.builtin.build_systems.qmake module

class spack_repo.builtin.build_systems.qmake.QMakeBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The qmake builder provides three phases that can be overridden:

  1. qmake()

  2. build()

  3. install()

They all have sensible defaults and for many packages the only thing necessary will be to override qmake_args().

build(pkg: QMakePackage, spec: Spec, prefix: Prefix) None[source]

Make the build targets

property build_directory

The directory containing the *.pro file.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_time_test_callbacks: List[str]

Callback names for build-time test

check()[source]

Search the Makefile for a check: target and runs it if found.

install(pkg: QMakePackage, spec: Spec, prefix: Prefix) None[source]

Make the install targets

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

qmake(pkg: QMakePackage, spec: Spec, prefix: Prefix) None[source]

Run qmake to configure the project and generate a Makefile.

qmake_args()[source]

List of arguments passed to qmake.

class spack_repo.builtin.build_systems.qmake.QMakePackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using qmake.

For more information on the qmake build system, see: http://doc.qt.io/qt-5/qmake-manual.html

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.r module

class spack_repo.builtin.build_systems.r.RBuilder(pkg: PackageBase)[source]

Bases: GenericBuilder

The R builder provides a single phase that can be overridden:

It has sensible defaults, and for many packages the only thing necessary will be to add dependencies.

configure_args()[source]

Arguments to pass to install via --configure-args.

configure_vars()[source]

Arguments to pass to install via --configure-vars.

install(pkg, spec, prefix)[source]

Installs an R package.

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

class spack_repo.builtin.build_systems.r.RPackage(spec: Spec)[source]

Bases: Package

Specialized class for packages that are built using R.

For more information on the R build system, see: https://stat.ethz.ch/R-manual/R-devel/library/utils/html/INSTALL.html

GenericBuilder

alias of RBuilder

bioc: str | None
build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

cran: str | None
dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

git: str | None | classproperty[str | None]
homepage: str | None | classproperty[str | None]

Package homepage where users can find more information about the package

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

list_url: str | None | classproperty[str | None]

Default list URL (place to find available versions)

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

urls: List[str] | classproperty[List[str]]
variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.racket module

class spack_repo.builtin.build_systems.racket.RacketBuilder(pkg: PackageBase)[source]

Bases: Builder

The Racket builder provides an install phase that can be overridden.

property build_directory
build_system: str | None

Build system name. Must also be defined in derived classes.

build_time_test_callbacks: List[str]

Callback names for build-time test

install(pkg: RacketPackage, spec: Spec, prefix: Prefix) None[source]

Install everything from build directory.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

racket_name: str | None
property subdirectory
class spack_repo.builtin.build_systems.racket.RacketPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages that are built using Racket’s raco pkg install and raco setup commands.

build_system_class: str

Used when reporting the build system to users

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

homepage: str | None | classproperty[str | None]

Package homepage where users can find more information about the package

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

racket_name: str | None
requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.rocm module

class spack_repo.builtin.build_systems.rocm.ROCmLibrary(spec: Spec)[source]

Bases: PackageBase

Helpers for detecting ROCm versions from an external installation.

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Must be defined as a fallback for old specs that don’t have the build_system variant

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

classmethod determine_version(path)[source]
disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

classmethod version_from_rocm_version_h(path)[source]

Get ROCm version from <ROCM_PATH>/include/rocm-core/rocm_version.h

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

class spack_repo.builtin.build_systems.rocm.ROCmPackage(spec: Spec)[source]

Bases: PackageBase

Auxiliary class which contains ROCm variant, dependencies and conflicts and is meant to unify and facilitate its usage. Closely mimics CudaPackage.

Maintainers: dtaller

amdgpu_targets
asan_on(env: EnvironmentModifications)[source]
conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Must be defined as a fallback for old specs that don’t have the build_system variant

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

static hip_flags(amdgpu_target)[source]
legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.ruby module

class spack_repo.builtin.build_systems.ruby.RubyBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The Ruby builder provides two phases that can be overridden if required:

  1. build()

  2. install()

build(pkg: RubyPackage, spec: Spec, prefix: Prefix) None[source]

Build a Ruby gem.

build_system: str | None

Build system name. Must also be defined in derived classes.

install(pkg: RubyPackage, spec: Spec, prefix: Prefix) None[source]

Install a Ruby gem.

The ruby package sets GEM_HOME to tell gem where to install to.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

class spack_repo.builtin.build_systems.ruby.RubyPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for building Ruby gems.

build_system_class: str

This attribute is used in UI queries that need to know the build system base class

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.scons module

class spack_repo.builtin.build_systems.scons.SConsBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The Scons builder provides the following phases that can be overridden:

  1. build()

  2. install()

Packages that use SCons as a build system are less uniform than packages that use other build systems. Developers can add custom subcommands or variables that control the build. You will likely need to override build_args() to pass the appropriate variables.

build(pkg: SConsPackage, spec: Spec, prefix: Prefix) None[source]

Build the package.

build_args(spec, prefix)[source]

Arguments to pass to build.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_test()[source]

Run unit tests after build.

By default, does nothing. Override this if you want to add package-specific tests.

build_time_test_callbacks: List[str]

Callback names for build-time test

install(pkg: SConsPackage, spec: Spec, prefix: Prefix) None[source]

Install the package.

install_args(spec, prefix)[source]

Arguments to pass to install.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_long_methods: Tuple[str, ...]

Same as package_methods, but the signature is different

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Phases of a SCons package

class spack_repo.builtin.build_systems.scons.SConsPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages built using SCons.

See http://scons.org/documentation.html for more information.

build_system_class: str

To be used in UI queries that require to know which build-system class we are using

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.sip module

class spack_repo.builtin.build_systems.sip.SIPBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The SIP builder provides the following phases that can be overridden:

  • configure

  • build

  • install

The configure phase already adds a set of default flags. To see more options, run sip-build --help.

build(pkg: SIPPackage, spec: Spec, prefix: Prefix) None[source]

Build the package.

build_args()[source]

Arguments to pass to build.

build_directory
build_system: str | None

Build system name. Must also be defined in derived classes.

configure(pkg: SIPPackage, spec: Spec, prefix: Prefix) None[source]

Configure the package.

configure_args()[source]

Arguments to pass to configure.

install(pkg: SIPPackage, spec: Spec, prefix: Prefix) None[source]

Install the package.

install_args()[source]

Arguments to pass to install.

package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

class spack_repo.builtin.build_systems.sip.SIPPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages that are built using the SIP build system. See https://www.riverbankcomputing.com/software/sip/intro for more information.

build_system_class: str

Used when reporting the build system to users

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

property import_modules

Names of modules that the Python package provides.

These are used to test whether or not the installation succeeded. These names generally come from running:

>> import setuptools
>> setuptools.find_packages()

in the source tarball directory. If the module names are incorrectly detected, this property can be overridden by the package.

Returns:

list of strings of module names

Return type:

list

install_time_test_callbacks

Callback names for install-time testing

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

python(*args, **kwargs)[source]

The python Executable.

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

sip_module

Name of private sip module to install alongside package

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

test_imports()[source]

Attempts to import modules of the installed package.

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.sourceforge module

class spack_repo.builtin.build_systems.sourceforge.SourceforgePackage(spec: Spec)[source]

Bases: PackageBase

Mixin that takes care of setting url and mirrors for Sourceforge packages.

base_mirrors

List of Sourceforge mirrors used by Spack

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

sourceforge_mirror_path: str | None

Path of the package in a Sourceforge mirror

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

property urls
variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.sourceware module

class spack_repo.builtin.build_systems.sourceware.SourcewarePackage(spec: Spec)[source]

Bases: PackageBase

Mixin that takes care of setting url and mirrors for Sourceware.org packages.

base_mirrors

List of Sourceware mirrors used by Spack

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

sourceware_mirror_path: str | None

Path of the package in a Sourceware mirror

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

property urls
variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.waf module

class spack_repo.builtin.build_systems.waf.WafBuilder(pkg: PackageBase)[source]

Bases: BuilderWithDefaults

The WAF builder provides the following phases that can be overridden:

  • configure

  • build

  • install

These are all standard Waf commands and can be found by running:

$ python waf --help

Each phase provides a function <phase> that runs:

$ python waf -j<jobs> <phase>

where <jobs> is the number of parallel jobs to build with. Each phase also has a <phase_args> function that can pass arguments to this call. All of these functions are empty except for the configure_args function, which passes --prefix=/path/to/installation/prefix.

build(pkg: WafPackage, spec: Spec, prefix: Prefix) None[source]

Executes the build.

build_args()[source]

Arguments to pass to build.

property build_directory

The directory containing the waf file.

build_system: str | None

Build system name. Must also be defined in derived classes.

build_test()[source]

Run unit tests after build.

By default, does nothing. Override this if you want to add package-specific tests.

build_time_test_callbacks: List[str]
configure(pkg: WafPackage, spec: Spec, prefix: Prefix) None[source]

Configures the project.

configure_args()[source]

Arguments to pass to configure.

install(pkg: WafPackage, spec: Spec, prefix: Prefix) None[source]

Installs the targets on the system.

install_args()[source]

Arguments to pass to install.

install_test()[source]

Run unit tests after install.

By default, does nothing. Override this if you want to add package-specific tests.

install_time_test_callbacks: List[str]
package_attributes: Tuple[str, ...]

Names associated with package attributes in the old build-system format

package_methods: Tuple[str, ...]

Names associated with package methods in the old build-system format

phases: Tuple[str, ...]

Sequence of phases. Must be defined in derived classes

python(*args, **kwargs)[source]

The python Executable.

waf(*args, **kwargs)[source]

Runs the waf Executable.

class spack_repo.builtin.build_systems.waf.WafPackage(spec: Spec)[source]

Bases: PackageBase

Specialized class for packages that are built using the Waf build system. See https://waf.io/book/ for more information.

build_system_class: str

Used when reporting the build system to users

conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

default_buildsystem: str

Legacy buildsystem attribute used to deserialize and install old specs

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

legacy_buildsystem: str

Use default_buildsystem instead of this attribute, which is deprecated

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

spack_repo.builtin.build_systems.xorg module

class spack_repo.builtin.build_systems.xorg.XorgPackage(spec: Spec)[source]

Bases: PackageBase

Mixin that takes care of setting url and mirrors for x.org packages.

base_mirrors
conflicts: Dict[Spec, List[Tuple[Spec, str | None]]]

Class level dictionary populated by conflicts() directives

dependencies: Dict[Spec, Dict[str, Dependency]]

Class level dictionary populated by depends_on() and extends() directives

disable_redistribute: Dict[Spec, DisableRedistribute]

Class level dictionary populated by redistribute() directives

extendees: Dict[str, Tuple[Spec, Spec]]

Class level dictionary populated by extends() directives

licenses: Dict[Spec, str]

Class level dictionary populated by license() directives

patches: Dict[Spec, List[Patch]]

Class level dictionary populated by patch() directives

provided: Dict[Spec, Set[Spec]]

Class level dictionary populated by provides() directives

provided_together: Dict[Spec, List[Set[str]]]

Class level dictionary populated by provides() directives

requirements: Dict[Spec, List[Tuple[Tuple[Spec, ...], str, str | None]]]

Class level dictionary populated by requires() directives

resources: Dict[Spec, List[Resource]]

Class level dictionary populated by resource() directives

splice_specs: Dict[Spec, Tuple[Spec, None | str | List[str]]]

Class level dictionary populated by can_splice() directives

property urls
variants: Dict[Spec, Dict[str, Variant]]

Class level dictionary populated by variant() directives

versions: Dict[StandardVersion, Dict[str, Any]]

Class level dictionary populated by version() directives

xorg_mirror_path: str | None

Path of the package in a x.org mirror