Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test/test_runner.py:11: in get_cpu
- cpu = LLVM_CPU(rtyper=None, stats=FakeStats())
- runner.py:14: in __init__
- if not self.InitializeNativeTarget(None):
- ../../../rtyper/lltypesystem/rffi.py:313: in wrapper
- res = call_external_function(*real_args)
- <281-codegen /home/muke/Programming/Project/pypy/rpython/rtyper/lltypesystem/rffi.py:211>:13: in call_external_function
- res = funcptr(a0)
- ../../../rtyper/lltypesystem/lltype.py:1390: in __call__
- return callb(*args)
- ../../../rtyper/lltypesystem/ll2ctypes.py:1323: in __call__
- cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- funcptr = <* fn LLVMInitializeNativeTarget>, calling_conv = 'c'
- def get_ctypes_callable(funcptr, calling_conv):
- if not ctypes:
- raise ImportError("ctypes is needed to use ll2ctypes")
- def get_on_lib(lib, elem):
- """ Wrapper to always use lib[func] instead of lib.func
- """
- try:
- return lib[elem]
- except AttributeError:
- pass
- old_eci = funcptr._obj.compilation_info
- funcname = funcptr._obj._name
- if hasattr(old_eci, '_with_ctypes'):
- old_eci = old_eci._with_ctypes
- try:
- eci = _eci_cache[old_eci]
- except KeyError:
- eci = old_eci.compile_shared_lib(ignore_a_files=True,
- defines=['RPYTHON_LL2CTYPES'])
- _eci_cache[old_eci] = eci
- libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
- FUNCTYPE = lltype.typeOf(funcptr).TO
- cfunc = None
- if libraries:
- not_found = []
- for libname in libraries:
- libpath = None
- ext = platform.so_ext
- prefixes = platform.so_prefixes
- for dir in eci.library_dirs:
- if libpath:
- break
- for prefix in prefixes:
- tryfile = os.path.join(dir, prefix + libname + '.' + ext)
- if os.path.isfile(tryfile):
- libpath = tryfile
- break
- if not libpath:
- libpath = ctypes.util.find_library(libname)
- if not libpath:
- libpath = _findLib_gcc_fallback(libname)
- if not libpath and os.path.isabs(libname):
- libpath = libname
- if libpath:
- dllclass = getattr(ctypes, calling_conv + 'dll')
- # on ie slackware there was need for RTLD_GLOBAL here.
- # this breaks a lot of things, since passing RTLD_GLOBAL
- # creates symbol conflicts on C level.
- clib = dllclass._dlltype(libpath, **load_library_kwargs)
- cfunc = get_on_lib(clib, funcname)
- if cfunc is not None:
- break
- else:
- not_found.append(libname)
- if cfunc is None:
- if _FREEBSD and funcname in ('dlopen', 'fdlopen', 'dlsym', 'dlfunc', 'dlerror', 'dlclose'):
- cfunc = rtld_default_lib[funcname]
- else:
- cfunc = get_on_lib(standard_c_lib, funcname)
- # XXX magic: on Windows try to load the function from 'kernel32' too
- if cfunc is None and hasattr(ctypes, 'windll'):
- cfunc = get_on_lib(ctypes.windll.kernel32, funcname)
- if cfunc is None and hasattr(ctypes, 'windll'):
- cfunc = get_on_lib(ctypes.cdll.msvcrt, funcname)
- if cfunc is None:
- # function name not found in any of the libraries
- if not libraries:
- place = 'the standard C library (missing libraries=...?)'
- elif len(not_found) == len(libraries):
- if len(not_found) == 1:
- raise NotImplementedError(
- 'cannot find the library %r' % (not_found[0],))
- else:
- raise NotImplementedError(
- 'cannot find any of the libraries %r' % (not_found,))
- elif len(libraries) == 1:
- place = 'library %r' % (libraries[0],)
- else:
- place = 'any of the libraries %r' % (libraries,)
- if not_found:
- place += ' (did not find %r)' % (not_found,)
- raise NotImplementedError("function %r not found in %s" % (
- > funcname, place))
- E NotImplementedError: function 'LLVMInitializeNativeTarget' not found in library 'LLVM-11'
Add Comment
Please, Sign In to add comment