File: bscript

package info (click to toggle)
python-scipy 0.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 52,228 kB
  • ctags: 63,719
  • sloc: python: 112,726; fortran: 88,685; cpp: 86,979; ansic: 85,860; makefile: 530; sh: 236
file content (35 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download
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
import sys
import os

from bento.commands import hooks
from scipy._build_utils import get_g77_abi_wrappers

@hooks.pre_build
def pre_build(context):
    default_builder = context.default_builder

    def fblas_builder(extension):
        source = extension.sources[:]

        # XXX: detect this properly
        if sys.platform == "darwin":
            info = {'extra_link_args': 'Accelerate'}
        else:
            info = {}
	source += [os.path.relpath(f, os.path.abspath(os.path.dirname(__file__)))
                    for f in get_g77_abi_wrappers(info)]

        return default_builder(extension,
                               features="c fc pyext bento cshlib f2py",
                               source=source,
                               use="LAPACK CLIB")
    context.register_builder("fblas", fblas_builder)

    def cblas_builder(extension):
        kw = {}
        if context.waf_context.env.HAS_CBLAS:
            kw["use"] = "CBLAS"
        return default_builder(extension,
                               features="c fc pyext bento cshlib f2py",
                               **kw)
    context.register_builder("cblas", cblas_builder)