-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
54 lines (49 loc) · 1.64 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
import sys
from setuptools import setup
from distutils.core import Extension
long_description= ''
previous_line= ''
with open('README.md') as dfile:
for line in dfile:
if '[!' in line: continue
long_description+= line
libraries= ['m']
#Option to forego OpenMP
try:
openmp_pos = sys.argv.index('--no-openmp')
except ValueError:
extra_compile_args = ["-fopenmp"]
libraries.append('gomp')
else:
del sys.argv[openmp_pos]
extra_compile_args= ["-DNO_OMP"]
#Option to track coverage
try:
coverage_pos = sys.argv.index('--coverage')
except ValueError:
extra_link_args= []
else:
del sys.argv[coverage_pos]
extra_compile_args.extend(["-O0","--coverage"])
extra_link_args= ["--coverage"]
setup(name='wendy',
version='0.3.dev',
description='One-dimensional gravitational N-body code',
long_description=long_description,
long_description_content_type='text/markdown',
author='Jo Bovy',
author_email='[email protected]',
license='MIT',
url='http://github.com/jobovy/wendy',
package_dir = {'wendy/': ''},
packages=['wendy'],
package_data={"": ["README.md","LICENSE"]},
include_package_data=True,
install_requires=['numpy<1.23','numba<0.57'],
ext_modules=[Extension('wendy_c',
sources=['wendy/wendy.c','wendy/bst.c',
'wendy/parallel_sort.c'],
libraries=libraries,
include_dirs=['wendy/'],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args)])