-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
68 lines (58 loc) · 2.37 KB
/
setup.py
File metadata and controls
68 lines (58 loc) · 2.37 KB
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
#! /usr/bin/env python
# System imports
import platform
import setuptools
from distutils.core import *
from distutils import sysconfig
from distutils.command.build import build
class NativeBuild(build):
sub_commands = [
('build_ext', build.has_ext_modules),
('build_py', build.has_pure_modules),
('build_clib', build.has_c_libraries),
('build_scripts', build.has_scripts),
]
# Third-party modules - we depend on numpy for everything
import numpy
# Obtain the numpy include directory. This logic works across numpy versions.
try:
numpy_include = numpy.get_include()
except AttributeError:
numpy_include = numpy.get_numpy_include()
if platform.system().lower() == 'windows':
_complile_args = [] # ["/EHsc"]
else:
_complile_args = ["-std=c++11", "-Wno-unused-variable"]
# imagetools extension module
_imagetools = Extension("_imagetools",
["imagetools.i", "cpp/imagetools.cpp", "cpp/geom.cpp", "cpp/raster.cpp",
"cpp/csv.cpp", "cpp/ml3d.cpp", "cpp/comparator.cpp", "cpp/multifit.cpp"],
include_dirs = [numpy_include],
swig_opts = ["-c++"],
extra_compile_args = _complile_args,
)
# Lamin B1 segmentation and analysis
_laminb = Extension("_laminb",
["laminb.i", "cpp/laminb.cpp", "cpp/geom.cpp", "cpp/raster.cpp", "cpp/csv.cpp"],
include_dirs = [numpy_include],
swig_opts = ["-c++"],
extra_compile_args = _complile_args,
)
# Mitochondria/Z01 segmentation and analysis
_mito = Extension("_mito",
["mito.i", "cpp/mito.cpp", "cpp/dsp.cpp", "cpp/geom.cpp", "cpp/raster.cpp", "cpp/fstack.cpp", "cpp/csv.cpp"],
include_dirs = [numpy_include],
swig_opts = ["-c++"],
extra_compile_args = _complile_args,
)
# imagetools setup
setup( cmdclass = {'build': NativeBuild},
name = "imagetools",
description = "Native support for various image segmentation and analysis operations",
author = "Andrei Volkov",
version = "1.0.10",
license = "License.txt",
install_requires=['numpy'],
ext_modules = [_imagetools, _laminb, _mito],
py_modules = ["imagetools", "laminb", "mito"]
)