|
1 | | -from distutils.core import setup, Extension |
| 1 | +import numpy as np |
| 2 | + |
| 3 | +from setuptools import setup, Extension |
| 4 | + |
| 5 | +from Cython.Distutils import build_ext |
2 | 6 | from Cython.Build import cythonize |
3 | 7 |
|
4 | | -setup(ext_modules = cythonize(Extension( |
5 | | - "CyFPPS", # the extesion name |
6 | | - sources=['FPPS/CyFPPS.pyx', 'FPPS/FPPSWrapper.cc', |
7 | | - 'FPPS/ChangeCoord.cc', 'FPPS/ElectricFieldSolver.cc', 'FPPS/Mesh.cc', |
8 | | - 'FPPS/ChangeCoord_Frac.cc', 'FPPS/FastPolarPoissonSolver.cc', 'FPPS/NonLinearMesh.cc', |
9 | | - 'FPPS/ChangeCoord_Tanh.cc', 'FPPS/PolarBeamRepresentation.cc', |
10 | | - 'FPPS/ChargeDistribution.cc', 'FPPS/FunctionsFPPS.cc'], # the Cython source and additional C++ source files generate and compile C++ code |
11 | | - language="c++", libraries=[ 'fftw3'] |
12 | | - ))) |
| 8 | + |
| 9 | +cy_ext_options = {"compiler_directives": {"profile": True}, "annotate": True} |
| 10 | +cy_ext = [ |
| 11 | + Extension( |
| 12 | + "CyFPPS", |
| 13 | + sources=[ # the Cython source and additional C++ source files generate and compile C++ code |
| 14 | + 'FPPS/CyFPPS.pyx', 'FPPS/FPPSWrapper.cc', |
| 15 | + 'FPPS/ChangeCoord.cc', 'FPPS/ElectricFieldSolver.cc', 'FPPS/Mesh.cc', |
| 16 | + 'FPPS/ChangeCoord_Frac.cc', 'FPPS/FastPolarPoissonSolver.cc', 'FPPS/NonLinearMesh.cc', |
| 17 | + 'FPPS/ChangeCoord_Tanh.cc', 'FPPS/PolarBeamRepresentation.cc', |
| 18 | + 'FPPS/ChargeDistribution.cc', 'FPPS/FunctionsFPPS.cc'], |
| 19 | + language="c++", include_dirs=[np.get_include()], libraries=['fftw3', 'm']) |
| 20 | +] |
| 21 | + |
| 22 | + |
| 23 | +setup( |
| 24 | + name='PyPIC', |
| 25 | + description='Collection of Python Particle-In-Cell solvers.', |
| 26 | + url='http://github.com/PyCOMPLETE/PyPIC', |
| 27 | + packages=['PyPIC'], |
| 28 | + cmdclass={'build_ext': build_ext}, |
| 29 | + ext_modules=cythonize(cy_ext, **cy_ext_options), |
| 30 | + install_requires=[ |
| 31 | + 'numpy', |
| 32 | + 'cython' |
| 33 | + ] |
| 34 | +) |
0 commit comments