-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
42 lines (35 loc) · 1.45 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
# Numair Khan, James Tompkin
# [2020-10-02] Initial setup file from lab3 run on 2020-10-01
#
# from distutils.core import setup
# from distutils.extension import Extension
# from Cython.Distutils import build_ext
# ext_modules=[ Extension("filt",
# ["filt_cython.pyx"],
# libraries=["m"],
# extra_compile_args = ["-ffast-math"])]
# setup(
# name = "filt",
# cmdclass = {"build_ext": build_ext},
# ext_modules = ext_modules)
# [2020-10-02] More up to date using
from setuptools import setup
from setuptools.extension import Extension
from Cython.Build import cythonize
import sys
if sys.platform == "win32":
ext_mods = [ Extension("bilateralFilter",
["bilateralFilter"]
)]
else:
ext_mods = [ Extension("bilateralFilter",
["bilateralFilter.pyx"],
# Compiling on Windows, we have commented out the next two lines.
libraries=["m"],
extra_compile_args = ["-ffast-math", "-fopenmp"],
extra_link_args = ["-fopenmp"] # This will work on gcc; other C compilers would have different flags, but this isn't required. Visual C will not recognize it.
)]
setup(
name = "bilateralFilter",
ext_modules = cythonize(ext_mods)
)