forked from kashirin-alex/PyHelpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
58 lines (50 loc) · 2.37 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
# -*- coding: utf-8 -*-
# AUTHOR Kashirin Alex ([email protected]) #
from distutils.core import setup, Extension
from distutils import sysconfig
library_dirs = ['/'.join(['']+sysconfig.get_python_lib().split('/')[0:1]+['lib'])]
include_dirs = [sysconfig.get_python_inc(plat_specific=True), '/usr/local/include', '/usr/include']
extenstions = [
Extension('pyhelpers.udp_handler_dest',
sources=['pyhelpers/udp_handler_dest.cc'],
include_dirs=include_dirs,
libraries=['tcmalloc_minimal'],
library_dirs=library_dirs,
extra_compile_args=['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-m64', '-D_REENTRANT', '-DNDEBUG',
'-s', '-static-libgcc', '-static-libstdc++', '-fPIC', '-std=c++17',
'-O3', '-flto', '-fuse-linker-plugin', '-ffat-lto-objects', '-floop-interchange',
'-fno-builtin-malloc', '-fno-builtin-calloc', '-fno-builtin-realloc', '-fno-builtin-free'],
# language='c++17',
),
# from pyhelpers.udp_handler_dest import UdpHandlerDest
Extension('pyhelpers.tcmalloc',
sources=['pyhelpers/tcmalloc.cc'],
include_dirs=include_dirs,
libraries=['tcmalloc_minimal'],
library_dirs=library_dirs,
extra_compile_args=['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-m64', '-D_REENTRANT', '-DNDEBUG',
'-s', '-static-libgcc', '-static-libstdc++', '-fPIC', '-std=c++17',
'-O3', '-flto', '-fuse-linker-plugin', '-ffat-lto-objects', '-floop-interchange',
'-DTCMALLOC_MINIMAL', #-ltcmalloc', '-lunwind',
'-fno-builtin-malloc', '-fno-builtin-calloc', '-fno-builtin-realloc', '-fno-builtin-free'],
# language='c++17',
),
# from pyhelpers.tcmalloc import TCMalloc
]
setup(
name='PyHelpers',
version='0.0.1',
description='Python Helper Extensions',
long_description='',
url='https://github.com/kashirin-alex/PyHelpers',
license='apache-2',
package_dir={
'pyhelpers': 'pyhelpers',
},
packages=[
'pyhelpers'
],
maintainer='Kashirin Alex',
maintainer_email='[email protected]',
ext_modules=extenstions
)