File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments