This repository has been archived by the owner on Nov 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
49 lines (43 loc) · 1.74 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
# Copyright 2007 Thomas Finley, tfinley@gmail.com
from distutils.core import setup, Extension
from os.path import join
import sys
srcdir = 'src'
prefix = 'outside'
outside_files = ['graph.cpp', 'maxflow.cpp', 'energy.cpp']
interface_files = ['interface.cpp', 'graphobj.cpp', 'energyobj.cpp']
# Define extra objects.
extra_obs = []
if sys.platform.find('darwin') != -1:
# OS X's lazy linking makes some static initializers not work if we
# link against STD C++ dynamically. I'd love to find an alternate
# solution to this problem.
#extra_obs.append('/usr/lib/libstdc++.6.dylib')
pass
module1 = Extension(
'graphcut',
sources = [join(srcdir,f) for f in interface_files]+[
join(srcdir, prefix, o) for o in outside_files],
include_dirs = [join(srcdir,prefix)],
libraries = ['stdc++'],
# The following line seems necessary in OS X for some reason.
extra_objects = extra_obs)
ld = """The %s module gives one access to the functionality of
the graph cut minimization software of Boykov and Kolmogorov."""
setup(name = module1.name, version = '0.1', ext_modules = [module1],
description = 'Graph cut energy minimization software.',
long_description = ld % module1.name,
author = 'Thomas Finley',
author_email = 'tfinley@gmail.com',
url = 'http://tfinley.net/software/pygraphcut/',
license = 'Research Only',
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Programming Language :: C',
'Programming Language :: Python',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development :: Libraries :: Python Modules' ]
)