File: SConscript

package info (click to toggle)
python-scipy 0.10.1%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 42,232 kB
  • sloc: cpp: 224,773; ansic: 103,496; python: 85,210; fortran: 79,130; makefile: 272; sh: 43
file content (57 lines) | stat: -rw-r--r-- 1,465 bytes parent folder | download | duplicates (3)
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
# Last Change: Thu Jun 12 07:00 PM 2008 J
# vim:syntax=python

import os
from os.path import join as pjoin, splitext

from numscons import GetNumpyEnvironment
from numscons import CheckF77BLAS, CheckF77Clib

from numscons import write_info

env = GetNumpyEnvironment(ARGUMENTS)
#if os.name == 'nt':
#    # NT needs the pythonlib to run any code importing Python.h, including
#    # simple code using only typedef and so on, so we need it for configuration
#    # checks
#    env.AppendUnique(LIBPATH = [get_pythonlib_dir()])

#=======================
# Starting Configuration
#=======================
config = env.NumpyConfigure(custom_tests = {'CheckBLAS' : CheckF77BLAS}) 

if not config.CheckBLAS():
    raise RuntimeError("Could not check F/C runtime library for %s/%s, " \
                       "contact the maintainer" % (env['CC'], env['F77']))

#--------------
# Checking Blas
#--------------
st = config.CheckBLAS()
if not st:
    has_blas = 0
else:
    has_blas = 1

config.Finish()
write_info(env)

#==========
#  Build
#==========

# odr lib
libodr_src = [pjoin('odrpack', i) for i in ['d_odr.f', 'd_mprec.f', 'dlunoc.f']]
if has_blas:
    libodr_src.append(pjoin('odrpack', 'd_lpk.f'))
else:
    libodr_src.append(pjoin('odrpack', 'd_lpkbls.f'))

env.DistutilsStaticExtLibrary('odrpack', source = libodr_src)

env.PrependUnique(LIBS = 'odrpack')
env.PrependUnique(LIBPATH = '.')

# odr pyextension
env.NumpyPythonExtension('__odrpack', '__odrpack.c')