File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 33
33
34
34
35
35
class IsalExtension (Extension ):
36
+ """Custom extension to allow for targeted modification."""
36
37
pass
37
38
38
39
@@ -72,15 +73,16 @@ def build_isa_l():
72
73
73
74
74
75
def _add_extension_options (ext : Extension ):
75
- possible_prefixes = [sys .exec_prefix , os .environ .get ("CONDA_PREFIX" ),
76
- sys .base_exec_prefix ]
76
+ # Check current environment (conda or venv first) or base system install
77
+ # (in case of venv) for isa-l include directories. Link dynamically.
78
+ possible_prefixes = [sys .exec_prefix , sys .base_exec_prefix ]
77
79
for prefix in possible_prefixes :
78
- if prefix and os .path .exists (os .path .join (prefix , "include" , "isa-l" )):
80
+ if os .path .exists (os .path .join (prefix , "include" , "isa-l" )):
79
81
# Readthedocs uses a conda environment but does not activate it.
80
82
ext .include_dirs = [os .path .join (prefix , "include" )]
81
83
ext .libraries = ["isal" ]
82
84
break
83
- else :
85
+ else : # If not installed, build isa-l and link statically.
84
86
isa_l_prefix_dir = build_isa_l ()
85
87
ext .include_dirs = [os .path .join (isa_l_prefix_dir , "include" )]
86
88
# -fPIC needed for proper static linking
You can’t perform that action at this time.
0 commit comments