-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
46 lines (40 loc) · 1.26 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
########################################################
# setup.py
# setup script to build extension model
# Author: Jamie Zhu <jimzhu@GitHub>
# Created: 2014/4/20
# Last updated: 2014/7/15
########################################################
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import shutil
import numpy
print('Build extension modules...')
print('==============================================')
ext_modules = [
Extension('P_UIPCC',
['PPCF/P_UIPCC/P_UIPCC.pyx',
'PPCF/P_UIPCC/cP_UIPCC.cpp'
],
language='c++',
include_dirs=[numpy.get_include()],
extra_compile_args=["-O2"]),
Extension('P_PMF',
['PPCF/P_PMF/P_PMF.pyx',
'PPCF/P_PMF/cP_PMF.cpp'
],
language='c++',
include_dirs=[numpy.get_include()],
extra_compile_args=["-O2"])
]
setup(
name = 'Extended Cython module',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
shutil.move('P_UIPCC.so', 'PPCF/P_UIPCC.so')
shutil.move('P_PMF.so', 'PPCF/P_PMF.so')
print('==============================================')
print('Build done.\n')