-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
60 lines (50 loc) · 1.4 KB
/
config.py
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
from distutils.sysconfig import get_python_lib, get_python_inc
import numpy as np
exe = {
'cython': 'cython --cplus'.split(),
'c++': 'clang',
#'c++': 'g++',
'c': 'clang',
#'c': 'gcc',
}
dirs = {
'base': '',
}
include = {
'python': '',
'cython': '',
'numpy' : '',
'cxsc' : ''
}
# change to override defaults below
link = {
'c++ cython': '',
'c++': '',
'cxsc': '-lcxsc'
}
flags = {
'c': ' -pedantic -fno-strict-aliasing -fno-common -DNDEBUG -O1'.split(),
'c++ cython': '-undefined dynamic_lookup'.split()
}
def make_links():
# populate with defaults unless altered above
if link['c++ cython'] == '':
link['c++ cython'] = '-L'+ get_python_lib() + ' -lpython2.7 -lcxsc'#.split()
link['c++ cython'] = link['c++ cython'].split()
if link['c++'] == '':
print link['c++ cython']
print link['cxsc']
link['c++'] = link['c++ cython'] + [link['cxsc']]
def make_includes():
if include['python'] == '':
include['python'] = get_python_inc()
if include['cython'] == '':
include['cython'] = get_python_lib() + '/Cython/Includes/'
if include['numpy'] == '':
include['numpy'] = np.get_include()
def fiddle_with_flags():
"""
Mostly to account for some quirks on Macs
"""
flags['c++'] += '-arch x86_64 -bundle'
flags['c'] += '-arch x86_64'