""" Distributor init file

Distributors: you can add custom code here to support particular distributions
of numpy.

For example, this is a good place to put any checks for hardware requirements.

The numpy standard source distribution will not put code in this file, so you
can safely replace this file with your own version.
"""
import sys

if sys.platform != "win32":
    import ctypes
    _old_rtld = sys.getdlopenflags()
    # python loads libraries with RTLD_LOCAL, but MKL requires RTLD_GLOBAL
    # pre-load MKL with RTLD_GLOBAL before loading the native extension
    sys.setdlopenflags(_old_rtld | ctypes.RTLD_GLOBAL)

from . import _mklinit

if sys.platform != "win32":
    sys.setdlopenflags(_old_rtld)
    del _old_rtld
    del ctypes

del sys
