QEMU源码编译CentOS

发布时间:2024年01月18日

安装编译依赖

sudo yum groupinstall "Development Tools"
sudo yum install -y cmake make ninja-build glib2 glib2-devel spice-server-devel spice-protocol usbredir-devel gcc
sudo yum install iasl  libssh-devel bzip2-devel  libepoxy-devel
sudo yum install libcap-ng-devel libdrm-devel
sudo yum install libbpf-devel

QEMU支持nvme,rdma,需要打开编译选项 --enable-nvme, --enable-rdma

[root@personal_rpmbuild_242 qemu-8.0.2]# ./configure --prefix=/usr/local/qemu/ --enable-debug --enable-kvm --enable-vnc --target-list=x86_64-softmmu --enable-spice --enable-spice-protocol --enable-vnc --enable-usb-redir --enable-rdma 
Using './build' as the directory for build output
The Meson build system
Version: 0.61.5
Source dir: /root/xhe/qemu/qemu-8.0.2
Build dir: /root/xhe/qemu/qemu-8.0.2/build
Build type: native build
Project name: qemu
Project version: 8.0.2
C compiler for the host machine: cc -m64 -mcx16 (gcc 8.4.1 "cc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1)")
C linker for the host machine: cc -m64 -mcx16 ld.bfd 2.30-93
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program scripts/symlink-install-tree.py found: YES (/usr/bin/python3 /root/xhe/qemu/qemu-8.0.2/scripts/symlink-install-tree.py)
Program sh found: YES (/usr/bin/sh)
C++ compiler for the host machine: c++ -m64 -mcx16 (gcc 8.4.1 "c++ (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1)")
C++ linker for the host machine: c++ -m64 -mcx16 ld.bfd 2.30-93
Program python3 found: YES (/usr/bin/python3)
Program bzip2 found: YES (/usr/bin/bzip2)
Program iasl found: NO
Compiler for C supports link arguments -Wl,-z,relro: YES 
Compiler for C supports link arguments -Wl,-z,now: YES 
Compiler for C++ supports link arguments -Wl,--warn-common: YES 
Program cgcc found: NO
Library m found: YES
Run-time dependency threads found: YES
Library util found: YES
Run-time dependency appleframeworks found: NO (tried framework)
Found pkg-config: /usr/bin/pkg-config (1.4.2)
Run-time dependency gio-2.0 found: YES 2.56.4
Program gdbus-codegen found: YES (/usr/bin/gdbus-codegen)
Run-time dependency gio-unix-2.0 found: YES 2.56.4
Run-time dependency pixman-1 found: YES 0.38.4
Run-time dependency zlib found: YES 1.2.11
Has header "libaio.h" : NO 
Run-time dependency liburing found: NO (tried pkgconfig)
Run-time dependency libnfs found: NO (tried pkgconfig)
Run-time dependency appleframeworks found: NO (tried framework)
Run-time dependency appleframeworks found: NO (tried framework)
Run-time dependency libseccomp found: NO (tried pkgconfig)
Has header "cap-ng.h" : NO 
Run-time dependency xkbcommon found: NO (tried pkgconfig)
Run-time dependency slirp found: NO (tried pkgconfig)
Has header "libvdeplug.h" : NO 
Run-time dependency libpulse found: NO (tried pkgconfig)
Run-time dependency alsa found: NO (tried pkgconfig)
Run-time dependency jack found: NO (tried pkgconfig)
Run-time dependency sndio found: NO (tried pkgconfig)
Run-time dependency spice-protocol found: YES 0.14.2
Run-time dependency spice-server found: YES 0.14.3
Library rt found: YES
Run-time dependency libiscsi found: NO (tried pkgconfig)
Run-time dependency libzstd found: NO (tried pkgconfig)
Run-time dependency virglrenderer found: NO (tried pkgconfig)
Run-time dependency blkio found: NO (tried pkgconfig)
Run-time dependency libcurl found: NO (tried pkgconfig)
Run-time dependency libudev found: NO (tried pkgconfig)
Library mpathpersist found: NO
Run-time dependency ncursesw found: NO (tried pkgconfig)
Has header "curses.h" : NO 
Message: Trying with /usr/include/ncursesw
Has header "curses.h" : NO 
Has header "brlapi.h" : NO 
sdl2-config found: NO
Run-time dependency sdl2 found: NO (tried pkgconfig and config-tool)
Library rados found: NO
Has header "rbd/librbd.h" : NO 
Run-time dependency glusterfs-api found: NO (tried pkgconfig)
Run-time dependency libssh found: NO (tried pkgconfig)
Has header "bzlib.h" : NO 
Has header "lzfse.h" : NO 
Has header "sys/soundcard.h" : YES 
Run-time dependency epoxy found: NO (tried pkgconfig)
Has header "epoxy/egl.h" with dependency epoxy: NO 
Run-time dependency gnutls found: NO (tried pkgconfig)
Run-time dependency gnutls found: NO (tried pkgconfig)
libgcrypt-config found: NO need ['>=1.8']
Run-time dependency libgcrypt found: NO (tried config-tool)
Run-time dependency nettle found: NO (tried pkgconfig)
Run-time dependency gmp found: NO (tried pkgconfig)
Run-time dependency gtk+-3.0 found: NO (tried pkgconfig)
Run-time dependency libpng found: NO (tried pkgconfig)
Run-time dependency libjpeg found: NO (tried pkgconfig)
Has header "sasl/sasl.h" : NO 
Has header "security/pam_appl.h" : NO 
Has header "snappy-c.h" : NO 
Has header "lzo/lzo1x.h" : NO 
Has header "numa.h" : NO 

../meson.build:1381:2: ERROR: C shared or static library 'ibumad' not found

A full log can be found at /root/xhe/qemu/qemu-8.0.2/build/meson-logs/meson-log.txt
NOTICE: You are using Python 3.6 which is EOL. Starting with v0.62.0, Meson will require Python 3.7 or newer

ERROR: meson setup failed
  1. Program iasl found: NO:

    这表示缺少 iasl 工具。iasl 是 Intel ACPI Source Language 编译器,它用于编译ACPI表。您可以通过以下命令安装 iasl 工具:

    • sudo yum install iasl
  2. Run-time dependency glusterfs-api found: NO (tried pkgconfig): 缺少 GlusterFS API 依赖项。尝试通过 pkgconfig 安装该依赖项。您可以尝试以下解决方法:

    sudo yum install glusterfs-api-devel
  3. Run-time dependency libssh found: NO (tried pkgconfig): 缺少 libssh 依赖项。尝试通过 pkgconfig 安装该依赖项。您可以尝试以下解决方法:

    sudo yum install libssh-devel
  4. Has header "bzlib.h" : NO: 缺少 bzlib.h 头文件。尝试通过以下命令安装对应的依赖项:

    sudo yum install bzip2-devel
  5. Has header "lzfse.h" : NO: 缺少 lzfse.h 头文件。这可能是因为缺少 lzfse 库。尝试通过以下命令安装对应的依赖项:

    sudo yum install lzfse-devel
  6. Run-time dependency epoxy found: NO (tried pkgconfig): 缺少 epoxy 依赖项。尝试通过 pkgconfig 安装该依赖项。您可以尝试以下解决方法:

    sudo yum install libepoxy-devel
  7. 可以看出缺少 C shared 或 static library 'ibumad'。要解决这个问题,可以尝试安装 ibumad 库

    sudo yum install libibumad-devel
  8. 根据错误信息,缺少头文件 "cap-ng.h"。要解决这个问题,您需要安装与该头文件相关的库。

    sudo yum install libcap-ng-devel

文章来源:https://blog.csdn.net/redhat7890/article/details/135670458
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。