-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
36 lines (30 loc) · 876 Bytes
/
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
from distutils.core import setup
from distutils.extension import Extension
try:
import Cython
from Cython.Compiler.Version import version
print "Cython version %s found" % version
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
print "Warning: Cython version absent or inadapted. We do not cythonize mcf.pyx."
USE_CYTHON = False
extension = ".pyx" if USE_CYTHON else ".c"
sourcefiles = [
# cython files
"src/mcf" + extension,
# pure C files
"src/random.c",
"src/point3d.c",
"src/mcf_algorithms.c",
"src/mcf_template.c"
]
extensions = [Extension("mcf", sourcefiles)]
if USE_CYTHON:
extensions = cythonize(extensions)
setup(
name = "mcf",
version = "0.alpha1",
author = "V. Delecroix and S. Labbe",
description = "Multidimensional Continued Fractions",
ext_modules = extensions)