taucmdr.cf.software.installation module

Software installation management.

class taucmdr.cf.software.installation.AutotoolsInstallation(name, title, sources, target_arch, target_os, compilers, repos, commands, libraries, headers)[source]

Bases: taucmdr.cf.software.installation.MakeInstallation

Base class for installations that follow the GNU Autotools installation process.

The GNU Autotools installation process is::
./configure [options] make [flags] all [options] make [flags] install [options]
configure(flags, env=None)[source]

Invoke configure.

Parameters:flags (list) – Command line flags to pass to configure.
Raises:SoftwarePackageError – Configuration failed.
installation_sequence()[source]
class taucmdr.cf.software.installation.CMakeInstallation(name, title, sources, target_arch, target_os, compilers, repos, commands, libraries, headers)[source]

Bases: taucmdr.cf.software.installation.MakeInstallation

Base class for installations that follow the CMake installation process.

The CMake installation process is::
cmake [options] make [flags] all [options] make [flags] install [options]
cmake(flags)[source]

Invoke cmake.

Parameters:flags (list) – Command line flags to pass to cmake.
Raises:SoftwarePackageError – Configuration failed.
installation_sequence()[source]
class taucmdr.cf.software.installation.Installation(name, title, sources, target_arch, target_os, compilers, repos, commands, libraries, headers)[source]

Bases: object

Encapsulates a software package installation.

name

str

The package name, lowercase, alphanumeric with underscores. All packages have a corresponding taucmdr.cf.software.<name>_installation module.

title

str

Human readable name of the software package, e.g. ‘TAU Performance System’ or ‘Score-P’.

src

str

Path or URL to a source archive file, or a path to a directory where the software is installed, or the special keyword ‘download’.

target_arch

str

Target architecture name.

target_os

str

Target operating system name.

compilers

InstalledCompilerSet

Compilers to use if software must be compiled.

verify_commands

list

List of commands that are present in a valid installation.

verify_libraries

list

List of libraries that are present in a valid installation.

verify_headers

list

List of header files that are present in a valid installation.

_prepare_src(reuse_archive=True)[source]

Prepares source code for installation.

Acquires package source code archive file via download or file copy, unpacks the archive, and verifies that required paths exist.

Parameters:reuse_archive (bool) – If True, attempt to reuse archive files.
Returns:The path to the unpacked source code files.
Return type:str
Raises:ConfigurationError – The source code couldn’t be acquired or unpacked.
acquire_source(reuse_archive=True)[source]

Acquires package source code archive file via download or file copy.

If the package is configured to use an existing installation as the source then this routine does nothing.

Parameters:reuse_archive (bool) – If True don’t download, just confirm that the archive exists.
Returns:Absolute path to the source archive.
Return type:str
Raises:ConfigurationError – Package source code not provided or couldn’t be acquired.
add_dependency(name, sources, *args, **kwargs)[source]

Adds a new package to the list of packages this package depends on.

Parameters:
  • name (str) – The name of the package. There must be a corresponding taucmdr.cf.software.<name>_installation module.
  • sources (dict) – Packages sources as strings indexed by package names as strings. A source may be a path to a directory where the software has already been installed, or a path to a source archive file, or the special keyword ‘download’.
bin_path
compiletime_config(opts=None, env=None)[source]

Configure compilation environment to use this software package.

Returns command line options and environment variables required by this software package when it is used to compile other software packages. The default behavior, to be overridden by subclasses as needed, is to prepend self.bin_path to the PATH environment variable.

Parameters:
  • opts (list) – Optional list of command line options.
  • env (dict) – Optional dictionary of environment variables.
Returns:

opts, env updated for the new environment.

Return type:

tuple

include_path
install(force_reinstall=False)[source]

Execute the installation sequence in a sanitized environment.

Modifies the system by building and installing software.

Parameters:force_reinstall (bool) – If True, reinstall even if the software package passes verification.
Raises:SoftwarePackageError – Installation failed.
install_prefix
installation_sequence()[source]
lib_path
runtime_config(opts=None, env=None)[source]

Configure runtime environment to use this software package.

Returns command line options and environment variables required by this software package when other software packages depending on it execute. The default behavior, to be overridden by subclasses as needed, is to prepend self.bin_path to the PATH environment variable and self.lib_path to the system library path (e.g. LD_LIBRARY_PATH).

Parameters:
  • opts (list) – Optional list of command line options.
  • env (dict) – Optional dictionary of environment variables.
Returns:

opts, env updated for the new environment.

Return type:

tuple

set_group(gid=None)[source]

Sets the group for all files in the installation.

Parameters:gid (int) – Group ID number. If not given the use the group ID of the folder containing the installation.
uid
uid_items()[source]

List items affecting this installation’s UID.

Most packages only care about changes in source archive, target, or C/C++ compilers. More sensitive packages (e.g. Score-P or TAU) can override this function.

Returns:An ordered list of items affecting this installation’s UID. Changing the order of this list will change the UID.
Return type:list
verify()[source]

Check if the installation at installation_prefix is valid.

A valid installation provides all expected files and commands. Subclasses may wish to perform additional checks.

Raises:SoftwarePackageError – Describs why the installation is invalid.
class taucmdr.cf.software.installation.MakeInstallation(name, title, sources, target_arch, target_os, compilers, repos, commands, libraries, headers)[source]

Bases: taucmdr.cf.software.installation.Installation

Base class for installations that follows the process: make [flags] all [options] make [flags] install [options]

installation_sequence()[source]
make(flags)[source]

Invoke make.

Parameters:flags (list) – Command line flags to pass to make.
Raises:SoftwarePackageError – Compilation failed.
make_install(flags)[source]

Invoke make install.

Parameters:flags (list) – Command line flags to pass to make.
Raises:SoftwarePackageError – Configuration failed.
taucmdr.cf.software.installation.new_os_environ()[source]
taucmdr.cf.software.installation.parallel_make_flags(nprocs=None)[source]

Flags to enable parallel compilation with make.

Parameters:ncores (int) – Number of parallel processes to use. Default is one less than the number of CPU cores.
Returns:Command line arguments to pass to make.
Return type:list