-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
65 lines (58 loc) · 1.97 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
from Cython.Build import cythonize
import os
from setuptools import setup, Extension
from subprocess import check_output
from distutils.sysconfig import get_python_inc
import numpy as np
incdir = os.path.join(get_python_inc(plat_specific=1))
# Check if gcc is installed
compileFlags = (['-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION', '-O3', '-march=native'],
['/DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION', '/Ox'])
try:
check_output(['gcc', '-v'])
compileFlags = compileFlags[0]
except: # Try cl flags
compileFlags = compileFlags[1]
# Read in readme
with open('README.md') as F:
desc = F.read()
ext_mod = cythonize([
Extension(
'ICP.PathSearch',
include_dirs=[incdir, np.get_include()],
libraries=[],
library_dirs=[],
sources=[os.path.join('ICP', 'PathSearch.pyx')],
extra_compile_args=compileFlags),
Extension(
'ICP.ActiveSet',
include_dirs=[incdir],
libraries=[],
library_dirs=[],
sources=[os.path.join('ICP', 'ActiveSet.pyx')],
extra_compile_args=compileFlags)
])
setup(
name='ICPOptimize',
version='2.4',
description='Python 3 Implementation of ICP and ICPRE',
author='Nicholas T. Smith',
author_email='nicholastsmithblog@gmail.com',
url="https://github.com/nicholastoddsmith/ICPOptimize",
long_description_content_type="text/markdown",
long_description=desc,
packages=['ICP'],
ext_modules=ext_mod,
keywords=["optimization", "optimizer", "linear", "ICP", "ICPRE"],
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: C',
'Programming Language :: Cython',
'Programming Language :: Python',
'Programming Language :: Python :: 3']
)