/tomo/pyhst

To get this branch, use:
bzr branch http://darksoft.org/webbzr/tomo/pyhst
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
61
62
#!/usr/bin/env python

"""Setup script for the EDFFILE module distribution."""

import re
import os, sys, glob

sys.path.append("..") 
import build_config

try:
    import numpy
except ImportError:
    text  = "You must have numpy installed.\n"
    text += "See http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103\n"
    raise ImportError, text

from distutils.core import setup
from distutils.extension import Extension

sources = glob.glob('*.c')

if hasattr(build_config, 'DEFINES'):
    defines = build_config.DEFINES
else:
    defines = []

regexp = re.compile("^-D")
for i, define in enumerate(defines):
    pair = regexp.sub("", define).split('=',2)
    if len(pair) < 2:
        pair.append(1) 
    defines[i] = tuple(pair)

if sys.platform == "win32":
    defines[len(defines)] = [('WIN32',None)]
#else:
#    define_macros = []

os.environ["CFLAGS"] = "-O2"
#os.environ["CFLAGS"] = "-O2 -fopenmp"
#os.environ["LDFLAGS"] = "-fopenmp"

setup (
        name         = "FastEdf",
        version      = "2.0",
        description  = "fit functions module",
        author       = "BLISS Group",
        author_email = "sole@esrf.fr",
        url          = "http://www.esrf.fr/computing/bliss/",

        # Description of the modules and packages in the distribution

        #extra_path   = 'Pybliss',
        ext_modules  = [
                       Extension(
                            name          = 'FastEdf',
                            sources       = sources,
                            define_macros = defines,
                            include_dirs  = [numpy.get_include()]),
       ],
)