Updated Cython compilation and version

This commit is contained in:
Kenneth Jao 2021-12-02 22:41:28 -05:00
parent 85d5486141
commit 9e25496f4d
2 changed files with 41 additions and 23 deletions

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = squish name = squish
version = 0.1.4 version = 0.1.5
author = Kenneth Jao author = Kenneth Jao
author_email = ksjdragon@gmail.com 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. description = squish is Python program which perform simulations for the flow of 'soft' or 'compressible' objects under some energy in a periodic domain.

View File

@ -2,30 +2,48 @@ from setuptools import Extension, setup
import numpy import numpy
try: try:
from Cython.Build import cythonize from Cython.Build import cythonize
USE_CYTHON = True
USE_CYTHON = True
except ImportError: except ImportError:
USE_CYTHON = False USE_CYTHON = False
if USE_CYTHON: if USE_CYTHON:
ext_modules = cythonize([ ext_modules = cythonize(
Extension( [
"_squish", Extension(
["squish/_squish/_squish.pyx"], "squish.core",
extra_compile_args=['-fopenmp'], ["squish/core.pyx"],
extra_link_args=['-fopenmp'] define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
) ),
], Extension(
compiler_directives={ "squish.voronoi",
'language_level': 3, 'boundscheck' : False, 'wraparound': False, 'cdivision' : True ["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: else:
ext_modules = [ ext_modules = [
Extension('squish._squish', ["squish/_squish/_squish.c"]) 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()])
setup(
ext_modules = ext_modules,
include_dirs = [numpy.get_include()]
)