-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
53 lines (43 loc) · 1.47 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
import multiprocessing
import os
import subprocess
from setuptools import setup, find_packages, Command
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
def run(self):
self.run_command('cmake')
_build_ext.run(self)
class build_cmake(Command):
description = 'run CMake to build Tensorflow extensions'
user_options = []
def initialize_options(self):
"""Set default values for options."""
# Each user option must be listed here with their default value.
pass
def finalize_options(self):
pass
def run(self):
"""Run command."""
try:
os.mkdir('cmake-build-release')
except OSError:
pass
print("Running cmake")
subprocess.check_call(['cmake', '-DCMAKE_BUILD_TYPE=Release', '..'], cwd='cmake-build-release')
subprocess.check_call(['make', '-j{}'.format(multiprocessing.cpu_count())], cwd='cmake-build-release')
setup(name='tftraj',
author='Matthew Harrigan',
author_email='matthew.harrigan@outlook.com',
description="Molecular dynamics trajectory analysis in Tensorflow",
version=1,
license='MIT',
url='http:/github.com/mdtraj/tftraj',
platforms=['Linux'],
packages=find_packages(),
cmdclass={'cmake': build_cmake,
'build_ext': build_ext},
zip_safe=False,
package_data={
'tftraj': ['rmsd/librmsd.Release.so'],
},
)