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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codon-jit
3
- Version: 0.5.6
3
+ Version: 0.5.7
4
4
  Summary: Codon JIT decorator
5
5
  Home-page: https://exaloop.io
6
6
  Author: Exaloop Inc.
@@ -14,15 +14,27 @@ import astunparse
14
14
  import numpy as np
15
15
  from pathlib import Path
16
16
 
17
- sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
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
- codon_path.append(Path(codon_lib_path).parent / "stdlib")
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:
@@ -0,0 +1,5 @@
1
+ __version__ = "0.5.7"
2
+ CODON_VERSION = "0.20.7"
3
+ CODON_VERSION_MAJOR = 0
4
+ CODON_VERSION_MINOR = 20
5
+ CODON_VERSION_PATCH = 7
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codon-jit
3
- Version: 0.5.6
3
+ Version: 0.5.7
4
4
  Summary: Codon JIT decorator
5
5
  Home-page: https://exaloop.io
6
6
  Author: Exaloop Inc.
@@ -36,7 +36,7 @@ if (
36
36
  ):
37
37
  print(
38
38
  "Cannot find Codon.",
39
- 'Please either install Codon (/bin/bash -c "$(curl -fsSL https://exaloop.io/install.sh)"),',
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 == "darwin":
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")],
@@ -1,5 +0,0 @@
1
- __version__ = "0.5.6"
2
- CODON_VERSION = "0.20.6"
3
- CODON_VERSION_MAJOR = 0
4
- CODON_VERSION_MINOR = 20
5
- CODON_VERSION_PATCH = 6
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes