ubuntu20.04源码编译安装qemu(qemu8.2)

ubuntu20.04源码安装qemu8.2

本文用于记录在ubuntu20中源码编译安装qemu8.2,同时也希望能够对你有所帮助。

一、download qemu
根据自己的需求下载对应版本的qemu源码压缩包。

 https://github.com/qemu/qemu/tags

在这里插入图片描述

二、build qemu
解压缩后,执行下述命令。执行…/configure后,会发现其他的报错信息,下面对其进行详解

mkdir build
cd build
../configure
make

在这里插入图片描述
三、报错信息和解决方案

(一)、缺少ensurepip 和 setuptools python 模块。
ensurepip and separately module is not found,导致python venv creation failed。

WARNING: unrecognized host CPU, proceeding with 'uname -m' output 'x86_64'
python determined to be '/usr/bin/python3'
python version: Python 3.8.10

*** Ouch! ***

Python's ensurepip module is not found.
It's normally part of the Python standard library, maybe your distribution packages it separately?
Either install ensurepip, or alleviate the need for it in the first place by installing pip and setuptools for '/usr/bin/python3'.
(Hint: Debian puts ensurepip in its python3-venv package.) 



ERROR: python venv creation failed

在这里插入图片描述
问题一,解决方案:

sudo apt update

# python3-venv中包含ensurepip 模块
sudo apt install python3-venv

sudo apt install python3-pip

# 安装setuptools模块
pip3 install setuptools

(二)、缺少sphinx 和 Ninja python 模块。
‘sphinx’ was not found ,Cannot find Ninja,导致报错,sphinx为文档生成工具, Ninja为构建工具。

'sphinx==5.3.0' not found:
 • Python package 'sphinx' was not found nor installed.
 • mkvenv was configured to operate offline and did not check PyPI.


Sphinx not found/usable, disabling docs.

ERROR: Cannot find Ninja

在这里插入图片描述

问题二,解决方案:

sudo apt install python3-pip

# 安装Sphinx 
pip3 install Sphinx sphinx_rtd_theme

# 安装ninja 
sudo apt install ninja-build

在这里插入图片描述
在这里插入图片描述

(三)、 “glib-2.0” not found
glib-2.0是一个常用的C语言库,用于编写应用程序和服务端程序。

../meson.build:710:10: ERROR: Dependency "glib-2.0" not found, tried pkgconfig

A full log can be found at /home/hhl/software/qemu-8.2.0/build/meson-logs/meson-log.txt

ERROR: meson setup failed

在这里插入图片描述
问题三,解决方案:

sudo apt install libglib2.0-dev

在这里插入图片描述

(四)、‘flex’ not found
flex 是一个用于生成词法分析器的工具

Program scripts/decodetree.py found: YES (/home/hhl/software/qemu-8.2.0/build/pyvenv/bin/python3 /home/hhl/software/qemu-8.2.0/scripts/decodetree.py)
Program flex found: NO

../target/hexagon/meson.build:180:8: ERROR: Program 'flex' not found or not executable

A full log can be found at /home/hhl/software/qemu-8.2.0/build/meson-logs/meson-log.txt

ERROR: meson setup failed

在这里插入图片描述
问题四,解决方案:

sudo apt install flex

在这里插入图片描述

(五)、‘bison’ not found
bison 是一个通用的解析器生成器,通常与 flex 一起使用来生成词法和语法分析器。

Program bison found: NO

../target/hexagon/meson.build:186:8: ERROR: Program 'bison' not found or not executable

A full log can be found at /home/hhl/software/qemu-8.2.0/build/meson-logs/meson-log.txt

ERROR: meson setup failed

在这里插入图片描述
问题五、解决方案:

sudo apt install bison

在这里插入图片描述

至此,执行…/configure后的报错,应该是全部都解决了。

四、编译安装qemu
在build目录中执行make命令进行编译,耐心等待。

cd build 

# -j 并发编译
make -j8

在这里插入图片描述

cd build 

# 安装qemu
sudo make install

在这里插入图片描述

五、验证是否安装成功

执行下述命令,验证qemu是否安装成功。

qemu-system-aarch64 -version

在这里插入图片描述

到这里,ubuntu中源代码编译安装qemu完成。

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

进击的铁甲小宝

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值