Confluence will be unusable 23-July-2024 at 06:00 due to a Crowd upgrade.
This page describes how all software packages are built, using the pspackage
class. But if you are building a Python package, see Building Python Packages as well. And if you are building a package that uses the "./configure; make; make install" pattern, see Building Unix Packages.
When the packages for a release are built, ps_make does the following:
If an individual package build fails, ps_make simply goes to the next package... unless that package is missing a dependency (due to a failed build).
pspackage
classThe ps_make program (and others) use the pspackage
class to represent information about each package, including:
'atlas'
)'3.8.3'
)'lapack/3.2.1'
)To build an individual package, the ps_make program calls package.build_and_install()
. This method does the following:
package.do_build_and_install()
method – this does all the actual compiling and building.RPATH
, symbolic links to absolute paths, etc. to fix relocation problems.'.atlas_is_installed'
) is created in the install directory. If this file is not present during the next run of ps_make, it will assume the package was not successfully built and will attempt to rebuild it.The pspackage
class provides some methods that it doesn't use directly but are for use by subclasses. The most important of these is package.extract()
. This method looks for a corresponding zip, bzip2, or compressed tar file in the sources/tarball directory and uses the corresponding tool to extract the sources. It assumes that the tarball (zip file, etc) starts with the package name.
There are some helper Python modules that provide small wrappers around the Python os
and subprocess
modules.
psrun
moduleThe psrun module has one function:
run(command, continue_on_error = False)
which can be run in two ways.
In the first case, we are running the command as one does in a shell script without redirection. We don't need to capture the output; it can be simply printed to the console. We expect the command to succeed; if it doesn't, we want an exception to be thrown. In this case, we will do e.g.:
psrun.run('make all')
Note that in this case the command may be long running. That's part of the reason for letting output be printed directly to the console. If we save the output in a Python variable, then (1) the Python process might run out of memory, and (2) there will be no indication from ps_build
that anything is happening.
In the second case, we are running the command so that we can process its output. In this case, we will do e.g.:
(retcode, error, output) = psrun.run('uname -s', True)
In this case, if the command fails, we don't want to throw an exception, as we may have alternative commands to try. Instead, we will test the value of retcode. If it is zero then the command succeeded.
psenv
moduleThe psenv
module provides the following functions:
It also provides the following functions for dealing with colon-separated paths (e.g. PATH
, PYTHONPATH
, and LD_LIBRARY_PATH
).
PATH
to the minimalist '/usr/local/bin:/usr/bin:/bin'
and unset PYTHONPATH and LD_LIBRARY_PATH.psfs
moduleThe psfs
module provides the following functions: