forked from ColinLii/CC-FJpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupCPU.py
52 lines (43 loc) · 1.41 KB
/
setupCPU.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
# -*- coding: utf-8 -*-
"""
setupCPU.py: compile the CC-FJpy in CPU version.
CC-FJpy: A Python Package for seismic ambient noise cross-correlation and the frequency-Bessel transform method.
:copyright:
Xiaofei Chen Research Group, Department of Earth and Space Sciences, SUSTech, China.
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy
import os
# If you have the Intel MKL installed,
# you can use the Intel Link Line advisor
# and replace the fftw3 library with MKL
# once you have compiled the FFTW3 interface
# called fftw3xc
libs = ['m', 'fftw3f']
args = ['-std=c99', '-O3','-DuseOMP', '-fopenmp']
sources = ['src/ccfj.pyx', 'src/CrossCorr.cpp','src/FJcpu.cpp']
include = ['include',numpy.get_include()]
linkerargs = ['-Wl,-rpath,lib','-fopenmp']
libdirs = ['lib']
extensions = [
Extension("ccfj",
sources=sources,
include_dirs=include,
libraries=libs,
library_dirs=libdirs,
extra_compile_args=args,
language='c++',
extra_link_args=linkerargs)
]
setup(name='ccfj',
version='0.1',
author='Zhengbo Li et al.',
packages=['ccfj'],
ext_modules=cythonize(extensions),
)