-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
107 lines (96 loc) · 3.45 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
102
103
104
105
106
107
import setuptools
from setuptools import setup
from setuptools import Extension
from Cython.Build import cythonize
from Cython.Compiler import Options
import Cython
import sys
import os
import numpy
import glob
# On MacOs, you will need to explicitly set the compiler to one that features openmp.
# Either by uncommenting below or by compiling with e.g. 'CC=gcc-14 make'
# if sys.platform == 'darwin':
# os.environ['CC'] = 'gcc-13'
# os.environ['CXX'] = 'g++-13'
Options.annotate = False
compiler_directives = {"boundscheck": False, "cdivision": True,
"wraparound": False, 'language_level': "3"}
include_dirs = ['paicos/cython/', numpy.get_include()]
extra_compile_args = ['-fopenmp', "-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION",
"-Wno-unused-function"]
extra_link_args = ['-fopenmp']
ext_modules = [
Extension(
name='paicos.cython.get_index_of_region',
sources=['paicos/cython/get_index_of_region.pyx'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
Extension(
name='paicos.cython.histogram',
sources=['paicos/cython/histogram.pyx'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
Extension(
name='paicos.cython.sph_projectors',
sources=['paicos/cython/sph_projectors.pyx'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
Extension(
name='paicos.cython.openmp_info',
sources=['paicos/cython/openmp_info.pyx'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
Extension(
name='paicos.cython.get_derived_variables',
sources=['paicos/cython/get_derived_variables.pyx'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
Extension(
name='paicos.trees.bvh_tree',
sources=['paicos/trees/bvh_tree.pyx'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
)
]
install_requires = ['scipy',
'numpy',
'h5py',
'astropy',
'numba',
'matplotlib']
cur = os.path.abspath(__file__).replace('setup.py', '')
with open(cur + 'README.md') as f:
long_description = f.read()
with open(cur + 'dev_requirements.txt') as f:
dev_requirements = f.read().strip().split('\n')
setup(
name='paicos',
version='0.1.15',
description=('An object-oriented Python package for analysis of '
+ '(cosmological) simulations performed with Arepo.'),
url='https://github.com/tberlok/paicos',
author='Thomas Berlok',
author_email='tberlok@gmail.com',
long_description=long_description,
long_description_content_type='text/markdown',
license='BSD 3-clause',
packages=setuptools.find_packages(),
install_requires=install_requires,
extras_require={'dev': dev_requirements},
package_data={'paicos/cython': ['*.c', '*.so']},
classifiers=['Programming Language :: Python :: 3'],
ext_modules=cythonize(ext_modules,
compiler_directives=compiler_directives),
cmdclass={'build_ext': Cython.Build.build_ext})