# -*- python -*-
# BJam 1.40.0 installation file, KSL supercomputing team
from ksl.process.install.installer import *
from copy import copy
from string import Template

base = installer()
variants = []

base.name='numpy'
base.version='dev-aug29'
base.release='1'
base.license='BSD'
base.vendor='community'
base.url='http://www.numpy.org/'
base.summary='numerical arrays for python'
base.packager='aron'
base.source='numpy-dev-aug29.tar.gz'
base.category='linear algebra'
base.description=\
"""NumPy is an extension to the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays. The ancestor of NumPy, Numeric, was originally created by Jim Hugunin. NumPy is open source and has many contributors.
"""

base.paths    = ['./bin']
base.binaries = ['f2py']
base.includes=['./lib/python/numpy/core/include/']
base.libdirs=['./lib']
base.libs=[]
base.compile_modules=['python']
base.required_modules=[]
base.notes="""This build has been patched around the following bugs:
* disabled compile-time run tests
* forced doubles to represent long doubles
* added mpixlf90 support
* worked around a bug in the libnpymath build script.
* there are some additional changes in the build that have not been checked in that should not be fundamental.
"""
base.tag = ''

s1 = apply_patch,'numpy-dev-aug29-ksl.patch'
s2 = (shell_command,'python setup.py -v build --compiler=mpixlc --fcompiler=bgp || echo "expected failure"')
s3 = (shell_command,'ar r build/temp.linux-ppc64-2.6/libnpymath.a build/temp.linux-ppc64-2.6/build/src.linux-ppc64-2.6/numpy/core/src/npymath/npy_math.o build/temp.linux-ppc64-2.6/build/src.linux-ppc64-2.6/numpy/core/src/npymath/ieee754.o build/temp.linux-ppc64-2.6/build/src.linux-ppc64-2.6/numpy/core/src/npymath/npy_math_complex.o')
s4 = (shell_command,'python setup.py -v build --compiler=mpixlc --fcompiler=bgp')
s5 = (templated_shell_command,
      Template('python setup.py -v install --home=$target_dir'))
ppc450d_install = (s1, s2, s3, s4, s5)

ppc450d = copy(base)
ppc450d.build_host = 'ppc64'
ppc450d.install_steps = ppc450d_install
ppc450d.target_arch = 'ppc450d'
ppc450d.mod_magic = 'prepend-path PYTHONPATH $::env(KSL_NUMPY_DIR)/lib/python'
variants.append(ppc450d)


