Skip to content
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

llvmlite do not work with llvm 18.1.7 on MacOS Sonoma (Apple M1) #1062

Closed
2 tasks done
redradist opened this issue Jun 17, 2024 · 6 comments
Closed
2 tasks done

llvmlite do not work with llvm 18.1.7 on MacOS Sonoma (Apple M1) #1062

redradist opened this issue Jun 17, 2024 · 6 comments
Labels

Comments

@redradist
Copy link

Reporting a bug

llvmlite do not work with llvm 18.1.7 on MacOS Sanoma (Apple M1).
Numba got the following error:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/llvmlite/binding/ffi.py", line 136, in __getattr__
    return self._fntab[name]
           ~~~~~~~~~~~^^^^^^
KeyError: 'LLVMPY_AddSymbol'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/llvmlite/binding/ffi.py", line 119, in _load_lib
    _ = self._lib_handle.LLVMPY_GetVersionInfo()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 389, in __getattr__
    func = self.__getitem__(name)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 394, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: dlsym(0x81cf9b10, LLVMPY_GetVersionInfo): symbol not found

It failed already at import stage:

from numba import njit
  • I have tried using the latest released version of llvmlite (most recent is
    visible in the change log (https://github.com/numba/llvmlite/blob/main/CHANGE_LOG).
  • I have included a self contained code sample to reproduce the problem.
    i.e. it's possible to run as 'python bug.py'.
@esc
Copy link
Member

esc commented Jun 17, 2024

@redradist thank you for reporting. The latest release of llvmlite -- 0.43.0 -- is only compatible with llvm 14 as documented here:

https://github.com/numba/llvmlite?tab=readme-ov-file#compatibility

We can't and don't always support the latest LLVM:

https://llvmlite.readthedocs.io/en/latest/faqs.html#why-doesn-t-llvmlite-always-support-the-latest-release-s-of-llvm

Please also look at the issue tracker for open issues regarding future LLVM version support and their current state of implementation and how to help out there.

@esc esc added the question label Jun 17, 2024
@redradist
Copy link
Author

redradist commented Jun 17, 2024

@esc

... The latest release of llvmlite -- 0.43.0 -- is only compatible with llvm 14 as documented here:

https://github.com/numba/llvmlite?tab=readme-ov-file#compatibility

We can't and don't always support the latest LLVM:

https://llvmlite.readthedocs.io/en/latest/faqs.html#why-doesn-t-llvmlite-always-support-the-latest-release-s-of-llvm

Please also look at the issue tracker for open issues regarding future LLVM version support and their current state of implementation and how to help out there.

n documentation is mentioned that llvmlite use static linkage and also I've tried to reinstall llvm using homebrew: brew install llvm@14 and it did not helped at all ...
Looks like issue in static library that was build in llvmlite and provided within package itself

@redradist redradist changed the title llvmlite do not work with llvm 18.1.7 on MacOS Sanoma (Apple M1) llvmlite do not work with llvm 18.1.7 on MacOS Sonoma (Apple M1) Jun 17, 2024
@esc
Copy link
Member

esc commented Jun 17, 2024

n documentation is mentioned that llvmlite use static linkage and also I've tried to reinstall llvm using homebrew: brew install llvm@14 and it did not helped at all ... Looks like issue in static library that was build in llvmlite and provided within package itself

The Numba team only have control over the package distribution across wheels on pypi.org and the numba channel on anaconda.org. Builds of llvmlite distributed through these channels will certainly have static linkage. Other distributors -- like homebrew -- may choose to distribute llvmlite differently and link it dynamically against LLVM, but I don't know exactly what homebrew did. If you believe that the llvmlite distributed via homebrew has not been compiled correctly I would recommend to reach out to the homebrew community. If you simply need Numba/llvmlite to work and don't care about where it came from, I would recommend using the packages we provide via pypi by setting up an appropriate environment (virtualenv?) and then doing:

pip install llvmlite

Or, if you need both Numba and llvmlite:

pip install numba

That should get you setup and going with the most recent versions, Numba 0.60.0 and llvmlite 0.43.0.

Hope this helps?

@Schamschula
Copy link

This is unfortunate. Having multiple versions of llvm/clang floating around the system wastes storage space. On my system I already have Apple's 15.0.0, MacPorts versions 16.0.6 snd 17.0.6. Never mind that it pulls in an older Python version (3.10), used to build llvm/clang-14. I guess I now need to add 14.0.6 to install py312-llvmlite and py312-nndescent.

@esc
Copy link
Member

esc commented Jul 1, 2024

This is unfortunate. Having multiple versions of llvm/clang floating around the system wastes storage space. On my system I already have Apple's 15.0.0, MacPorts versions 16.0.6 snd 17.0.6. Never mind that it pulls in an older Python version (3.10), used to build llvm/clang-14. I guess I now need to add 14.0.6 to install py312-llvmlite and py312-nndescent.

Sorry to hear that you are dissatisfied with the state of LLVM. There isn't anything you can do about it. Ideally, LLVM versions would be backwards compatible, but they are not. This means all dependents will be in a constant state of flux supporting only a subset of LLVM versions and you end up with copies of each LLVM version that is needed by the software you intend to run.

@esc
Copy link
Member

esc commented Jul 1, 2024

My interpretation of the responses here is that this question has been sufficiently answered so I will close this issue accordingly.

@esc esc closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants