-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
100 lines (93 loc) · 2.89 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
"""SOMD: A SIESTA oriented Molecular Dynamics package
SOMD is an ab-initio molecular dynamics (AIMD) package designed for the SIESTA
(https://departments.icmab.es/leem/siesta/) code.
"""
import os
import sys
import versioneer
from setuptools import setup
from setuptools import Extension
from setuptools import find_packages
from setuptools.command.build_ext import build_ext
from Cython.Build import cythonize
DOCLINES = __doc__.split("\n")
CLASSIFIERS = """\
Development Status :: 2 - Pre-Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: GNU Affero General Public License v3
Programming Language :: C++
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Chemistry
Operating System :: POSIX
Operating System :: Unix
"""
extensions = [
Extension(
'somd.core._lib',
['./somd/core/src/lib.pyx', './somd/core/src/math_utils.cxx'],
include_dirs=['./somd/core/src'],
extra_compile_args=[
'-std=c++11',
'-Wall',
'-fopenmp',
'-O4',
'-march=native',
],
extra_link_args=['-fopenmp'],
),
Extension(
'somd.potentials._nepwrapper',
['./somd/potentials/src/nep.pyx'],
include_dirs=['./somd/potentials/src'],
extra_compile_args=[
'-std=c++11',
'-Wall',
'-fopenmp',
'-O4',
'-march=native',
],
extra_link_args=['-fopenmp'],
),
Extension(
'somd.potentials._nepwrapper_t',
['./somd/potentials/src/nep_t.pyx'],
include_dirs=['./somd/potentials/src'],
extra_compile_args=[
'-std=c++11',
'-Wall',
'-fopenmp',
'-O4',
'-march=native',
'-DUSE_TABLE_FOR_RADIAL_FUNCTIONS',
],
extra_link_args=['-fopenmp'],
),
]
metadata = dict(
name='somd',
author='github.com/initqp',
description=DOCLINES[0],
long_description="\n".join(DOCLINES[2:]),
version=versioneer.get_version(),
license='AGPLv3',
url='https://www.github.com/initqp/somd',
platforms=['Linux'],
classifiers=CLASSIFIERS.splitlines(),
packages=find_packages(),
cmdclass=versioneer.get_cmdclass({'build_ext': build_ext}),
install_requires=['Cython', 'h5py', 'mdtraj', 'toml'],
zip_safe=False,
ext_modules=cythonize(extensions),
entry_points={'console_scripts': ['somd = somd.apps.cli:main']},
)
if __name__ == '__main__':
setup(**metadata)
if 'clean' in sys.argv[1:]:
if os.path.isfile('somd/core/src/lib.cpp'):
os.remove('somd/core/src/lib.cpp')
if os.path.isfile('somd/potentials/src/nep.cpp'):
os.remove('somd/potentials/src/nep.cpp')
if os.path.isfile('somd/potentials/src/nep_t.cpp'):
os.remove('somd/potentials/src/nep_t.cpp')