Code Monkey home page Code Monkey logo

Comments (14)

CairoLee avatar CairoLee commented on June 9, 2024

使用 CMake 方式进行编译,你的Ubuntu 是哪个发行版?

from pandas.

OrionChang avatar OrionChang commented on June 9, 2024

18.04

from pandas.

CairoLee avatar CairoLee commented on June 9, 2024

好的,晚些我整理一份操作手册出来

from pandas.

CairoLee avatar CairoLee commented on June 9, 2024

Ubuntu 18.04 编译 Pandas 模拟器

系统环境

使用 docker 下的 ubuntu:18.04 镜像

更新 apt-get 相关的数据源

  • 先获取最新的 package list 以便使用:apt-get update -y
  • 对本机已经安装的各种包执行升级操作:apt-get upgrade -y

安装 git

  • 使用:apt install git -y 安装 git 以便后面克隆代码仓库
  • 使用:git --version 确认安装的 git 版本,当下是:git version 2.17.1

安装 git-lfs

  • 顺手安装 git-lfs 支持,部分仓库可能会需要用到
  • 先执行:apt install git-lfs -y 下载相关的包
  • 然后执行:git lfs install 安装钩子(提示 Git LFS initialized. 即表示初始化完成,可能会有一个 Error 提示当前的目录不是一个代码仓库,不用管)

安装 gcc 编译器

  • 使用 apt install build-essential -y 安装 gcc 编译器
  • 安装后使用:gcc --version 确认版本为:7.4.0

安装 wget 等一些辅助工具

  • 使用 apt install wget -y 安装 wget 指令

安装 cmake 3.16 版本

  • 先安装编译 cmake 所需要的依赖库,如 OpenSSL 等: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 && make install
  • 使用 cmake --version 确认版本为:cmake version 3.16.0-rc1

克隆 Pandas 模拟器代码

  • 先切换到你想要存放 Pandas 代码的目录:cd ~
  • 执行克隆:git clone https://github.com/PandasWS/Pandas.git

安装 Pandas 模拟器的依赖库

  • 想要编译 Pandas 需要依赖一些库,先安装他们:apt install libmysqlclient-dev zlib1g-dev libpcre3-dev -y

编译 Pandas 模拟器自带的 Boost 库

  • 进入克隆下来的 Pandas 目录:cd ~/Pandas
  • 进入第三方组件 Boost 的目录:cd 3rdparty/boost/
  • 执行编译操作:bash bootstrap.sh 获得 b2 程序
  • 执行:./b2 并回车,程序将开始编译 Boost

开始编译 Pandas

  • 进入克隆下来的 Pandas 目录:cd ~/Pandas
  • 建立编译用临时目录:mkdir cbuild
  • 进入临时目录:cd cbuild
  • 使用 cmake 生成 makefile 文件:cmake -G "Unix Makefiles" ..
  • 执行编译:make -j4
  • 完成编译后,重新进入 Pandas 目录即可见到编译产物

from pandas.

CairoLee avatar CairoLee commented on June 9, 2024

可以试试看~ 有问题随时联系。 目前已知在编译地图服务器的时候,有一处警告:

/root/Pandas/src/map/script.cpp:4621:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
 #endif Pandas_ScriptCommand_SelfDeletion
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

我将会在下一个版本修正它,这并不影响我们的使用

from pandas.

CairoLee avatar CairoLee commented on June 9, 2024

请问还有其他问题么?
或者是上述的流程是否能够帮你完成编译?
如果没有问题的话,麻烦说一声哈,感谢~

from pandas.

ovao0802 avatar ovao0802 commented on June 9, 2024

感謝教學~~ 我是初學者~ 但無意間發現了熊貓模擬器~ 覺得可以從此模擬器入手探討~ 希望是好的開始

from pandas.

flufy3d avatar flufy3d commented on June 9, 2024

太好了 我就说 怎么 linux下的编译脚本都删除掉了

from pandas.

flufy3d avatar flufy3d commented on June 9, 2024

希望能把这个更新到文档区

from pandas.

flufy3d avatar flufy3d commented on June 9, 2024

整理了下 这些命令就可以了 准备做一个dockefile 方便部署

apt install libmysqlclient-dev zlib1g-dev libpcre3-dev cmake -y
git clone https://github.com/PandasWS/Pandas.git
cd ~/Pandas
cd 3rdparty/boost/
bash bootstrap.sh
./b2
cd ..
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make -j4

from pandas.

flufy3d avatar flufy3d commented on June 9, 2024

但是编译完成后 执行程序
遇到下列错误
root@dev-server:~/Pandas# ./login-server
Floating point exception (core dumped)

测试平台1 ubuntu 20.04 + gcc 9.3.0
测试平台2 ubuntu 18.04 + gcc 7.5.0

原版rathena 可以编译通过正常运行

gdb 调试信息
Starting program: /root/Pandas/login-server
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGFPE, Arithmetic exception.
0x00005555557fd5fb in std::__detail::_Mod_range_hashing::operator() (
this=0x555555b87cf8 <translate_db+88>, __num=10983096385041811433,
__den=0) at /usr/include/c++/9/bits/hashtable_policy.h:433
433 { return __num % __den; }

from pandas.

CairoLee avatar CairoLee commented on June 9, 2024

@flufy3d 你在崩溃的环境下执行一下 locale 回车,我看下内容~ 是 zh-TW.utf8 么?

from pandas.

flufy3d avatar flufy3d commented on June 9, 2024

不是 是 C.utf8

from pandas.

CairoLee avatar CairoLee commented on June 9, 2024

@flufy3d 请问此问题后来解决了嘛?

from pandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.