codon-jit 0.5.6__tar.gz → 0.5.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codon_jit-0.5.6 → codon_jit-0.5.7}/PKG-INFO +1 -1
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon/decorator.py +14 -2
- codon_jit-0.5.7/codon/version.py +5 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon_jit.egg-info/PKG-INFO +1 -1
- {codon_jit-0.5.6 → codon_jit-0.5.7}/setup.py +6 -3
- codon_jit-0.5.6/codon/version.py +0 -5
- {codon_jit-0.5.6 → codon_jit-0.5.7}/MANIFEST.in +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/README.md +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon/__init__.py +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon/jit.pxd +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon/jit.pyx +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon_jit.egg-info/SOURCES.txt +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon_jit.egg-info/dependency_links.txt +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon_jit.egg-info/requires.txt +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/codon_jit.egg-info/top_level.txt +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/pyproject.toml +0 -0
- {codon_jit-0.5.6 → codon_jit-0.5.7}/setup.cfg +0 -0
|
@@ -14,15 +14,27 @@ import astunparse
|
|
|
14
14
|
import numpy as np
|
|
15
15
|
from pathlib import Path
|
|
16
16
|
|
|
17
|
-
sys.
|
|
17
|
+
if sys.platform == "win32":
|
|
18
|
+
# Keep the directory handles alive while the extension uses these DLLs.
|
|
19
|
+
_dll_directories = []
|
|
20
|
+
if os.environ.get("CODON_DIR"):
|
|
21
|
+
for _subdir in ("bin", "lib/codon"):
|
|
22
|
+
_dll_directories.append(os.add_dll_directory(
|
|
23
|
+
str(Path(os.environ["CODON_DIR"]) / _subdir)))
|
|
24
|
+
else:
|
|
25
|
+
sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
|
|
18
26
|
|
|
19
27
|
from .codon_jit import JITWrapper, JITError, codon_library
|
|
20
28
|
|
|
21
29
|
if "CODON_PATH" not in os.environ:
|
|
22
30
|
codon_path = []
|
|
31
|
+
if os.environ.get("CODON_DIR"):
|
|
32
|
+
codon_path.append(Path(os.environ["CODON_DIR"]) / "lib" / "codon" / "stdlib")
|
|
23
33
|
codon_lib_path = codon_library()
|
|
24
34
|
if codon_lib_path:
|
|
25
|
-
|
|
35
|
+
library_dir = Path(codon_lib_path).parent
|
|
36
|
+
codon_path.append(library_dir / "stdlib")
|
|
37
|
+
codon_path.append(library_dir.parent / "lib" / "codon" / "stdlib")
|
|
26
38
|
codon_path.append(
|
|
27
39
|
Path(os.path.expanduser("~")) / ".codon" / "lib" / "codon" / "stdlib")
|
|
28
40
|
for path in codon_path:
|
|
@@ -36,7 +36,7 @@ if (
|
|
|
36
36
|
):
|
|
37
37
|
print(
|
|
38
38
|
"Cannot find Codon.",
|
|
39
|
-
|
|
39
|
+
"Please install the Codon SDK: https://docs.exaloop.io/start/install/",
|
|
40
40
|
"or set CODON_DIR if Codon is not in PATH or installed in ~/.codon",
|
|
41
41
|
file=sys.stderr,
|
|
42
42
|
)
|
|
@@ -45,7 +45,10 @@ codon_path = codon_path.resolve()
|
|
|
45
45
|
print("Codon: " + str(codon_path))
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
if sys.platform == "
|
|
48
|
+
if sys.platform == "win32":
|
|
49
|
+
libraries = ["codonrt", "codonc"]
|
|
50
|
+
linker_args = []
|
|
51
|
+
elif sys.platform == "darwin":
|
|
49
52
|
libraries=["codonrt", "codonc"]
|
|
50
53
|
linker_args = ["-Wl,-rpath," + str(codon_path / "lib" / "codon")]
|
|
51
54
|
else:
|
|
@@ -68,7 +71,7 @@ jit_extension = Extension(
|
|
|
68
71
|
sources=["codon/jit.pyx"],
|
|
69
72
|
libraries=libraries,
|
|
70
73
|
language="c",
|
|
71
|
-
extra_compile_args=["-w"],
|
|
74
|
+
extra_compile_args=["/w"] if sys.platform == "win32" else ["-w"],
|
|
72
75
|
extra_link_args=linker_args,
|
|
73
76
|
include_dirs=[str(codon_path / "include")],
|
|
74
77
|
library_dirs=[str(codon_path / "lib" / "codon")],
|
codon_jit-0.5.6/codon/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|