项目地址: https://github.com/rossning92/Blackhole

1
2
$ git clone https://github.com/rossning92/Blackhole.git
$ cd Blackhole

为了避免一些莫名其妙的问题, 我的编译环境全程在容器中进行, 大家可以根据 教程 安装 Docker

我选择的镜像为 nvidia/opengl:1.0-glvnd-devel-ubuntu22.04, 执行下面的语句拉取

1
2
$ docker pull nvidia/opengl:1.0-glvnd-devel-ubuntu22.04
$ docker rum -it -v .:/workspace nvidia/opengl:1.0-glvnd-devel-ubuntu22.04 /bin/bash
1
2
3
$ apt update && apt upgrade -y && apt install -y git build-essential wget curl cmake
$ wget https://github.com/conan-io/conan/releases/download/1.65.0/conan-ubuntu-64.deb
$ apt install ./conan-ubuntu-64.deb

添加 conan 默认配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cat << EOF > ~/.conan/profiles/default
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
[conf]
tools.system.package_manager:mode=install
EOF

执行命令开始编译

1
2
3
4
5
# Configure the project and generate a native build system.
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build

# Compile / build the project.
cmake --build build

最后在build文件夹内生成Blackhole二进制文件