当前位置: 首页 > news >正文

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-venvsudo 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 pkgconfigA full log can be found at /home/hhl/software/qemu-8.2.0/build/meson-logs/meson-log.txtERROR: 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 executableA full log can be found at /home/hhl/software/qemu-8.2.0/build/meson-logs/meson-log.txtERROR: 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 executableA full log can be found at /home/hhl/software/qemu-8.2.0/build/meson-logs/meson-log.txtERROR: 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完成。


http://www.mrgr.cn/news/9200.html

相关文章:

  • 01 BlockChain--
  • ReactRouter6快速入门教程
  • webdriver 反爬虫 (selenium反爬虫) 绕过
  • 手机谷歌浏览器怎么用
  • 【HuggingFace Transformers】BertSdpaSelfAttention源码解析
  • C语言占领游戏
  • 无人机PX4飞控 | 电源系统详解与相关代码
  • C语言文件迷宫
  • ThreeJs学习-层级模型
  • 前端面试宝典【设计模式】【5】
  • 短剧系统搭建:从零搭建高效创意内容平台教程,源码分享+正版片源授权指南
  • RING总线(环形总线)Intel大小核的由来
  • 『功能项目』禁止射线穿透行为【05】
  • SSRF漏洞(一)
  • 设计模式-结构型模式-代理模式
  • C++ | Leetcode C++题解之第352题将数据流变为多个不想交区间
  • 使用miniconda构建数据科学环境
  • [Linux][软件]CentOS 系统部署 RabbitMQ
  • AI可预测地震,科技的“预知未来”?
  • 虚拟机桥接模式下设置静态IP