File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 30
30
# need library matching operating system
31
31
platform = sys .platform .lower ()
32
32
if "linux" in platform :
33
- pattern = "highs_bindings.*.so"
33
+ patterns = [ "highs_bindings.*.so" , "_core.*.so" ]
34
34
elif platform .startswith ("win" ):
35
- pattern = "highs_bindings.*.pyd"
35
+ patterns = [ "highs_bindings.*.pyd" , "_core.*.pyd" ]
36
36
elif any (platform .startswith (p ) for p in ("darwin" , "macos" )):
37
- pattern = "highs_bindings.*.so"
37
+ patterns = [ "highs_bindings.*.so" , "_core.*.so" ]
38
38
else :
39
39
raise NotImplementedError (f"{ sys .platform } not supported!" )
40
40
41
41
# 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
43
48
logger .debug ("Choosing HiGHS library {libfile} via highspy package." )
44
49
45
50
highslib = ffi .dlopen (libfile )
You can’t perform that action at this time.
0 commit comments