-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
63 lines (49 loc) · 1.84 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
import numpy
from setuptools import setup, Extension
# from distutils.core import setup
# from distutils.extension import Extension
from Cython.Distutils import build_ext
# from Cython.Build import cythonize
from os import path
from Cython.Compiler import Options
Options.docstrings = True
from os import listdir
from os.path import isfile, join
library_name = "NMRLineshape"
include_directories = ["./NMRinteraction/include"]
include_directories.append(numpy.get_include())
source_files = []
source_file_dir = ['NMRinteraction/NuclearShielding/',
'NMRinteraction/base_c/',
]
for _dir in source_file_dir:
for _file in listdir(_dir):
filename = path.splitext(_file)[0]
if _file.endswith(".c") and filename[:6] != 'cython':
source_files.append(_dir+_file)
if _file.endswith(".pyx"):
source_files.append(_dir+_file)
print("Source files----------------------------------")
for item in source_files:
print(item)
ext_modules = [Extension(
name=library_name,
sources=source_files,
# include_dirs=[numpy.get_include()],
# extra_objects= objects, # ["fc.o"], # if you compile fc.cpp separately
include_dirs = include_directories, # .../site-packages/numpy/core/include
language="c",
# libraries=
extra_compile_args = "-flax-vector-conversions -g".split(),
extra_link_args = "-g".split()
)]
setup(
name = library_name,
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules,
# ext_modules = cythonize(ext_modules) ? not in 0.14.1
version = '0.0.1a0',
description = 'NMR lineshape simulator',
author = 'Deepansh Srivastava',
author_email= '[email protected]'
)