/
usr
/
lib64
/
python2.6
/
site-packages
/
numpy
/
core
/
/usr/lib64/python2.6/site-packages/numpy/core
mkdir
upload
Name
Size
Mode
Actions
include/
-
0755
rm
lib/
-
0755
rm
tests/
-
0755
rm
arrayprint.py
16812
0644
edit
dl
rm
arrayprint.pyc
15601
0644
edit
dl
rm
arrayprint.pyo
15601
0644
edit
dl
rm
defchararray.py
69952
0644
edit
dl
rm
defchararray.pyc
78326
0644
edit
dl
rm
defchararray.pyo
78326
0644
edit
dl
rm
defmatrix.py
28094
0644
edit
dl
rm
defmatrix.pyc
30970
0644
edit
dl
rm
defmatrix.pyo
30970
0644
edit
dl
rm
fromnumeric.py
71135
0644
edit
dl
rm
fromnumeric.pyc
75079
0644
edit
dl
rm
fromnumeric.pyo
75079
0644
edit
dl
rm
function_base.py
5201
0644
edit
dl
rm
function_base.pyc
5569
0644
edit
dl
rm
function_base.pyo
5569
0644
edit
dl
rm
generate_numpy_api.py
6444
0644
edit
dl
rm
generate_numpy_api.pyc
6202
0644
edit
dl
rm
generate_numpy_api.pyo
6141
0644
edit
dl
rm
getlimits.py
8790
0644
edit
dl
rm
getlimits.pyc
10068
0644
edit
dl
rm
getlimits.pyo
10068
0644
edit
dl
rm
info.py
4635
0644
edit
dl
rm
info.pyc
4806
0644
edit
dl
rm
info.pyo
4806
0644
edit
dl
rm
machar.py
10658
0644
edit
dl
rm
machar.pyc
8694
0644
edit
dl
rm
machar.pyo
8694
0644
edit
dl
rm
memmap.py
9301
0644
edit
dl
rm
memmap.pyc
9534
0644
edit
dl
rm
memmap.pyo
9534
0644
edit
dl
rm
multiarray.so
584824
0755
edit
dl
rm
multiarray_tests.so
13008
0755
edit
dl
rm
numeric.py
68280
0644
edit
dl
rm
numeric.pyc
72033
0644
edit
dl
rm
numeric.pyo
72033
0644
edit
dl
rm
numerictypes.py
25088
0644
edit
dl
rm
numerictypes.pyc
24189
0644
edit
dl
rm
numerictypes.pyo
24144
0644
edit
dl
rm
records.py
26838
0644
edit
dl
rm
records.pyc
24437
0644
edit
dl
rm
records.pyo
24437
0644
edit
dl
rm
scalarmath.so
164928
0755
edit
dl
rm
scons_support.py
8352
0644
edit
dl
rm
scons_support.pyc
9342
0644
edit
dl
rm
scons_support.pyo
9342
0644
edit
dl
rm
setup.py
32450
0644
edit
dl
rm
setup.pyc
23292
0644
edit
dl
rm
setup.pyo
23292
0644
edit
dl
rm
setupscons.py
4516
0644
edit
dl
rm
setupscons.pyc
4087
0644
edit
dl
rm
setupscons.pyo
4087
0644
edit
dl
rm
setup_common.py
10069
0644
edit
dl
rm
setup_common.pyc
8353
0644
edit
dl
rm
setup_common.pyo
8353
0644
edit
dl
rm
shape_base.py
6294
0644
edit
dl
rm
shape_base.pyc
7123
0644
edit
dl
rm
shape_base.pyo
7123
0644
edit
dl
rm
umath.so
325904
0755
edit
dl
rm
umath_tests.so
12192
0755
edit
dl
rm
_dotblas.so
20712
0755
edit
dl
rm
_internal.py
10368
0644
edit
dl
rm
_internal.pyc
10870
0644
edit
dl
rm
_internal.pyo
10870
0644
edit
dl
rm
_mx_datetime_parser.py
33252
0644
edit
dl
rm
_mx_datetime_parser.pyc
29029
0644
edit
dl
rm
_mx_datetime_parser.pyo
29029
0644
edit
dl
rm
_sort.so
90736
0755
edit
dl
rm
__init__.py
983
0644
edit
dl
rm
__init__.pyc
1261
0644
edit
dl
rm
__init__.pyo
1261
0644
edit
dl
rm
Edit:
/usr/lib64/python2.6/site-packages/numpy/core/scons_support.py
(8352B)
#! Last Change: Sun Apr 26 05:00 PM 2009 J """Code to support special facilities to scons which are only useful for numpy.core, hence not put into numpy.distutils.scons""" import sys import os from os.path import join as pjoin, dirname as pdirname, basename as pbasename from copy import deepcopy import code_generators from code_generators.generate_numpy_api import \ do_generate_api as nowrap_do_generate_numpy_api from code_generators.generate_ufunc_api import \ do_generate_api as nowrap_do_generate_ufunc_api from setup_common import check_api_version as _check_api_version from setup_common import \ LONG_DOUBLE_REPRESENTATION_SRC, pyod, long_double_representation from numscons.numdist import process_c_str as process_str import SCons.Node import SCons from SCons.Builder import Builder from SCons.Action import Action def check_api_version(apiversion): return _check_api_version(apiversion, pdirname(code_generators.__file__)) def split_ext(string): sp = string.rsplit( '.', 1) if len(sp) == 1: return (sp[0], '') else: return sp #------------------------------------ # Ufunc and multiarray API generators #------------------------------------ def do_generate_numpy_api(target, source, env): nowrap_do_generate_numpy_api([str(i) for i in target], [s.value for s in source]) return 0 def do_generate_ufunc_api(target, source, env): nowrap_do_generate_ufunc_api([str(i) for i in target], [s.value for s in source]) return 0 def generate_api_emitter(target, source, env): """Returns the list of targets generated by the code generator for array api and ufunc api.""" base, ext = split_ext(str(target[0])) dir = pdirname(base) ba = pbasename(base) h = pjoin(dir, '__' + ba + '.h') c = pjoin(dir, '__' + ba + '.c') txt = base + '.txt' #print h, c, txt t = [h, c, txt] return (t, source) #------------------------- # From template generators #------------------------- # XXX: this is general and can be used outside numpy.core. def do_generate_from_template(targetfile, sourcefile, env): t = open(targetfile, 'w') s = open(sourcefile, 'r') allstr = s.read() s.close() writestr = process_str(allstr) t.write(writestr) t.close() return 0 def generate_from_template(target, source, env): for t, s in zip(target, source): do_generate_from_template(str(t), str(s), env) def generate_from_template_emitter(target, source, env): base, ext = split_ext(pbasename(str(source[0]))) t = pjoin(pdirname(str(target[0])), base) return ([t], source) #---------------- # umath generator #---------------- def do_generate_umath(targetfile, sourcefile, env): t = open(targetfile, 'w') from code_generators import generate_umath code = generate_umath.make_code(generate_umath.defdict, generate_umath.__file__) t.write(code) t.close() def generate_umath(target, source, env): for t, s in zip(target, source): do_generate_umath(str(t), str(s), env) def generate_umath_emitter(target, source, env): t = str(target[0]) + '.c' return ([t], source) #----------------------------------------- # Other functions related to configuration #----------------------------------------- def CheckGCC4(context): src = """ int main() { #if !(defined __GNUC__ && (__GNUC__ >= 4)) die from an horrible death #endif } """ context.Message("Checking if compiled with gcc 4.x or above ... ") st = context.TryCompile(src, '.c') if st: context.Result(' yes') else: context.Result(' no') return st == 1 def CheckBrokenMathlib(context, mathlib): src = """ /* check whether libm is broken */ #include <math.h> int main(int argc, char *argv[]) { return exp(-720.) > 1.0; /* typically an IEEE denormal */ } """ try: oldLIBS = deepcopy(context.env['LIBS']) except: oldLIBS = [] try: context.Message("Checking if math lib %s is usable for numpy ... " % mathlib) context.env.AppendUnique(LIBS = mathlib) st = context.TryRun(src, '.c') finally: context.env['LIBS'] = oldLIBS if st[0]: context.Result(' Yes !') else: context.Result(' No !') return st[0] def check_mlib(config, mlib): """Return 1 if mlib is available and usable by numpy, 0 otherwise. mlib can be a string (one library), or a list of libraries.""" # Check the libraries in mlib are linkable if len(mlib) > 0: # XXX: put an autoadd argument to 0 here and add an autoadd argument to # CheckBroekenMathlib (otherwise we may add bogus libraries, the ones # which do not path the CheckBrokenMathlib test). st = config.CheckLib(mlib) if not st: return 0 # Check the mlib is usable by numpy return config.CheckBrokenMathlib(mlib) def check_mlibs(config, mlibs): for mlib in mlibs: if check_mlib(config, mlib): return mlib # No mlib was found. raise SCons.Errors.UserError("No usable mathlib was found: chose another "\ "one using the MATHLIB env variable, eg "\ "'MATHLIB=m python setup.py build'") def is_npy_no_signal(): """Return True if the NPY_NO_SIGNAL symbol must be defined in configuration header.""" return sys.platform == 'win32' def define_no_smp(): """Returns True if we should define NPY_NOSMP, False otherwise.""" #-------------------------------- # Checking SMP and thread options #-------------------------------- # Python 2.3 causes a segfault when # trying to re-acquire the thread-state # which is done in error-handling # ufunc code. NPY_ALLOW_C_API and friends # cause the segfault. So, we disable threading # for now. if sys.version[:5] < '2.4.2': nosmp = 1 else: # Perhaps a fancier check is in order here. # so that threads are only enabled if there # are actually multiple CPUS? -- but # threaded code can be nice even on a single # CPU so that long-calculating code doesn't # block. try: nosmp = os.environ['NPY_NOSMP'] nosmp = 1 except KeyError: nosmp = 0 return nosmp == 1 # Inline check def CheckInline(context): context.Message("Checking for inline keyword... ") body = """ #ifndef __cplusplus static %(inline)s int static_func (void) { return 0; } %(inline)s int nostatic_func (void) { return 0; } #endif""" inline = None for kw in ['inline', '__inline__', '__inline']: st = context.TryCompile(body % {'inline': kw}, '.c') if st: inline = kw break if inline: context.Result(inline) else: context.Result(0) return inline def CheckLongDoubleRepresentation(context): msg = { 'INTEL_EXTENDED_12_BYTES_LE': "Intel extended, little endian", 'INTEL_EXTENDED_16_BYTES_LE': "Intel extended, little endian", 'IEEE_QUAD_BE': "IEEE Quad precision, big endian", 'IEEE_QUAD_LE': "IEEE Quad precision, little endian", 'IEEE_DOUBLE_LE': "IEEE Double precision, little endian", 'IEEE_DOUBLE_BE': "IEEE Double precision, big endian" } context.Message("Checking for long double representation... ") body = LONG_DOUBLE_REPRESENTATION_SRC % {'type': 'long double'} st = context.TryCompile(body, '.c') if st: obj = str(context.sconf.lastTarget) tp = long_double_representation(pyod(obj)) context.Result(msg[tp]) return tp if not st: context.Result(0) array_api_gen_bld = Builder(action = Action(do_generate_numpy_api, '$ARRAYPIGENCOMSTR'), emitter = generate_api_emitter) ufunc_api_gen_bld = Builder(action = Action(do_generate_ufunc_api, '$UFUNCAPIGENCOMSTR'), emitter = generate_api_emitter) template_bld = Builder(action = Action(generate_from_template, '$TEMPLATECOMSTR'), emitter = generate_from_template_emitter) umath_bld = Builder(action = Action(generate_umath, '$UMATHCOMSTR'), emitter = generate_umath_emitter)
Save
cmd:
run