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

RuntimeError: Can't find llvm-readobj-18! #119515

Open
johannesnoordanus opened this issue May 24, 2024 · 3 comments
Open

RuntimeError: Can't find llvm-readobj-18! #119515

johannesnoordanus opened this issue May 24, 2024 · 3 comments
Labels
build The build process and cross-build topic-JIT type-bug An unexpected behavior, bug, or error

Comments

@johannesnoordanus
Copy link

johannesnoordanus commented May 24, 2024

Bug report

Bug description:

I build Python-3.13.0b1 with configure ./configure --enable-experimental-jit=yes (I also tried adding --enable-optimizations) on Linux orangepi3b 6.8.10-edge-rockchip64 #1 SMP PREEMPT Fri May 17 10:15:12 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
After a while I get a runtime error:

RuntimeError: Can't find llvm-readobj-18!

I installed llvm-18 (otherwise I got an error much sooner).

The error lead-up is shown below:

================================================================
JIT support for aarch64-unknown-linux-gnu is still experimental!
            Please report any issues you encounter.             
================================================================

  + Exception Group Traceback (most recent call last):
  |   File "/home/johannes/projects/Python-3.13.0b1/./Tools/jit/build.py", line 28, in <module>
  |     args.target.build(pathlib.Path.cwd(), comment=comment, force=args.force)
  |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_targets.py", line 214, in build
  |     stencil_groups = asyncio.run(self._build_stencils())
  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
  |     return runner.run(main)
  |            ^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
  |     return self._loop.run_until_complete(task)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 664, in run_until_complete
  |     return future.result()
  |            ^^^^^^^^^^^^^^^
  |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_targets.py", line 189, in _build_stencils
  |     async with asyncio.TaskGroup() as group:
  |   File "/usr/local/lib/python3.12/asyncio/taskgroups.py", line 147, in __aexit__
  |     raise me from None
  | ExceptionGroup: unhandled errors in a TaskGroup (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_targets.py", line 181, in _compile
    |     return await self._parse(o)
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_targets.py", line 80, in _parse
    |     output = await _llvm.run("llvm-readobj", args, echo=self.verbose)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_llvm.py", line 99, in run
    |     raise RuntimeError(f"Can't find {tool}-{_LLVM_VERSION}!")
    | RuntimeError: Can't find llvm-readobj-18!
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_targets.py", line 181, in _compile
    |     return await self._parse(o)
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_targets.py", line 80, in _parse
    |     output = await _llvm.run("llvm-readobj", args, echo=self.verbose)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/johannes/projects/Python-3.13.0b1/Tools/jit/_llvm.py", line 99, in run
    |     raise RuntimeError(f"Can't find {tool}-{_LLVM_VERSION}!")
    | RuntimeError: Can't find llvm-readobj-18!
    +------------------------------------

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@johannesnoordanus johannesnoordanus added the type-bug An unexpected behavior, bug, or error label May 24, 2024
@Eclips4
Copy link
Member

Eclips4 commented May 24, 2024

Hello!
It seems that you missing llvm-readobj-18 on your system, which is needed for CPython JIT.
Please, read the https://github.com/python/cpython/blob/main/Tools/jit/README.md for more information.

@AlexWaygood AlexWaygood added the build The build process and cross-build label May 24, 2024
@johannesnoordanus
Copy link
Author

Hello! It seems that you missing llvm-readobj-18 on your system, which is needed for CPython JIT. Please, read the https://github.com/python/cpython/blob/main/Tools/jit/README.md for more information.

Thanks, I read that and installed llvm-18 as mentioned in the README.md:

Linux

Install LLVM 18 on Ubuntu/Debian:

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18

It seems that clang-18 did get installed, but all llvm- tools were missing.
I had to issue the following command to get the llvm tools installed:

sudo apt install llvm-18

I think a bug within llvm.sh? Or perhaps llvm.sh isn't compatible with Armbian?

Anyway thanks again, my python 13 build is running now.

@sobolevn
Copy link
Member

Try following your sudo ./llvm.sh 18 with

sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
sudo update-alternatives --set clang /usr/bin/clang-18
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
sudo update-alternatives --set clang++ /usr/bin/clang++-18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build topic-JIT type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants