编译指南
概述
- 本教程给出MacOS、CentOS、Ubuntu三个系统的编译指南
- 其中CentOS下安装gcc和cmake比较麻烦,网上也没有比较可靠的教程,所以在下文中给出了参考的安装方式
- 首先在每个系统给出CICD测试的系统版本、C & CXX 的编译版本、cmake版本、以及需要安装的依赖库
- 然后在
构建与测试
中给出了构建和测试命令 - 在 末尾还提供了在CentOS、Ubuntu系统下使用
clang
编译gs的方法和注意事项 - 系统镜像文件地址\\m68gfs\技术中心\wurq\系统镜像
环境准备
- MacOs
- CentOS
- Ubuntu
- CICD系统版本 : MacOS High Sierra 10.13
- C & CXX Compiler : AppleClang 10.0.0.10001044
- 推荐使用homebrew安装需要的库或工具
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- cmake --version >= 3.16
brew install --build-from-source cmake
- 以下是MacOS下需要安装的一些库
-
protobuf
的构建 依赖autoconf
automake
libtool
brew install autoconf
brew install --build-from-source automake
brew intsall libtool
-
- CICD系统 :CentOS 7.7
- C & CXX Compiler : gcc 5.4 / gcc 5.5
- cmake --version >= 3.16
注意
因为CentOS下安装gcc和cmake比较复杂 以及可能出现的问题下文会给出教程
提示
Centos需要修改网络配置文件,系统安装完成后cd /etc/sysconfig/network-scripts
,vi修改ipcf-e开头的文件,将ONBOOT内容改为"yes"后重启。
- 以下是CentOS下需要安装的一些库
-
mongoc
的构建依赖openssl
yum install -y openssl-devel
yum install -y readline-devel -
protobuf
的构建依赖autoconf
automake
libtool
yum install -y autoconf
yum install -y automake
yum install -y libtool -
yum install -y mesa-libGLU-devel
-
可安装可视化界面,并通过startx命令启动。
yum groupinstall "GNOME Desktop"
-
- CICD系统 :Ubuntu 16.04.4
- C & CXX Compiler : gcc 5.3 / gcc 5.4
- cmake --version >= 3.16
提示
Ubuntu 和 CentOS都是Linux,所以cmake的安装方式基本一致,下载链接可用同一个,详见CentOS在下文中给出的安装教程
- 以下是Ubuntu下需要安装的一些库
-
mongoc
的构建依赖openssl
apt-get install openssl
apt-get install libssl-dev -
apt-get install -y libreadline-dev
-
protobuf
的构建依赖autoconf
automake
libtool
apt-get install autoconf
apt-get install automake
apt-get install libtool
-