-
Notifications
You must be signed in to change notification settings - Fork 187
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
Segfault Loading Numba #220
Comments
Possibly there is a conflict between the LLVM version used in Julia and the LLVM version used in Numba? Loading two versions of the same shared library simultaneously is often asking for trouble (see e.g. #65). |
@stevengj Thanks for your input.
I also tried both using LLVM 3.6. Back on most recent numba using llvm 3.6, I tried rebuilding Julia so that it uses LLVM 3.6, the same version that numba is using, and got this segmentation fault:
|
@Keno, any thoughts on whether Julia's use of LLVM would conflict with Numba's? |
Only if either of them use LLVM as a shared library. |
Aren't both of them using LLVM as a shared library? |
@xanderdunn, what is your |
By default julia statically links LLVM. |
|
I used LLVM3.7 for latest numba (self-built llvmlite) on ubuntu, there is no problem importing numba. |
Thanks for the update, @GaZ3ll3. Hopefully the problem has disappeared with recent versions. |
Closing as this seems to be resolved. |
I tried to make sure Anaconda uses the correct llvm by installing
but
|
Update: After fixing the number installation (back to LLVM 3.7 via llvmlite) I tried on julia 0.5, and
|
@cortner Did you ever get this figured out? I can't seem to get numba and llvmlite to work with PyCall without it segfaulting (I even tried building llvmlite with julia's llvm-config). |
I think only partially. Eventually I just gave up. |
FWIW, the solution to my problem had 2 parts.
# We need install a specific version of llvmlite which supports the same minor version of
# llvm used with julia. https://github.com/numba/llvmlite#compatibility
const llvm_version = VersionNumber(Base.libllvm_version)
if llvm_version > v"4.0.0"
pip_install("llvmlite==0.17.0")
elseif llvm_version > v"3.9.0"
pip_install("llvmlite==0.16.0")
elseif llvm_version > v"3.8.0"
pip_install("llvmlite==0.15.0")
elseif llvm_version > v"3.7.0"
pip_install("llvmlite==0.12.1")
elseif llvm_version > v"3.6.0"
pip_install("llvmlite==0.8.0")
else
error("Can't find a version of llvmlite that support $llvm_version")
end NOTE:
# This needs to be set before `using PyCall` otherwise the numba library won't see it
# at load time ? :/
ENV["NUMBA_DISABLE_JIT"] = 1
using PyCall |
Happened to me too. |
None of the above worked for me: Julia 1.4.2 using Conda
using PyCall
#Look here for compatibility https://github.com/numba/llvmlite#compatibility
# with this Base.libllvm_version
# For my v"8.0.1" it was llvm<=0.32.0 which is numba=0.48
#Conda.add("numba=0.48")
py"""
from numba import njit
@njit
def py_numba_sum(A):
s = 0.0
for a in A:
s += a
return s
"""
sum_numba_py = py"py_numba_sum" Any advise or help would be highly appreciated! |
When I add an
import numba
to a Python file that I load via PyCall, I get this segmentation fault at runtime:Running Python from the command line and importing numba doesn't cause any errors.
PyCall and command line are using the same Python installation. I rebuilt PyCall to make sure.
llvm being used was built with
brew install llvm
.The text was updated successfully, but these errors were encountered: