This package provides the Cray implementation of version 2.0 of the PowerAPI Specification.
The source RPM package and tar-file have been configured so that the source can be compiled on a Cray XC system login node using either:
- The
rpmbuild
command to produce binary RPM packages for installation into node images. - The
configure
andmake
commands to produce binaries without packaging them in binary RPM packages.
It is recommended that the rpmbuild
command be used to build binary
RPM packages that are then installed into images used to boot the
compute nodes. Doing so will ensure that the presence of the PowerAPI
binaries is recognized as part of the configuration should the
assistance of Cray support be required.
Additional information about the PowerAPI can be found at the project website project is located at http://powerapi.sandia.gov
- Familiarity with:
- Creating and copying node images.
- Installing RPMs into node images.
- Creating bootable images for the login and compute nodes.
- Building is done on the login node of a Cray XC system.
- Building is done using a non-root user account.
- An RPM spec file, usually referred to as a spec file, contains build and installation directives for building binary RPM packages.
- The compressed tar file of the source code and spec file is called a tarball.
- Source code from Cray is provided as a tarball
- Building the source code will be done using the
rpmbuild
tool.- It is possible to build binaries from the source without using
rpmbuild
but this document limits the build description to the use ofrpmbuild
.
- It is possible to build binaries from the source without using
- Binary and source RPM packages produced from the Cray PowerAPI source
code, when rebuilt on an XC login node are:
- cray-libpowerapi0-1.0-${B}.x86_64.rpm
- The runtime shared libraries and modules.
- cray-libpowerapi-devel-1.0-${B}.x86_64.rpm
- The development libraries and include files.
- cray-powerapi-powerapid-1.0-${B}.x86_64.rpm
- The
powerapid
control daemon and system startup files.
- The
- cray-powerapi-cnctl-1.0-${B}.x86_64.rpm
- The compute node control command for power management
- cray-powerapi-pwrcmd-1.0-${B}.x86_64.rpm
- An application to demonstrate and test library capabilities
- cray-powerapi-test-1.0-${B}.x86_64.rpm
- Regression testing suite
- cray-powerapi-1.0-${B}.src.rpm
- The source RPM package
- cray-libpowerapi0-1.0-${B}.x86_64.rpm
The PowerAPI package should be installed per instructions for installing third-party software on Cray XC systems.
Please consult the document, XC(tm) Series System Administration Guide (CLE 6.0 UP02) S-2392, sub-section Install Third-Party Software With a Custom Image
To allow compilation of applications and commands that use the PowerAPI library, the development package must be installed into the login node image.
The development package is the RPM file with the name:
- cray-libpowerapi0-1.0-${B}.x86_64.rpm
- cray-libpowerapi-devel-1.0-${B}.x86_64.rpm
If using a netroot image for the login node, the above packages need to be installed into the netroot image.
The following packages must be installed into the compute node image:
- cray-libpowerapi0-1.0-${B}.x86_64.rpm
- cray-powerapi-cnctl-1.0-${B}.x86_64.rpm
- cray-powerapi-powerapid-1.0-${B}.x86_64.rpm
- cray-powerapi-pwrcmd-1.0-${B}.x86_64.rpm
- cray-powerapi-test-1.0-${B}.x86_64.rpm
If using a netroot image for the compute nodes, the above packages need to be installed into the netroot image.
Building the source code consists of the following steps:
- Setup the build environment.
- Update the configuration for the build environment.
- Configure the build environment.
- Compile the source.
- Package files for installation.
Building using the rpmbuild
tool performs all of the above steps.
Options can be specified to only perform a subset of those steps. It is
possible to build the source code without using rpmbuild
, but this
document only describes the use of rpmbuild
.
The following macros (defines) are useful. They will vary depending on the specific source file you receive.
cray-powerapi-${V}-${B}.src.rpm
^^^^ (version)
^^^^ (build)
version: ${V} is the software version, as provided by the spec file
build: ${B} is the build number pair generated by Cray's build system
The source RPM rebuild option uses the standard RPM build process. This
places all sources in standard locations in ~/rpmbuild
.
If you are logged in as root, the standard location will instead be
/usr/src/packages
.
The following assumes you are a normal user (not root).
- Install the source code.
$ rpm -Uvh --force cray-powerapi-${V}-${B}.src.rpm
- Change directory to the location of the spec file.
$ cd ~/rpmbuild/SPECS
- Use one of the following commands to build the code.
$ rpmbuild -ba cray-powerapi.spec
$ rpmbuild -bb cray-powerapi.spec
$ rpmbuild -bc cray-powerapi.spec
$ rpmbuild -bs cray-powerapi.spec
These are described in detail below.
This option may be useful if you want to create a buildable tarball. The tarball supplied needs to be modified to contain the spec file, as follows.
- Extract the files from the source RPM file
$ rpm2cpio cray-powerapi-${V}-${B}.src.rpm | cpio -idmv
This will provide the compressed tar file and the spec file.
- Modify the tarball
$ bzip2 -d cray-powerapi-${V}.tar.bz2
$ tar -f cray-powerapi-${V}.tar --delete cray-powerapi.spec 2>/dev/null
$ tar -f cray-powerapi-${V}.tar --update cray-powerapi.spec
$ bzip2 cray-powerapi-${V}.tar
- Use one of the following commands to build the code.
$ rpmbuild -ta cray-powerapi-${V}.tar.bz2
$ rpmbuild -tb cray-powerapi-${V}.tar.bz2
$ rpmbuild -tc cray-powerapi-${V}.tar.bz2
$ rpmbuild -ts cray-powerapi-${V}.tar.bz2
These are described in detail below.
To build all of the binary and source RPM packages:
$ rpmbuild -ba cray-powerapi.spec (source RPM rebuild)
- or -
$ rpmbuild -ta cray-powerapi-${V}.tar.bz2 (tarball rebuild)
This will create the ~/rpmbuild
directory if it does not already
exist, installing the source tarball into the SOURCES subdirectory and
the spec file into the SPECS subdirectory. The command will then unpack
the source tarball and build the source per the spec file directives to
produce binary and source RPM packages. The binary RPM packages will be
copied into the ~/rpmbuild/RPMS/x86_64
directory and the source RPM
package will be copied into the ~/rpmbuild/SRPMS
directory.
You should see:
...
Wrote: ${HOME}/rpmbuild/SRPMS/cray-powerapi-${V}-${B}.src.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-libpowerapi-devel-${V}-${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-libpowerapi0-${V}-${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-cnctl-${V}-${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-powerapid-${V}-${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-pwrcmd-${V}-${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-test-${V}-${B}.x86_64.rpm
To only build the binary RPM packages, without the source RPM package:
$ rpmbuild -bb cray-powerapi.spec (source RPM rebuild)
- or -
$ rpmbuild -tb cray-powerapi-${V}.tar.bz2 (tarball rebuild)
This will create the ~/rpmbuild
directory if it does not already
exist, installing the source tarball into the SOURCES subdirectory and
the spec file into the SPECS subdirectory. The command will then unpack
the source tarball and build the source per the spec file directives to
produce binary RPM packages that will be copied into the directory
~/rpmbuild/RPMS/x86_64
.
You should see:
...
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-libpowerapi-devel-${V}-${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-libpowerapi0-${V}.${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-cnctl-${V}.${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-powerapid-${V}.${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-pwrcmd-${V}.${B}.x86_64.rpm
Wrote: ${HOME}/rpmbuild/RPMS/x86_64/cray-powerapi-test-${V}.${B}.x86_64.rpm
To only build the source RPM package, without the binary RPM packages:
$ rpmbuild -bs cray-powerapi.spec (source RPM rebuild)
- or -
$ rpmbuild -ts cray-powerapi-${V}.tar.bz2 (tarball rebuild)
This will create the ~/rpmbuild
directory if it does not already
exist, installing the source tarball into the SOURCES subdirectory and
the spec file into the SPECS subdirectory. The command will then
produce a source RPM package. The source RPM package will be copied into
the ~/rpmbuild/SRPMS
directory.
You should see:
...
Wrote: ${HOME}/rpmbuild/SRPMS/cray-powerapi-${V}.ari.src.rpm
To only perform the source compilation phase of the build:
$ rpmbuild -tc cray-powerapi.spec (source RPM rebuild)
- or -
$ rpmbuild -tc cray-powerapi-${V}.tar.bz2 (tarball rebuild)
This will skip the steps involved in packaging the binary and source RPM
packages. It will create the ~/rpmbuild
directory if it does not
already exist, installing the source tarball into the SOURCES
subdirectory and the spec file into the SPECS subdirectory.