def _use_ldconfig(name):
        """
        Find so in `ldconfig -p`.
        It does not handle LD_LIBRARY_PATH.
        """
        with change_env('LC_ALL', 'C'), change_env('LANG', 'C'):
            ldconfig, ret = subproc_call("ldconfig -p")
            ldconfig = ldconfig.decode('utf-8')
            if ret != 0:
                return None
        expr = r'\s+(lib%s\.[^\s]+)\s+\(.*=>\s+(.*)' % (re.escape(name))
        res = re.search(expr, ldconfig)
        if not res:
            return None
        else:
            ret = res.group(2)
            return os.path.realpath(ret)

        Find so in `ldconfig -p`.
        It does not handle LD_LIBRARY_PATH.
        
tensorpack/utils/utils.py