Notes on the Fedora Extras version of ATLAS
by Quentin Spencer
updated: October 4, 2005
Because ATLAS relies on compile-time optimizations to obtain improved
performance over BLAS and LAPACK, the resulting binaries are closely
tied to the hardware on which they are compiled, and can likely result
in very poor performance on other hardware. For this reason,
including a package like ATLAS in Fedora requires some compromises.
Firstly, a binary ATLAS package must perform reasonably well on the
entire range of hardware on which it could potentially be installed.
Optimizing ATLAS for the most modern hardware can result in
significant performance penalties for users using the same package on
older hardware. Second, building from the same source package must
result in identical binaries for any computer of a particular
architecture. This is because the binaries installed on a user's
computer are built on a computer in the Fedora Extras build system,
which will have hardware different from the end user's hardware, and
quite possibly different from other available hardware in the build
system.
The Debian project was probably the first to distribute precompiled
ATLAS libraries. Camm Maguire, the creator of the Debian ATLAS
package, has found a way of dealing with both of these challenges.
The system essentially consists of "recorded builds" where ATLAS is
compiled on particular hardware such that the resulting binary has
reasonable performance on a range of hardware. The build parameters
from the resulting optimization are stored in the source package and
"played back" when a binary package is built. This has the additional
advantage that builds using this method can be completed in minutes
rather than the hours required to complete the standard compile-time
empirical tests.
A significant amount of research has been done to find the best
compile parameters for the Debian packages, so the most sensible
approach to making a package for Fedora is to make use of that
research by applying the Debian patches directly to the source and to
emulate the same build process. The spec file for this package does
exactly that. The result is a set of libraries that will not
necessarily achieve optimal performance on any given hardware but
should still offer significant performance gains over the reference
BLAS and LAPACK libraries on most hardware. The binary package
includes the atlas libraries as well as binary-compatible blas and
lapack libraries that should work as a drop-in replacement for the
standard ones (they are installed in /usr/lib/atlas rather than
/usr/lib).
This package is designed to build RPMs that are identical regardless
of where they are compiled and that provide reasonable performance on
a wide range of hardware. For users who want optimal performance on
particular hardware, custom RPMs can be built from the source package
by setting the RPM macro "enable_custom_atlas" to a value of 1. This
can be done from the command line as in the following example:
rpmbuild -D "enable_custom_atlas 1" --rebuild atlas-3.6.0-1.src.rpm
This command will create an atlas package called atlas-custom, which
installs the optimized atlas libraries in /usr/lib/custom and the
blas-compatible libraries in /usr/lib/atlas/custom. It should also be
noted here that because custom compilation enables all compile-time
empirical tests instead of simply replaying a previous build, the
compilation time will be considerably longer, and can require several
hours to complete, depending on the hardware.