# Linux 平台

熊猫模拟器并不支持 rAthena 官方的 `.\configure && make` 编译方式，仅留下了相对好维护的 CMake 编译方式，对于这一点有经验的同学注意一下，避免被坑。在本例子中，我们将使用 `Ubuntu 18.04` 发行版进行演示。

```shell
## 获取最新的 package list 以及更新本地程序包
$ sudo apt-get update -y && sudo apt-get upgrade -y

## 安装 git / git-lfs / wget / gcc 编译组件
$ sudo apt install git git-lfs wget build-essential -y

## 确认 gcc 的版本 ( 预期返回版本号 ≥ 7.4.0 )
$ gcc --version

## 安装编译 cmake 的所需依赖库 ( openssl )
$ sudo apt install openssl libssl-dev -y

## 接下来下载、解压、配置，并编译安装 cmake 3.16 版本
$ wget https://github.com/Kitware/CMake/releases/download/v3.16.0-rc1/cmake-3.16.0-rc1.tar.gz \
  && tar -xzvf cmake-3.16.0-rc1.tar.gz \
  && cd cmake-3.16.0-rc1 \
  && ./bootstrap && make -j4 && sudo make install

## 此时你可以移除上一步中下载的 cmake 压缩包以及解压后的目录
$ cd .. && rm -rf cmake-*

## 确认 cmake 的版本 ( 预期返回版本号 ≥ 3.16.0 )
$ cmake --version

## 找个位置，然后克隆熊猫模拟器源代码 ( 此处我们将其放在用户主目录中 )
$ git clone https://github.com/PandasWS/Pandas.git ~/Pandas

## 安装熊猫模拟器的依赖
$ sudo apt install libmysqlclient-dev zlib1g-dev libpcre3-dev -y

## 编译熊猫模拟器自带的 Boost Libraries
## 下列指令中的第一个 cd 若您保存熊猫模拟器仓库的位置有变，请自行更改
$ cd ~/Pandas/3rdparty/boost/ && bash bootstrap.sh && ./b2

## 编译熊猫模拟器: 先建立 cbuild 临时目录并进入到目录中
$ cd ~/Pandas && mkdir cbuild && cd cbuild

## 生成 makefile 文件
$ cmake -G "Unix Makefiles" ..

## 执行编译 ( 以后想重新编译只需进入 cbuild 目录执行 make 即可 )
$ make

## 返回仓库根目录即可看到编译产物
$ cd ~/Pandas

## 配置正确的数据库连接后，就可以启动模拟器啦
$ ./athena-start start
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pandas.ws/self-compiled/compile-on-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
