diff --git a/setup.cfg b/setup.cfg index 6710351..9893210 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = squish -version = 0.1.4 +version = 0.1.5 author = Kenneth Jao author_email = ksjdragon@gmail.com description = squish is Python program which perform simulations for the flow of 'soft' or 'compressible' objects under some energy in a periodic domain. diff --git a/setup.py b/setup.py index 13e045f..08d5f53 100644 --- a/setup.py +++ b/setup.py @@ -2,30 +2,48 @@ from setuptools import Extension, setup import numpy try: - from Cython.Build import cythonize - USE_CYTHON = True + from Cython.Build import cythonize + + USE_CYTHON = True except ImportError: - USE_CYTHON = False + USE_CYTHON = False if USE_CYTHON: - ext_modules = cythonize([ - Extension( - "_squish", - ["squish/_squish/_squish.pyx"], - extra_compile_args=['-fopenmp'], - extra_link_args=['-fopenmp'] - ) - ], - compiler_directives={ - 'language_level': 3, 'boundscheck' : False, 'wraparound': False, 'cdivision' : True - }) + ext_modules = cythonize( + [ + Extension( + "squish.core", + ["squish/core.pyx"], + define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")], + ), + Extension( + "squish.voronoi", + ["squish/voronoi.pyx"], + extra_compile_args=["-fopenmp"], + extra_link_args=["-fopenmp"], + define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")], + ), + Extension( + "squish.energy", + ["squish/energy.pyx"], + extra_compile_args=["-fopenmp"], + extra_link_args=["-fopenmp"], + define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")], + ), + ], + annotate=False, + compiler_directives={ + "language_level": 3, + "boundscheck": False, + "wraparound": False, + "cdivision": True, + }, + ) else: - ext_modules = [ - Extension('squish._squish', ["squish/_squish/_squish.c"]) -] + ext_modules = [ + Extension("squish.core", ["squish/core.c"]), + Extension("squish.voronoi", ["squish/voronoi.c"]), + Extension("squish.energy", ["squish/energy.c"]), + ] -#annotate='fullc' -setup( - ext_modules = ext_modules, - include_dirs = [numpy.get_include()] -) \ No newline at end of file +setup(ext_modules=ext_modules, include_dirs=[numpy.get_include()])