/
setup.py
executable file
·101 lines (90 loc) · 3.3 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# -*- encoding: utf-8 -*-
import os
import sys
import numpy
from distutils.core import setup
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
# No Cython
source_extension = ".cpp"
cmdclass = {}
else:
# There's Cython
source_extension = ".pyx"
cmdclass = {'build_ext': build_ext}
flags = ["-O3",
"-std=c++11",
"-Wall",
"-fomit-frame-pointer",
"-flto",
"-march=native",
"-ffast-math",
"-funroll-loops",
"-Wno-cpp",
"-Wno-unused-function",
"-Wno-maybe-uninitialized"]
# TODO: Delete before release
# flags = ["-O0", "-std=c++11"]
version = '0.2.0'
setup(
name='ifa',
packages=['ifa'],
version=version,
cmdclass=cmdclass,
license="MIT License",
author="Jan Olszak",
author_email="janekolszak@gmail.com",
description="A library for information flow analysis",
keywords="information flow analysis entropy distribution",
url="http://github.com/janekolszak/ifa",
download_url="https://github.com/janekolszak/ifa/archive/ifa-" + version + ".tar.gz",
ext_modules=[Extension("ifa.utils",
sources=[
'ifa/utils' + source_extension,
'ifa/utils_impl.cpp'
],
language="c++",
extra_compile_args=flags),
Extension("ifa.distribution",
sources=[
'ifa/distribution' + source_extension,
'ifa/distribution_impl.cpp'
],
language="c++",
extra_compile_args=flags),
Extension("ifa.divergence",
sources=[
'ifa/divergence' + source_extension,
'ifa/divergence_impl.cpp',
'ifa/distribution_impl.cpp'
],
language="c++",
extra_compile_args=flags),
Extension("ifa.connections",
sources=[
'ifa/connections' + source_extension,
'ifa/divergence_impl.cpp',
'ifa/utils_impl.cpp',
'ifa/distribution_impl.cpp'
],
language="c++",
extra_compile_args=flags + ["-fopenmp"],
extra_link_args=['-fopenmp']),
],
include_dirs = [numpy.get_include()],
classifiers=[
"Programming Language :: Cython",
"Programming Language :: C++",
"Programming Language :: Python",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Information Analysis"
],
)