-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
126 lines (118 loc) · 4.72 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
from setuptools import setup
from torch.utils.cpp_extension import CppExtension, BuildExtension, CUDAExtension
import os
import sysconfig
if __name__=='__main__':
Packages = ['TorchProteinLibrary',
#FullAtomModel
'TorchProteinLibrary.FullAtomModel',
'TorchProteinLibrary.FullAtomModel.Angles2Coords',
'TorchProteinLibrary.FullAtomModel.Coords2TypedCoords',
'TorchProteinLibrary.FullAtomModel.CoordsTransform',
'TorchProteinLibrary.FullAtomModel.PDB2Coords',
#ReducedModel
'TorchProteinLibrary.ReducedModel',
'TorchProteinLibrary.ReducedModel.Angles2Backbone',
#Volume
'TorchProteinLibrary.Volume',
'TorchProteinLibrary.Volume.TypedCoords2Volume',
'TorchProteinLibrary.Volume.Select',
'TorchProteinLibrary.Volume.VolumeConvolution',
'TorchProteinLibrary.Volume.VolumeRotation',
'TorchProteinLibrary.Volume.VolumeRMSD',
#RMSD
'TorchProteinLibrary.RMSD',
'TorchProteinLibrary.RMSD.Coords2RMSD',
]
FullAtomModel = CUDAExtension('_FullAtomModel',
sources = [
'Math/cVector3.cpp',
'Math/cMatrix33.cpp',
'Math/cMatrix44.cpp',
'Math/nUtil.cpp',
'Layers/FullAtomModel/cConformation.cpp',
'Layers/FullAtomModel/cConformationAA.cpp',
'Layers/FullAtomModel/cGeometry.cpp',
'Layers/FullAtomModel/cRigidGroup.cpp',
'Layers/FullAtomModel/cPDBLoader.cpp',
'Layers/FullAtomModel/Angles2Coords/angles2coords_interface.cpp',
'Layers/FullAtomModel/PDB2Coords/pdb2coords_interface.cpp',
'Layers/FullAtomModel/Coords2TypedCoords/coords2typedcoords_interface.cpp',
'Layers/FullAtomModel/CoordsTransform/coordsTransform_interface.cpp',
'Layers/FullAtomModel/CoordsTransform/coordsTransformGPU_interface.cpp',
'Layers/FullAtomModel/TransformCUDAKernels.cu',
'Layers/FullAtomModel/main.cpp'],
include_dirs = ['Layers/FullAtomModel', 'Math'],
libraries = ['gomp'],
extra_compile_args={'cxx': ['-fopenmp'],
'nvcc': ['-Xcompiler', '-fopenmp']})
Volume = CUDAExtension('_Volume',
sources = [
'Math/cMatrix33.cpp',
'Math/cMatrix44.cpp',
'Math/cVector3.cpp',
'Math/nUtil.cpp',
'Layers/Volume/TypedCoords2Volume/typedcoords2volume_interface.cpp',
'Layers/Volume/Volume2Xplor/volume2xplor_interface.cpp',
'Layers/Volume/Select/select_interface.cpp',
'Layers/Volume/VolumeConvolution/volumeConvolution_interface.cpp',
'Layers/Volume/VolumeRotation/volumeRotation_interface.cpp',
'Layers/Volume/VolumeRMSD/volumeRMSD_interface.cpp',
'Layers/Volume/Kernels.cu',
'Layers/Volume/VolumeConv.cu',
'Layers/Volume/RotateGrid.cu',
'Layers/Volume/VolumeRMSD.cu',
'Layers/Volume/main.cpp'],
include_dirs = ['Layers/Volume', 'Math'],
libraries = ['gomp', 'cufft'],
extra_compile_args={'cxx': ['-fopenmp'],
'nvcc': ['-Xcompiler', '-fopenmp']}
)
ReducedModel = CUDAExtension('_ReducedModel',
sources = [
'Math/cMatrix33.cpp',
'Math/cMatrix44.cpp',
'Math/cVector3.cpp',
'Math/nUtil.cpp',
'Layers/ReducedModel/cBackboneProteinCPUKernels.cpp',
'Layers/ReducedModel/Angles2Backbone/angles2backbone_interface.cpp',
'Layers/ReducedModel/cBackboneProteinCUDAKernels.cu',
'Layers/ReducedModel/main.cpp'],
include_dirs = ['Layers/ReducedModel', 'Math'],
libraries = ['gomp'],
extra_compile_args={'cxx': ['-fopenmp'],
'nvcc': ['-Xcompiler', '-fopenmp']}
)
RMSD = CppExtension('_RMSD',
sources = [
'Math/cMatrix33.cpp',
'Math/cMatrix44.cpp',
'Math/cVector3.cpp',
'Math/nUtil.cpp',
'Layers/RMSD/Coords2RMSD/coords2rmsd_interface.cpp',
'Layers/RMSD/RMSDKernels.cu',
'Layers/RMSD/main.cpp'],
include_dirs = ['Layers/RMSD', 'Math'],
libraries = ['gomp'],
extra_compile_args={'cxx': ['-fopenmp'],
'nvcc': ['-Xcompiler', '-fopenmp']})
setup( name='TorchProteinLibrary',
version="0.1",
ext_modules=[ RMSD,
FullAtomModel,
Volume,
ReducedModel
],
cmdclass={'build_ext': BuildExtension},
packages = Packages,
author="Georgy Derevyanko",
author_email="[email protected]",
description="This is a collection of differentiable layers for pytorch, applicable to protein data",
license="MIT",
keywords="pytorch, protein structure, deep learning",
url="https://github.com/lupoglaz/TorchProteinLibrary",
project_urls={
"Bug Tracker": "https://github.com/lupoglaz/TorchProteinLibrary/issues",
"Documentation": "https://github.com/lupoglaz/TorchProteinLibrary/tree/Release/Doc",
"Source Code": "https://github.com/lupoglaz/TorchProteinLibrary",
})