Skip to content

Commit cb62f07

Browse files
AdeelK93tuliotoffolo
authored andcommitted
Support _core highslib
1 parent eb3dd63 commit cb62f07

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mip/highs.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@
3030
# need library matching operating system
3131
platform = sys.platform.lower()
3232
if "linux" in platform:
33-
pattern = "highs_bindings.*.so"
33+
patterns = ["highs_bindings.*.so", "_core.*.so"]
3434
elif platform.startswith("win"):
35-
pattern = "highs_bindings.*.pyd"
35+
patterns = ["highs_bindings.*.pyd", "_core.*.pyd"]
3636
elif any(platform.startswith(p) for p in ("darwin", "macos")):
37-
pattern = "highs_bindings.*.so"
37+
patterns = ["highs_bindings.*.so", "_core.*.so"]
3838
else:
3939
raise NotImplementedError(f"{sys.platform} not supported!")
4040

4141
# there should only be one match
42-
[libfile] = glob.glob(os.path.join(pkg_path, pattern))
42+
matched_files = []
43+
for pattern in patterns:
44+
matched_files.extend(glob.glob(os.path.join(pkg_path, pattern)))
45+
if len(matched_files) != 1:
46+
raise FileNotFoundError(f"Could not find HiGHS library in {pkg_path}.")
47+
[libfile] = matched_files
4348
logger.debug("Choosing HiGHS library {libfile} via highspy package.")
4449

4550
highslib = ffi.dlopen(libfile)

0 commit comments

Comments
 (0)