File: SConscript

package info (click to toggle)
python-scipy 0.7.2%2Bdfsg1-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 28,572 kB
  • ctags: 36,183
  • sloc: cpp: 216,880; fortran: 76,016; python: 71,833; ansic: 62,118; makefile: 243; sh: 17
file content (60 lines) | stat: -rw-r--r-- 1,929 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

# vim:syntax=python
from os.path import join as pjoin, basename as pbasename
import sys
from numpy.distutils.misc_util import get_numpy_include_dirs

from numscons import GetNumpyEnvironment
from numscons import CheckF77Clib

env = GetNumpyEnvironment(ARGUMENTS)

env.Tool('f2py')

if sys.platform=='win32':
#        define_macros.append(('NOINFINITIES',None))
#        define_macros.append(('NONANS',None))
    env.AppendUnique(CPPDEFINES = '_USE_MATH_DEFINES')

config = env.NumpyConfigure(custom_tests = {'CheckF77Clib' : CheckF77Clib})
if not config.CheckF77Clib():
    raise RuntimeError("Could not get C/F77 runtime information")
config.Finish()

env.AppendUnique(CPPPATH = env["PYEXTCPPPATH"]) 
env.AppendUnique(CPPPATH = get_numpy_include_dirs())
def build_lib(name, ext, libname = None):
    """ext should be .f or .c"""
    if not libname:
        libname = name
    src = env.Glob(pjoin(name, '*%s' % ext))
    assert len(src) > 0
    env.DistutilsStaticExtLibrary(libname, source = src)

# C libraries
build_lib('c_misc', '.c', 'sc_c_misc')
build_lib('cephes', '.c', 'sc_cephes')

# F libraries
# XXX: handle no opt flags for mach
build_lib('mach', '.f', 'sc_mach')
build_lib('toms', '.f', 'sc_toms')
build_lib('amos', '.f', 'sc_amos')
build_lib('cdflib', '.f', 'sc_cdf')
build_lib('specfun', '.f', 'sc_specfunlib')

env.AppendUnique(LIBPATH = ['.'])

# Cephes extension
src = ['_cephesmodule.c', 'amos_wrappers.c', 'specfun_wrappers.c', \
       'toms_wrappers.c','cdf_wrappers.c','ufunc_extras.c']

env.NumpyPythonExtension('_cephes', 
                         source = src, 
                         LIBS = ['sc_amos', 'sc_toms', 'sc_c_misc', 'sc_cephes', 'sc_mach',\
                                 'sc_cdf', 'sc_specfunlib']) 

# Specfun extension
env.Prepend(LIBS = ['sc_specfunlib'])
env.NumpyPythonExtension('specfun', source = 'specfun.pyf',
                         F2PYOPTIONS = ["--no-wrap-functions"])