def _use_ld(name):
        """
        Find so with `ld -lname -Lpath`.
        It will search for files in LD_LIBRARY_PATH, but not in ldconfig.
        """
        cmd = "ld -t -l{} -o {}".format(name, os.devnull)
        ld_lib_path = os.environ.get('LD_LIBRARY_PATH', '')
        for d in ld_lib_path.split(':'):
            cmd = cmd + " -L " + d
        result, ret = subproc_call(cmd + '|| true')
        expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
        res = re.search(expr, result.decode('utf-8'))
        if res:
            res = res.group(0)
            if not os.path.isfile(res):
                return None
            return os.path.realpath(res)

        Find so with `ld -lname -Lpath`.
        It will search for files in LD_LIBRARY_PATH, but not in ldconfig.
        
tensorpack/utils/utils.py