-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup.py
64 lines (50 loc) · 1.4 KB
/
setup.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
61
62
63
64
from __future__ import print_function
import os
import sys
from setuptools import Extension
from setuptools import setup
sys.path.insert(0,
os.path.join(
os.path.dirname(__file__),
'third_party',
)
)
import cpuid
def has_sse42():
cpu = cpuid.CPUID()
regs = cpu(1)
return bool((1 << 20) & regs[2])
extra_compile_args = []
extra_compile_args += ['-std=c++11']
extra_compile_args += ['-Iinclude']
extra_compile_args += ['-O3']
extra_compile_args += ['-w']
# cc1plus: warning: command line option '-Wstrict-prototypes' is valid for
# C/ObjC but not for C++
extra_compile_args += ['-Wno-strict-prototypes']
#extra_compile_args += ['-DUSE_SPIRIT']
#extra_compile_args += ['-I/home/dmw/src/boost_1_64_0']
#extra_compile_args += ['-fprofile-generate', '-lgcov']
#extra_compile_args += ['-DCSVMONKEY_DEBUG']
if has_sse42():
extra_compile_args += ['-msse4.2']
else:
print("Warning: CPU lacks SSE4.2, compiling with fallback",
file=sys.stderr)
setup(
name='csvmonkey',
author='David Wilson',
author_email='[email protected]',
version='0.0.5',
classifiers=[],
url='https://github.com/dw/csvmonkey/',
ext_modules = [
Extension(
name='csvmonkey',
sources=['cpython/csvmonkey.cpp'],
undef_macros=['NDEBUG'],
extra_compile_args=extra_compile_args,
)
],
zip_safe = False,
)