"docs/get_started/installation.md" did not exist on "823b62ed9478049c5e977101f373eaf4e60ac98c"
build.py 1.07 KB
Newer Older
rusty1s's avatar
rusty1s committed
1
import os.path as osp
rusty1s's avatar
rusty1s committed
2
import shutil
rusty1s's avatar
rusty1s committed
3
4
5
6
7
import subprocess

import torch
from torch.utils.ffi import create_extension

rusty1s's avatar
rusty1s committed
8
if osp.exists('build'):
rusty1s's avatar
rusty1s committed
9
10
    shutil.rmtree('build')

rusty1s's avatar
rusty1s committed
11
files = ['Graclus', 'Grid']
rusty1s's avatar
rusty1s committed
12

rusty1s's avatar
gputest  
rusty1s committed
13
14
15
headers = ['aten/TH/TH{}.h'.format(f) for f in files]
sources = ['aten/TH/TH{}.c'.format(f) for f in files]
include_dirs = ['aten/TH']
rusty1s's avatar
rusty1s committed
16
17
18
19
define_macros = []
extra_objects = []
with_cuda = False

rusty1s's avatar
rename  
rusty1s committed
20
21
22
23
24
25
26
27
28
# if torch.cuda.is_available():
#     subprocess.call(['./build_new.sh', osp.dirname(torch.__file__)])

#     headers += ['aten/THCC/THCC{}.h'.format(f) for f in files]
#     sources += ['aten/THCC/THCC{}.c'.format(f) for f in files]
#     include_dirs += ['aten/THC', 'aten/THCC']
#     define_macros += [('WITH_CUDA', None)]
#     extra_objects += ['aten/build/THC.so']
#     with_cuda = True
rusty1s's avatar
rusty1s committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42

ffi = create_extension(
    name='torch_cluster._ext.ffi',
    package=True,
    headers=headers,
    sources=sources,
    include_dirs=include_dirs,
    define_macros=define_macros,
    extra_objects=extra_objects,
    with_cuda=with_cuda,
    relative_to=__file__)

if __name__ == '__main__':
    ffi.build()