Commit 95cc3f3a03a8db60d76b781484154e41be4d606b
1 parent
49a3eccf
Exists in
rotvol
Updated the setup.py to compile in mac
Showing
1 changed file
with
21 additions
and
5 deletions
Show diff stats
setup.py
1 | from distutils.core import setup | 1 | from distutils.core import setup |
2 | from distutils.extension import Extension | 2 | from distutils.extension import Extension |
3 | from Cython.Distutils import build_ext | 3 | from Cython.Distutils import build_ext |
4 | +from Cython.Build import cythonize | ||
4 | 5 | ||
6 | +import os | ||
5 | import sys | 7 | import sys |
6 | 8 | ||
7 | import numpy | 9 | import numpy |
@@ -9,7 +11,7 @@ import numpy | @@ -9,7 +11,7 @@ import numpy | ||
9 | if sys.platform == 'linux2': | 11 | if sys.platform == 'linux2': |
10 | setup( | 12 | setup( |
11 | cmdclass = {'build_ext': build_ext}, | 13 | cmdclass = {'build_ext': build_ext}, |
12 | - ext_modules = [ Extension("invesalius.data.mips", ["invesalius/data/mips.pyx"], | 14 | + ext_modules = cythonize([ Extension("invesalius.data.mips", ["invesalius/data/mips.pyx"], |
13 | include_dirs = [numpy.get_include()], | 15 | include_dirs = [numpy.get_include()], |
14 | extra_compile_args=['-fopenmp'], | 16 | extra_compile_args=['-fopenmp'], |
15 | extra_link_args=['-fopenmp']), | 17 | extra_link_args=['-fopenmp']), |
@@ -23,7 +25,7 @@ if sys.platform == 'linux2': | @@ -23,7 +25,7 @@ if sys.platform == 'linux2': | ||
23 | include_dirs=[numpy.get_include()], | 25 | include_dirs=[numpy.get_include()], |
24 | extra_compile_args=['-fopenmp',], | 26 | extra_compile_args=['-fopenmp',], |
25 | extra_link_args=['-fopenmp',]), | 27 | extra_link_args=['-fopenmp',]), |
26 | - ] | 28 | + ]) |
27 | ) | 29 | ) |
28 | 30 | ||
29 | elif sys.platform == 'win32': | 31 | elif sys.platform == 'win32': |
@@ -37,7 +39,21 @@ elif sys.platform == 'win32': | @@ -37,7 +39,21 @@ elif sys.platform == 'win32': | ||
37 | 39 | ||
38 | else: | 40 | else: |
39 | setup( | 41 | setup( |
42 | + packages=["invesalius", ], | ||
40 | cmdclass = {'build_ext': build_ext}, | 43 | cmdclass = {'build_ext': build_ext}, |
41 | - ext_modules = [ Extension("invesalius.data.mips", ["invesalius/data/mips.pyx"], | ||
42 | - include_dirs = [numpy.get_include()],)] | ||
43 | - ) | 44 | + ext_modules = cythonize([Extension("invesalius.data.mips", ["invesalius/data/mips.pyx"], |
45 | + include_dirs = [numpy.get_include()], | ||
46 | + extra_compile_args=['-fopenmp',], | ||
47 | + extra_link_args=['-fopenmp',]), | ||
48 | + | ||
49 | + Extension("invesalius.data.interpolation", ["invesalius/data/interpolation.pyx"], | ||
50 | + include_dirs=[numpy.get_include()], | ||
51 | + extra_compile_args=['-fopenmp',], | ||
52 | + extra_link_args=['-fopenmp',]), | ||
53 | + | ||
54 | + Extension("invesalius.data.transforms", ["invesalius/data/transforms.pyx"], | ||
55 | + include_dirs=[numpy.get_include()], | ||
56 | + extra_compile_args=['-fopenmp',], | ||
57 | + extra_link_args=['-fopenmp',]), | ||
58 | + ]) | ||
59 | + ) |