forked from funkelab/funlib.learn.torch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
57 lines (51 loc) · 1.5 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
from setuptools import setup
from setuptools.extension import Extension
from distutils.sysconfig import get_python_inc, get_config_var
from Cython.Build import cythonize
import os
import numpy as np
losses_impl_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'funlib',
'learn',
'tensorflow',
'losses',
'impl')
include_dirs = [
losses_impl_dir,
os.path.dirname(get_python_inc()),
get_python_inc(),
np.get_include()
]
library_dirs = [
losses_impl_dir,
get_config_var("LIBDIR")
]
setup(
name='funlib.learn.torch',
version='0.1',
url='https://github.com/funkelab/funlib.learn.torch',
author='Funkelab',
author_email='[email protected]',
license='MIT',
packages=[
'funlib.learn.torch',
'funlib.learn.torch.models',
'funlib.learn.torch.misc',
'funlib.learn.torch.losses',
'funlib.learn.torch.losses.impl',
],
ext_modules=cythonize([
Extension(
'funlib.learn.torch.losses.impl.wrappers',
sources=[
'funlib/learn/torch/losses/impl/wrappers.pyx',
'funlib/learn/torch/losses/impl/um_loss.cpp',
],
include_dirs=include_dirs,
library_dirs=library_dirs,
extra_link_args=['-std=c++11'],
extra_compile_args=['-O3', '-std=c++11'],
language='c++')
])
)