-
Notifications
You must be signed in to change notification settings - Fork 54
/
setup.py
70 lines (59 loc) · 1.72 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python
"""
setup.py file for SWIG
"""
from setuptools import Extension, setup, find_packages
import distutils.command.build
import sysconfig
import numpy
import os
import shutil
# 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()
libraries = ['fftw3f']
comp_args = ["/arch:AVX","/O2","/openmp"]
link_args = []
files2 = [ "omp.h",
"fftw3.h",
"fftw3f.dll",
"fftw3f.lib",
"libfftw3fmac.a",
"libfftw3f_ompmac.a",
"libfftw3fl.so",
"libfftw3f_ompl.so",
"libomp.a"
]
files = [
"fcwt.h",
"fcwt.cpp"
]
files = files + files2
if "macosx" in sysconfig.get_platform() or "darwin" in sysconfig.get_platform():
libraries = ['fftw3fmac','fftw3f_ompmac']
comp_args = ["-mavx","-O3"]
link_args = ["-lomp"]
if "linux" in sysconfig.get_platform():
libraries = ['fftw3fl','fftw3f_ompl']
comp_args = ["-mavx","-O3"]
link_args = ["-lomp"]
setup (ext_modules=[
Extension('fcwt._fcwt',
sources=[
'src/fcwt/fcwt.cpp',
'src/fcwt/fcwt_wrap.cxx'
],
library_dirs = ['src/fcwt','src'],
include_dirs = ['src/fcwt','src',numpy_include],
libraries = libraries,
extra_compile_args = comp_args,
extra_link_args = link_args
)
],
packages=find_packages(where='src'),
package_dir={'fcwt': 'src/fcwt'},
package_data={'fcwt':files}
)
#swig -c++ -python fcwt-swig.i