Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build intruction #30

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _docs/en/build/compile-by-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docker run -v /your/local/apache-pegasus-source:/root/pegasus \
/bin/bash -c "cd /root/pegasus; ./run.sh build -c --clear_thirdparty -j $(nproc)"
```

The output of compilation will be placed under `DSN_ROOT` of the source directory. It includes `bin`, `include` and `lib`.
The output of compilation will be placed under `build/latest/output/` of the source directory. It includes `bin`, `include` and `lib`.

## Packaging

Expand Down
99 changes: 11 additions & 88 deletions _docs/en/build/compile-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,107 +9,30 @@ Since 2.4.0, Pegasus supports to build both on Linux and macOS. Please don't hes

## Requirements

- GCC 5+
- CMake 3.11+
- GCC 5.4.0+
- CMake 3.11.0+

## Ubuntu environment
## Linux environment

You can refer to the docker image [pegasus-build-dev/ubuntu20.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu2004/Dockerfile) to install all dependencies.

```bash
apt-get update -y; \
apt-get install -y --no-install-recommends \
build-essential \
software-properties-common \
clang-10 \
openjdk-8-jdk \
python3-pip \
libaio-dev \
libsnappy-dev \
libbz2-dev \
libzstd-dev \
liblz4-dev \
zlib1g \
zlib1g.dev \
patch \
netcat \
wget \
ccache \
git \
curl \
zip \
unzip \
gdb \
vim \
automake \
libtool \
libssl-dev \
bison \
maven \
flex;

pip3 install --no-cache-dir cmake
```

## CentOS environment

You can refer to the docker image [pegasus-build-dev/centos7](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/centos7/Dockerfile) to install all dependencies.

```bash
yum -y install centos-release-scl \
scl-utils \
epel-release; \
yum -y install devtoolset-7-gcc \
devtoolset-7-gcc-c++ \
java-1.8.0-openjdk-devel.x86_64 \
python3 \
automake \
autoconf \
make \
libtool \
git \
file \
wget \
ccache \
nmap-ncat \
zip \
gdb \
vim \
unzip \
which \
openssl-devel \
libaio-devel \
snappy-devel \
bzip2-devel \
zlib \
zlib-devel \
libzstd-devel \
lz4-devel \
bison \
flex \
patch;

pip3 install --no-cache-dir cmake
```
You can refer to the docker images to install dependencies and set environment variables. For example:
- [CentOS 7](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/centos7/Dockerfile)
- [Ubuntu 18.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu1804/Dockerfile)
- [Ubuntu 20.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu2004/Dockerfile)
- [Ubuntu 22.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu2204/Dockerfile)

## Compilation

Firstly, make sure:
- `maven` has been installed correctly and added to `PATH`
- `devtoolset-7` has been added to `PATH`
- `JAVA_HOME` has been set correctly

Please refer to [Downloads](/docs/downloads) to fetch the sources。

```bash
./run.sh build -c
./run.sh build -c --clear_thirdparty -j $(nproc)
```

The output of compilation will be placed under `DSN_ROOT` of the source directory. It includes `bin`, `include` and `lib`.
The output of compilation will be placed under `build/latest/output/` of the source directory. It includes `bin`, `include` and `lib`.

## Packaging

Package server binaries for deployment:
Package server binaries for development:

```bash
./run.sh pack_server
Expand Down
2 changes: 1 addition & 1 deletion _docs/zh/build/compile-by-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker run -v /your/local/apache-pegasus-source:/root/pegasus \
/bin/bash -c "cd /root/pegasus; ./run.sh build -c --clear_thirdparty -j $(nproc)"
```

编译的结果会被放在项目根目录的`DSN_ROOT/`文件夹下,其中包含bin、include、lib目录
编译的结果会被放在项目根目录的`build/latest/output/`文件夹下,其中包含`bin`、`include`以及`lib`目录

## 编译打包

Expand Down
98 changes: 11 additions & 87 deletions _docs/zh/build/compile-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,107 +6,31 @@ redirect_from:
version: master
---

从2.4.0开始,Pegasus目前支持Linux和macOS平台进行源码编译。编译过程中遇到问题,可以通过[Github Issues]({{ site.pegasus_github_url }}/issues)向我们咨询。
从2.4.0开始,Pegasus支持Linux和macOS平台进行源码编译。编译过程中遇到问题,可以通过[Github Issues]({{ site.pegasus_github_url }}/issues)向我们咨询。

## 环境要求

- GCC 5+
- CMake 3.11+
- GCC 5.4.0+
- CMake 3.11.0+

## Ubuntu环境配置
## Linux环境配置

你可以参考 [pegasus-build-dev/ubuntu20.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu2004/Dockerfile) 的Docker镜像安装全部依赖。
你可以参考的Docker镜像来安装依赖并设置环境变量。例如:

```bash
apt-get update -y; \
apt-get install -y --no-install-recommends \
build-essential \
software-properties-common \
clang-10 \
openjdk-8-jdk \
python3-pip \
libaio-dev \
libsnappy-dev \
libbz2-dev \
libzstd-dev \
liblz4-dev \
zlib1g \
zlib1g.dev \
patch \
netcat \
wget \
ccache \
git \
curl \
zip \
unzip \
gdb \
vim \
automake \
libtool \
libssl-dev \
bison \
maven \
flex;

pip3 install --no-cache-dir cmake
```

## CentOS环境配置

你可以参考 [pegasus-build-dev/centos7](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/centos7/Dockerfile) 的Docker镜像安装全部依赖。

```bash
yum -y install centos-release-scl \
scl-utils \
epel-release; \
yum -y install devtoolset-7-gcc \
devtoolset-7-gcc-c++ \
java-1.8.0-openjdk-devel.x86_64 \
python3 \
automake \
autoconf \
make \
libtool \
git \
file \
wget \
ccache \
nmap-ncat \
zip \
gdb \
vim \
unzip \
which \
openssl-devel \
libaio-devel \
snappy-devel \
bzip2-devel \
zlib \
zlib-devel \
libzstd-devel \
lz4-devel \
bison \
flex \
patch;

pip3 install --no-cache-dir cmake
```
- [CentOS 7](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/centos7/Dockerfile)
- [Ubuntu 18.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu1804/Dockerfile)
- [Ubuntu 20.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu2004/Dockerfile)
- [Ubuntu 22.04](https://github.com/apache/incubator-pegasus/blob/master/docker/pegasus-build-env/ubuntu2204/Dockerfile)

## 源码编译

在此之前,请确保:
- `maven`已被正确安装且已添加到`PATH`
- `devtoolset-7`已被添加到`PATH`
- `JAVA_HOME`已被正确设置

请先参考[下载文档](/docs/downloads)获取源码。

```bash
./run.sh build -c
./run.sh build -c --clear_thirdparty -j $(nproc)
```

编译后输出会放在当前目录的`DSN_ROOT/`文件夹下,里面包含bin、include、lib目录
编译后输出会放在当前目录的`build/latest/output/`目录下,里面包含`bin`、`include`以及`lib`目录

## 编译打包

Expand Down
Loading