Hi David,
I performed the above check, and sure enough, Numeric
is --not-- linked to the ATLAS libraries.
I followed each of your steps outlined above, and Numeric
still is not linking to the ATLAS libraries.
My setup.py file is attached below.
Thanks ,
Daran
--#!/usr/bin/env python
# To use:
# python setup.py install
# or:
# python setup.py bdist_rpm (you'll end up with RPMs in dist)
#
import os, sys, string, re
from glob import glob
if not hasattr(sys, 'version_info') or sys.version_inf o <
(2,0,0,'alpha', 0):
raise SystemExit, "Python 2.0 or later required to build Numeric."
import distutils
from distutils.core import setup, Extension
# Get all version numbers
execfile(os.pat h.join('Lib','n umeric_version. py'))
numeric_version = version
execfile(os.pat h.join('Package s', 'MA', 'Lib', 'MA_version.py' ))
MA_version = version
headers = glob (os.path.join ("Include","Num eric","*.h"))
extra_compile_a rgs = [] # You could put "-O4" etc. here.
mathlibs = ['m']
define_macros = [('HAVE_INVERSE_ HYPERBOLIC',Non e)]
undef_macros = []
# You might need to add a case here for your system
if sys.platform in ['win32']:
mathlibs = []
define_macros = []
undef_macros = ['HAVE_INVERSE_H YPERBOLIC']
elif sys.platform in ['mac', 'beos5']:
mathlibs = []
# delete all but the first one in this list if using your own
LAPACK/BLAS
sourcelist = [os.path.join('S rc', 'lapack_litemod ule.c')]
# set these to use your own BLAS;
library_dirs_li st = ['/d2/lib/atlas']
libraries_list = ['lapack', 'ptcblas', 'ptf77blas', 'atlas', 'g2c']
# set to true (1), if you also want BLAS optimized
matrixmultiply/dot/innerproduct
use_dotblas = 1
include_dirs = ['/d2/include']
# You may need to set this to find cblas.h
# e.g. on UNIX using ATLAS this should be
['/usr/include/atlas']
extra_link_args = []
# for MacOS X to link against vecLib if present
VECLIB_PATH = '/System/Library/Frameworks/vecLib.framewor k'
if os.path.exists( VECLIB_PATH):
extra_link_args = ['-framework', 'vecLib']
include_dirs = [os.path.join(VE CLIB_PATH, 'Headers')]
# The packages are split in this way to allow future optional inclusion
# Numeric package
packages = ['']
package_dir = {'': 'Lib'}
include_dirs.ap pend('Include')
ext_modules = [
Extension('_num py',
[os.path.join('S rc', '_numpymodule.c '),
os.path.join('S rc', 'arrayobject.c' ),
os.path.join('S rc', 'ufuncobject.c' )],
extra_compile_a rgs = extra_compile_a rgs),
Extension('mult iarray',
[os.path.join('S rc', 'multiarraymodu le.c')],
extra_compile_a rgs = extra_compile_a rgs),
Extension('umat h',
[os.path.join('S rc', 'umathmodule.c' )],
libraries = mathlibs,
define_macros = define_macros,
undef_macros = undef_macros,
extra_compile_a rgs = extra_compile_a rgs),
Extension('arra yfns',
[os.path.join('S rc', 'arrayfnsmodule .c')],
extra_compile_a rgs = extra_compile_a rgs),
Extension('ranl ib',
[os.path.join('S rc', 'ranlibmodule.c '),
os.path.join('S rc', 'ranlib.c'),
os.path.join('S rc', 'com.c'),
os.path.join('S rc', 'linpack.c')],
extra_compile_a rgs = extra_compile_a rgs),
Extension('lapa ck_lite', sourcelist,
library_dirs = library_dirs_li st,
libraries = libraries_list,
extra_link_args = extra_link_args ,
extra_compile_a rgs = extra_compile_a rgs)
]
# add FFT package (optional)
packages.append ('FFT')
package_dir['FFT'] = os.path.join('P ackages','FFT', 'Lib')
include_dirs.ap pend(os.path.jo in('Packages',' FFT','Include') )
ext_modules.app end(Extension(' FFT.fftpack',
[os.path.join('P ackages','FFT', 'Src',
'fftpackmodule. c'),
os.path.join('P ackages', 'FFT', 'Src',
'fftpack.c')],
extra_compile_a rgs = extra_compile_a rgs))
# add MA package (optional)
packages.append ('MA')
package_dir['MA'] = os.path.join('P ackages', 'MA', 'Lib')
# add RNG package (optional)
packages.append ('RNG')
packages.append ('RNG')
package_dir['RNG'] = os.path.join('P ackages', 'RNG', 'Lib')
include_dirs.ap pend(os.path.jo in('Packages', 'RNG', 'Include'))
ext_modules.app end(Extension(' RNG.RNG',
[os.path.join('P ackages', 'RNG', 'Src',
'RNGmodule.c'),
os.path.join('P ackages', 'RNG', 'Src',
'ranf.c'),
os.path.join('P ackages', 'RNG', 'Src',
'pmath_rng.c')],
extra_compile_a rgs = extra_compile_a rgs))
# add dotblas package (optional)
if use_dotblas:
packages.append ('dotblas')
package_dir['dotblas'] = os.path.join('P ackages', 'dotblas',
'dotblas')
ext_modules.app end(Extension(' _dotblas',
[os.path.join('P ackages', 'dotblas',
'dotblas', '_dotblas.c')],
library_dirs = library_dirs_li st,
libraries = libraries_list,
extra_compile_a rgs=extra_compi le_args))
long_descriptio n = """
Numerical Extension to Python with subpackages.
The authors and maintainers of the subpackages are:
FFTPACK-3.1
maintainer = "Numerical Python Developers"
maintainer_emai l = "nu************ **@lists.source forge.net"
description = "Fast Fourier Transforms"
url = "http://numpy.sourcefor ge.net"
MA-%s
author = "Paul F. Dubois"
description = "Masked Array facility"
maintainer = "Paul F. Dubois"
maintainer_emai l = "du****@users.s f.net"
url = "http://sourceforge.net/projects/numpy"
RNG-3.1
author = "Lee Busby, Paul F. Dubois, Fred Fritsch"
maintainer = "Paul F. Dubois"
maintainer_emai l = "du****@users.s f.net"
description = "Cray-like Random number package."
""" % (MA_version, )
# Oops, another bug in Distutils!?
# Write rpm_build.sh pointing to this python
rpm_build_text= """env CFLAGS="$RPM_OP T_FLAGS" %setup.py build\n""" %
sys.executable
rpm_script = open("rpm_build .sh", "w")
rpm_script.writ e(rpm_build_tex t)
rpm_script.clos e()
# Write rpm_install.sh pointing to this python
rpm_install_tex t=sys.executabl e +""" setup.py install
--root=$RPM_BUILD _ROOT
cat >INSTALLED_FILE S <<EOF
%doc Demo
EOF
find $RPM_BUILD_ROOT -type f | sed -e "s|$RPM_BUILD_R OOT||g"
INSTALLED_FIL ES
"""
rpm_script = open("rpm_insta ll.sh", "w")
rpm_script.writ e(rpm_install_t ext)
rpm_script.clos e()
setup (name = "Numeric",
version = numeric_version ,
maintainer = "Numerical Python Developers",
maintainer_emai l = "nu************ **@lists.source forge.net",
description = "Numerical Extension to Python",
long_descriptio n = long_descriptio n,
url = "http://numpy.sourcefor ge.net",
# distutils allows you to fix or fudge anything :-)
extra_path = 'Numeric',
packages = packages,
package_dir = package_dir,
headers = headers,
include_dirs = include_dirs,
ext_modules = ext_modules
)
print 'MA Version', MA_version
print 'Numeric Version', numeric_version