python/treelite/libpath.py [13:47]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def find_lib_path(basename, libformat=True):
  """Find the path to treelite dynamic library files.

  Parameters
  ----------
  basename : :py:class:`str <python:str>`
      the base name of library
  libformat : boolean, optional (default True)
      if True, transform the base name to obtain the file name of the library
      ({}.dll on Windows; lib{}.so on Linux; lib{}.dylib on Mac OS X)
      if False, do not transform the base name at all; use it as a file name
      (this is useful to locate a file that's not a shared library)

  Returns
  -------
  lib_path: :py:class:`list <python:list>` of :py:class:`str <python:str>`
     List of all found library path to treelite
  """
  if libformat:
    if sys.platform == 'win32':
      lib_name = '{}.dll'.format(basename)
    elif sys.platform.startswith('linux'):
      lib_name = 'lib{}.so'.format(basename)
    elif sys.platform == 'darwin':
      lib_name = 'lib{}.dylib'.format(basename)
    else:
      raise RuntimeError('Unsupported operating system')
  else:
    lib_name = basename

  curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
  # List possible locations for the library file
  dll_path = [curr_path,
              os.path.join(curr_path, '../../lib/'),
              os.path.join(curr_path, '../../build/lib/'),
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/native/python/treelite_runtime/libpath.py [14:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def find_lib_path(basename, libformat=True):
  """Find the path to treelite dynamic library files.

  Parameters
  ----------
  basename : :py:class:`str <python:str>`
      the base name of library
  libformat : boolean, optional (default True)
      if True, transform the base name to obtain the file name of the library
      ({}.dll on Windows; lib{}.so on Linux; lib{}.dylib on Mac OS X)
      if False, do not transform the base name at all; use it as a file name
      (this is useful to locate a file that's not a shared library)

  Returns
  -------
  lib_path: :py:class:`list <python:list>` of :py:class:`str <python:str>`
     List of all found library path to treelite
  """
  if libformat:
    if sys.platform == 'win32':
      lib_name = '{}.dll'.format(basename)
    elif sys.platform.startswith('linux'):
      lib_name = 'lib{}.so'.format(basename)
    elif sys.platform == 'darwin':
      lib_name = 'lib{}.dylib'.format(basename)
    else:
      raise RuntimeError('Unsupported operating system')
  else:
    lib_name = basename

  curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
  # List possible locations for the library file
  dll_path = [curr_path,
              os.path.join(curr_path, '../../lib/'),
              os.path.join(curr_path, '../../build/lib/'),
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



