[Numpy-discussion] Building Numeric+numarray with atals on Fedora Core 4
Chris.Barker at noaa.gov
Thu Jul 21 17:07:24 CDT 2005
It looks like I'm managing to maintain this thread all by myself!
I thought I'd post this final note, so that anyone searching the
archives can see my solution. It's a bit ugly, but it seems to work.
First the summary:
I'm trying to build both Numeric and numarray on a new installation of
Linux Fedora Core 4 on a Pentium M laptop.
Fedora helpfully provides a full lapack and blas rpms, but they don't
appear to be at all optimized. In fact, when I used them, it was slower
than the built-in lapack-lite.
I haven't been able to find a complete atlas+lapack distribution for
Fedora core 4 (or anything like it), so this is what I did:
Got the atlas binaries from the atlas site:
NOTE: these are pretty old...should I be using the 3.7.10 unstable
I then merged these with the Fedora lapack (should be in
/usr/lib/liblapack.a) by following the directions in the atlas README:
"""******** GETTING A FULL LAPACK LIB **************************
ATLAS does not provide a full lapack library. However, there is a
to get ATLAS to provide its faster LAPACK routines to a full LAPACK library.
ATLAS's internal routines are distinct from LAPACK's, so it is safe to
ATLAS's LAPACK routines directly into a netlib-style LAPACK library.
First, obtain the LAPACK src from netlib and build the LAPACK library as
normal. Then, in this directory (where you should have a liblapack.a),
issue the following commands:
ar x ../liblapack.a
cp <your LAPACK path & lib> ../liblapack.a
ar r ../liblapack.a *.o
rm -rf tmp
Just linking in ATLAS's liblapack.a first will not get you the best LAPACK
performance, mainly because LAPACK's untuned ILAENV will be used instead
of ATLAS's tuned one.
I installed them in:
Then I set up the numarray and Numeric build process to use them. For
numarray, I edited cfg_packages.py, and put in:
USE_LAPACK = True
near the top, and edited on of the blocks to read:
print "Adding paths for lapack/blas"
lapack_dirs = ['/usr/local/lib/atlas']
lapack_libs = ['lapack', 'cblas', 'f77blas', 'atlas', 'g2c',
lapack_include_dirs += ['/usr/local/include/atlas/']
NOTE: the gfortran lib is something I hadn't seen before, but I needed
it to resolve missing symbols. I'm guess that the fedora lapack used
then a setup.py build, setup.py install, and it seems to work, and is
about twice as fast as lapack-lite on my simple test case. In the past,
I got about a 7 times speed-up with the atlas that I got from Gentoo.
I'm a bit disappointed, but it's OK, and I'm not really doing anything
where it matters much.
For Numeric, I edited customize.py:
# Using ATLAS blas in /usr/local
use_system_lapack = 1
lapack_library_dirs = ['/usr/local/lib/atlas']
lapack_libraries = ['lapack', 'cblas', 'f77blas', 'atlas', 'g2c',
And that did it.
Christopher Barker, Ph.D.
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the Numpy-discussion