Commit 6ef2418b by Junru Shao Committed by Tianqi Chen

[BUGFIX] Fix search path for libtvm_topi.so (#4467)

parent 24713bde
...@@ -90,7 +90,7 @@ def find_lib_path(name=None, search_path=None, optional=False): ...@@ -90,7 +90,7 @@ def find_lib_path(name=None, search_path=None, optional=False):
dll_path = [os.path.realpath(x) for x in dll_path] dll_path = [os.path.realpath(x) for x in dll_path]
if search_path is not None: if search_path is not None:
if search_path is list: if isinstance(search_path, list):
dll_path = dll_path + search_path dll_path = dll_path + search_path
else: else:
dll_path.append(search_path) dll_path.append(search_path)
...@@ -167,7 +167,7 @@ def find_include_path(name=None, search_path=None, optional=False): ...@@ -167,7 +167,7 @@ def find_include_path(name=None, search_path=None, optional=False):
header_path = [os.path.abspath(x) for x in header_path] header_path = [os.path.abspath(x) for x in header_path]
if search_path is not None: if search_path is not None:
if search_path is list: if isinstance(search_path, list):
header_path = header_path + search_path header_path = header_path + search_path
else: else:
header_path.append(search_path) header_path.append(search_path)
......
...@@ -32,7 +32,7 @@ def _get_lib_names(): ...@@ -32,7 +32,7 @@ def _get_lib_names():
def _load_lib(): def _load_lib():
"""Load libary by searching possible path.""" """Load libary by searching possible path."""
curr_path = os.path.dirname(os.path.realpath(os.path.expanduser(__file__))) curr_path = os.path.dirname(os.path.realpath(os.path.expanduser(__file__)))
lib_search = curr_path lib_search = [curr_path, os.path.dirname(curr_path)]
lib_path = libinfo.find_lib_path(_get_lib_names(), lib_search, optional=True) lib_path = libinfo.find_lib_path(_get_lib_names(), lib_search, optional=True)
if lib_path is None: if lib_path is None:
return None, None return None, None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment