# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------

# This file can be modified by setup.py when building a manylinux2010 wheel
# When modified, it will preload some libraries needed for the python C extension
from ctypes import CDLL, RTLD_GLOBAL
import site
import os

try:
    cur_dir = os.path.realpath(os.path.dirname(__file__))
    _libonnxruntime = CDLL(os.path.join(cur_dir, "libonnxruntime.so.1"), mode=RTLD_GLOBAL)
    #_libonnxruntime_mlas = CDLL(os.path.join(cur_dir, "libonnxruntime_mlas.so"), mode=RTLD_GLOBAL)
    #_libonnxruntime_providers_shared = CDLL(os.path.join(cur_dir, "libonnxruntime_providers_shared.so"), mode=RTLD_GLOBAL)
except Exception as e:
    raise ImportError("can not find libonnxruntime in sitepackages.")
