New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal error when using CFFI .lib directly #1688
Comments
A workaround was needed, see numba/numba#1688
cffi libraries don't have a |
Fair enough. conda cffi is a bit behind though, so I'll try with the latest version and see what happens. |
Confirmed that a release was fixed for cffi 1.5.0 https://bitbucket.org/cffi/cffi/issues/236/compiledlib-breaks I guess you folks have an excuse to update the package :) The error persists in a different way though: 1.0
Traceback (most recent call last):
File "numba_cffi.py", line 19, in <module>
print(cffi_test_fail(1))
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/dispatcher.py", line 171, in _compile_for_args
return self.compile(sig)
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/dispatcher.py", line 349, in compile
flags=flags, locals=self.locals)
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 665, in compile_extra
return pipeline.compile_extra(func)
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 366, in compile_extra
return self.compile_bytecode(bc, func_attr=self.func_attr)
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 375, in compile_bytecode
return self._compile_bytecode()
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 652, in _compile_bytecode
return pm.run(self.status)
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 251, in run
raise patched_exception
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 243, in run
res = stage()
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 463, in stage_nopython_frontend
self.locals)
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/compiler.py", line 780, in type_inference_stage
infer.propagate()
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/typeinfer.py", line 565, in propagate
raise errors[0]
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/typeinfer.py", line 111, in propagate
constraint(typeinfer)
File "/home/juanlu/.miniconda3/envs/hyper35/lib/python3.5/site-packages/numba/typeinfer.py", line 354, in __call__
raise UntypedAttributeError(ty, self.attr, loc=self.inst.loc)
numba.errors.UntypedAttributeError: Failed at nopython (nopython frontend)
Unknown attribute "lib" of type Module(<module '_hyper' from '/home/juanlu/Development/Python/Pybonacci/cffi_test/src/_hyper.cpython-35m-x86_64-linux-gnu.so'>)
File "numba_cffi.py", line 14
|
Is this final issue a duplicate of #1849? |
I don't think so, since that's not the same error. |
I've had a look at this and can replicate with a trivial cffi module that accesses |
Apparently
numba.njit
can infer the type of the CFFI function if I extract it first to a variable, but fails if I accesmod.lib.func
directly. Example:The text was updated successfully, but these errors were encountered: