forked from lace/blmath
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
77 lines (69 loc) · 2.5 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
# Conversion from Markdown to pypi's restructured text: https://coderwall.com/p/qawuyq -- Thanks James.
import os
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
long_description = ''
print('warning: pandoc or pypandoc does not seem to be installed; using empty long_description')
import importlib
import platform
from setuptools import setup, Extension
import numpy as np
with open(os.path.join(os.path.dirname(__file__), 'requirements.txt')) as f:
install_requires = f.readlines()
install_requires = [
x.strip() for x in install_requires
if x.strip() and not x.startswith('#')
]
if platform.system() == 'Windows':
libs = ['suitesparseconfig', 'liblapack', 'libcolamd', 'libamd', 'libcholmod', 'libblas']
include_dirs = [np.get_include()]
extra_compile_args = []
elif platform.system() == 'Darwin':
libs = ['suitesparseconfig', 'lapack', 'colamd', 'amd', 'cholmod']
include_dirs = [np.get_include()]
extra_compile_args = ['-O0', '-fno-inline']
else:
libs = ['lapack', 'colamd', 'amd', 'cholmod']
extra_compile_args = ['-O0', '-fno-inline']
include_dirs = [np.get_include(), '/usr/include/suitesparse']
setup(
name='blmath',
version=importlib.import_module('blmath').__version__,
author='Body Labs',
author_email='[email protected]',
description='A collection of math related utilities used by many bits of BodyLabs code',
long_description=long_description,
url='https://github.com/bodylabs/blmath',
license='MIT',
packages=[
'blmath',
'blmath/geometry',
'blmath/geometry/primitives',
'blmath/geometry/transform',
'blmath/numerics',
'blmath/numerics/linalg',
'blmath/optimization',
'blmath/optimization/objectives',
'blmath/util',
],
ext_modules=[
Extension('blmath.numerics.linalg.cholmod',
libraries=libs,
include_dirs=include_dirs,
sources=['blmath/numerics/linalg/cholmod.c'],
depends=['blmath/numerics/linalg/cholmod.c'],
extra_compile_args=extra_compile_args,
),
],
install_requires=install_requires,
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
]
)