0. 环境
i5 ubuntu22(安装系统时候选择 自动上网下载第三方驱动软件,主要是显卡驱动opengl)
1. apt安装依赖
1.1 SDL2
sudo apt install libsdl2-dev
1.2 OpenSSL (optional)
sudo apt install libssl-dev
1.3 Qt 6.2+
sudo apt install qt6-base-dev qt6-base-private-dev qt6-multimedia-dev
sudo apt install qt6-l10n-tools qt6-tools-dev qt6-tools-dev-tools
sudo apt install libgl-dev
1.4 PORTAUDIO
sudo apt install libasound-dev
1.5 XORG
sudo apt install xorg-dev libx11-dev libxext-dev
1.6 JACK Audio Connection Kit
sudo apt install jackd
1.7 PipeWire
sudo apt install libpipewire-0.3-dev
1.8 FFMPEG 4.0+
sudo apt install ffmpeg libswscale-dev libavformat-dev libavcodec-dev libavdevice-dev
1.9 sndio
sudo apt install libsndio-dev
(跳过)1.10 Gnome esound
(需要编译安装https://download.gnome.org/sources/esound)
wget https://download.gnome.org/sources/esound/0.2/esound-0.2.41.tar.gz
tar -zvxf esound-0.2.41.tar.gz
1.11 GCC 10.0+.
sudo apt install build-essential
1.12 CMake 3.20+
sudo apt install cmake
1.13 整合 1.1-1.12:
sudo apt install aptitude
sudo aptitude install libsdl2-dev libssl-dev
sudo apt install qt6-base-dev qt6-base-private-dev qt6-multimedia-dev libasound-dev xorg-dev libx11-dev libxext-dev jackd libpipewire-0.3-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev libavdevice-dev libsndio-dev build-essential cmake
2. 编译
2.1 获取源码
sudo apt install git
git clone --recursive https://github.com/citra-emu/citra
cd citra
git submodule update --init --recursive
2.2 编译
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8
2.3 运行测试
cd bin/Release
# SDL
cd build/bin/
./citra
# Qt
cd build/bin/
./citra-qt
# Dedicated room
cd build/bin/
./citra-room
3. 问题:
3.1 安装vmware-tools 出现Segmentation fault (core dumped)
先删除现有的VMware
cd vmware-tools-distrib/bin(就是到你那个安装文件的根目录)
然后运行
sudo ./vmware-uninstall-tools.pl(运行vmware-uninstall-tools.pl这个文件来删除现有的VMware)
最后打开终端,输入
sudo apt-get install open-vm-tools open-vm-tools-desktop
3.2 安装SDL2出现 E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages
sudo apt install aptitude
sudo aptitude install libsdl2-dev libssl-dev
3.3 git clone --recursive出错
cd citra
git submodule update --init --recursive
git submodule update --recursive
3.4 Required program `glslangValidator` not found.
mkdir tmp && cd tmp
wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
unzip glslang-master-linux-Release.zip
sudo mv bin/* /usr/local/bin/
sudo mv lib/* /usr/local/lib/
sudo mv include/* /usr/local/include/
3.5 fdk-aac/aacdecoder_lib.h: No such file or directory
wget https://downloads.sourceforge.net/opencore-amr/fdk-aac-2.0.1.tar.gz
tar -zxvf fdk-aac-2.0.1.tar.gz
cd fdk-aac-2.0.1/
autoreconf -fiv
sudo ./configure --prefix=/usr --disable-shared
3.5.1 autoreconf
sudo apt install autoreconf
3.5.2 Can't exec "libtoolize
sudo apt install aptitude
sudo aptitude install libtool
3.5.3 automake-1.15 command not found
sudo ln -s /usr/bin/automake-1.16 /usr/bin/automake-1.15
编译
sudo make -j4
sudo make install
3.6 Warning: Ignoring WAYLAND_DISPLAY on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
虚拟机显卡驱动支持不完善。需要从opengl切换到software。
4. 压缩备份
tar -zcvf citra_git_src_20230715.tar.gz citra/
5.运行测试
5.1 虚拟机下
用SOFTWARE方式,基本不能玩,2 FPS.
5.2 i5 ubuntu22实体机
OPENGL方式可以。