Commit 927a2ff6 authored by Pierre Augier's avatar Pierre Augier
Browse files

transonic_cl.cythonize.py

parent a50050df1913
......@@ -110,8 +110,9 @@ class Backend:
code = file.read()
analyse = analyse_aot(code, path_py)
code_backend, code_ext, lines_pxd = self.make_backend_code(path_py, analyse)
code_backend, code_ext, lines_pxd = self.make_backend_code(
path_py, analyse
)
if not code_backend:
return
......@@ -172,7 +173,11 @@ class Backend:
)
code = ["\n" + code_dependance + "\n"]
lines_pxd = ["import cython"] # , "import numpy as np", "cimport numpy as np"]
lines_pxd = []
if self.name == "cython":
lines_pxd = [
"import cython\n\nimport numpy as np\ncimport numpy as np\n\n"
]
# Deal with functions
for func_name, fdef in boosted_dicts["functions"].items():
......
import sys
from distutils.core import setup
from Cython.Build import cythonize
import numpy as np
path = sys.argv.pop()
sys.argv.extend(("build_ext", "--inplace"))
setup(ext_modules=cythonize(path), include_dirs=[np.get_include()])
......@@ -107,7 +107,7 @@ def main():
if backend == "pythran":
args.insert(0, "pythran")
elif backend == "cython":
args = ["cythonize", "-i", "-3", name]
args = [sys.executable, "-m", "transonic_cl.cythonize", name]
name_lock.touch()
try:
completed_process = subprocess.run(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment