spack.build_systems package

Submodules

spack.build_systems.autotools module

class spack.build_systems.autotools.AutotoolsPackage(spec)

Bases: spack.package.PackageBase

Specialized class for packages that are built using GNU Autotools

This class provides four phases that can be overridden: - autoreconf - configure - build - install

They all have sensible defaults and for many packages the only thing necessary will be to override configure_args

Additionally, you may specify make targets for build and install phases by overriding build_targets and install_targets

autoreconf(spec, prefix)

Not needed usually, configure should be already there

build(spec, prefix)

Make the build targets

build_system_class = 'AutotoolsPackage'
build_targets = []
check()

Default test : search the Makefile for targets test and check and run them if found.

configure(spec, prefix)

Runs configure with the arguments specified in configure_args and an appropriately set prefix

configure_args()

Method to be overridden. Should return an iterable containing all the arguments that must be passed to configure, except –prefix

do_patch_config_guess()

Some packages ship with an older config.guess and need to have this updated when installed on a newer architecture.

install(spec, prefix)

Make the install targets

install_targets = ['install']
is_configure_or_die()

Checks the presence of a configure file after the autoreconf phase

patch()

Perform any required patches.

patch_config_guess = True
phases = ['autoreconf', 'configure', 'build', 'install']

spack.build_systems.cmake module

class spack.build_systems.cmake.CMakePackage(spec)

Bases: spack.package.PackageBase

Specialized class for packages that are built using cmake

This class provides three phases that can be overridden: - cmake - build - install

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

build(spec, prefix)

The usual make after cmake

build_directory()

Override to provide another place to build the package

build_system_class = 'CMakePackage'
build_type()

Override to provide the correct build_type in case a complex logic is needed

check()

Default test : search the Makefile for the target test and run them if found.

cmake(spec, prefix)

Run cmake in the build directory

cmake_args()

Method to be overridden. Should return an iterable containing all the arguments that must be passed to configure, except: - CMAKE_INSTALL_PREFIX - CMAKE_BUILD_TYPE

install(spec, prefix)

...and the final make install after cmake

phases = ['cmake', 'build', 'install']
root_cmakelists_dir()

Directory where to find the root CMakeLists.txt

std_cmake_args

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

spack.build_systems.makefile module

class spack.build_systems.makefile.MakefilePackage(spec)

Bases: spack.package.PackageBase

Specialized class for packages that are built using editable Makefiles

This class provides three phases that can be overridden: - edit - build - install

It is necessary to override the ‘edit’ phase, while ‘build’ and ‘install’ have sensible defaults.

build(spec, prefix)

Default build phase : call make passing build_args

build_directory()

Directory where the main Makefile is located

build_system_class = 'MakefilePackage'
build_targets = []
edit(spec, prefix)

This phase cannot be defaulted for obvious reasons...

install(spec, prefix)

Default install phase : call make passing install_args

install_targets = ['install']
phases = ['edit', 'build', 'install']

Module contents