[deps](cyrus_sasl) Add -fPIC for cyrus_sasl (#7408)

This commit is contained in:
Mingyu Chen
2021-12-17 13:11:25 +08:00
committed by GitHub
parent 06c38ce46e
commit e9536a8cf1
5 changed files with 40 additions and 20 deletions

View File

@ -94,3 +94,7 @@ $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0
```
The version of jdk you used to run FE must be the same version you used to compile FE.
### Latest update time
2021-12-15

View File

@ -35,17 +35,19 @@ This document focuses on how to code Doris through source code.
1. Download Docker Mirror
`$ docker pull apache/incubator-doris:build-env-for-0.15.0`
`$ docker pull apache/incubator-doris:build-env-latest`
Check mirror download completed:
```
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apache/incubator-doris build-env-for-0.15.0 49f68cecbc1a 4 days ago 3.76GB
apache/incubator-doris build-env-latest 49f68cecbc1a 4 days ago 3.76GB
```
Note: For different versions of Doris, you need to download the corresponding mirror version. From Apache Doris 0.15 version, the docker image will keep same version number with Doris, You can use ` apache/incubator-doris:build-env-for-0.15.0 ` compile Apache Doris 0.15.0.
> Note1: For different versions of Doris, you need to download the corresponding mirror version. From Apache Doris 0.15 version, the docker image will keep same version number with Doris. For example, you can use `apache/incubator-doris:build-env-for-0.15.0` to compile Apache Doris 0.15.0.
>
> Node2: `apache/incubator-doris:build-env-latest` is for compiling trunk code, and will be updated along with trunk code. View the update time in `docker/README.md`
| image version | commit id | release version |
|---|---|---|
@ -54,6 +56,7 @@ Note: For different versions of Doris, you need to download the corresponding mi
| apache/incubator-doris:build-env-1.2 | [4ef5a8c](https://github.com/apache/incubator-doris/commit/4ef5a8c8560351d7fff7ff8fd51c4c7a75e006a8) or later | 0.12.x - 0.14.0 |
| apache/incubator-doris:build-env-1.3.1 | [ad67dd3](https://github.com/apache/incubator-doris/commit/ad67dd34a04c1ca960cff38e5b335b30fc7d559f) or later | 0.14.x |
| apache/incubator-doris:build-env-for-0.15.0 | [a81f4da](https://github.com/apache/incubator-doris/commit/a81f4da4e461a54782a96433b746d07be89e6b54) or later | 0.15.0 |
| apache/incubator-doris:build-env-latest | trunk | trunk |
**note**:
@ -61,7 +64,7 @@ Note: For different versions of Doris, you need to download the corresponding mi
> 2. Doris version 0.14.0 still uses apache/incubator-doris:build-env-1.2 to compile, and the 0.14.x code will use apache/incubator-doris:build-env-1.3.1.
> 3. In the docker image of build-env-1.3.1, both OpenJDK 8 and OpenJDK 11 are included, and OpenJDK 11 is used for compilation by default. Please make sure that the JDK version used for compiling is the same as the JDK version used at runtime, otherwise it may cause unexpected operation errors. You can use the following command to switch the default JDK version in container:
> 3. From docker image of build-env-1.3.1, both OpenJDK 8 and OpenJDK 11 are included, and OpenJDK 11 is used for compilation by default. Please make sure that the JDK version used for compiling is the same as the JDK version used at runtime, otherwise it may cause unexpected operation errors. You can use the following command to switch the default JDK version in container:
>
> Switch to JDK 8:
>
@ -81,14 +84,14 @@ Note: For different versions of Doris, you need to download the corresponding mi
2. Running Mirror
`$ docker run -it apache/incubator-doris:build-env-for-0.15.0`
`$ docker run -it apache/incubator-doris:build-env-latest`
It is recommended to run the container by mounting the local Doris source directory, so that the compiled binary file will be stored in the host machine and will not disappear because the container exits.
At the same time, it is recommended to mount the maven `.m2` directory in the mirror to the host directory at the same time to prevent repeated downloading of maven's dependent libraries each time the compilation is started.
```
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apache/incubator-doris:build-env-for-0.15.0
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apache/incubator-doris:build-env-latest
```
3. Download source code
@ -109,11 +112,11 @@ Note: For different versions of Doris, you need to download the corresponding mi
> ** Note: **
>
> If you are using `build-env-1.4.2` or `build-env-for-0.15.0` This environment, use the following command when compiling:
> If you are using `build-env-for-0.15.0` or later version for the first time, use the following command when compiling:
>
> `sh build.sh --clean --be --fe --ui`
>
> This is because the version 1.4.2 image has upgraded thrift (0.9 -> 0.13), you need to use the --clean command to force the use of the new version of thrift to generate code files, otherwise incompatible code will appear.
> This is because from build-env-for-0.15.0, we upgraded thrift (0.9 -> 0.13), you need to use the --clean command to force the use of the new version of thrift to generate code files, otherwise incompatible code will appear.
After compilation, the output file is in the `output/` directory.

View File

@ -34,17 +34,19 @@ under the License.
1. 下载 Docker 镜像
`$ docker pull apache/incubator-doris:build-env-for-0.15.0`
`$ docker pull apache/incubator-doris:build-env-latest`
检查镜像下载完成:
```
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apache/incubator-doris build-env-for-0.15.0 49f68cecbc1a 4 days ago 3.76GB
apache/incubator-doris build-env-latest 49f68cecbc1a 4 days ago 3.76GB
```
注: 针对不同的 Doris 版本,需要下载对应的镜像版本。从 Apache Doris 0.15 版本起,后续镜像版本号将与 Doris 版本号统一可以使用 `apache/incubator-doris:build-env-for-0.15.0 ` 来编译 0.15.0 版本。
> 注1:针对不同的 Doris 版本,需要下载对应的镜像版本。从 Apache Doris 0.15 版本起,后续镜像版本号将与 Doris 版本号统一。比如可以使用 `apache/incubator-doris:build-env-for-0.15.0 ` 来编译 0.15.0 版本。
>
> 注2:`apache/incubator-doris:build-env-latest` 用于编译最新主干版本代码,会随主干版本不断更新。可以查看 `docker/README.md` 中的更新时间。
| 镜像版本 | commit id | doris 版本 |
|---|---|---|
@ -53,6 +55,7 @@ under the License.
| apache/incubator-doris:build-env-1.2 | [4ef5a8c](https://github.com/apache/incubator-doris/commit/4ef5a8c8560351d7fff7ff8fd51c4c7a75e006a8) | 0.12.x - 0.14.0 |
| apache/incubator-doris:build-env-1.3.1 | [ad67dd3](https://github.com/apache/incubator-doris/commit/ad67dd34a04c1ca960cff38e5b335b30fc7d559f) | 0.14.x |
| apache/incubator-doris:build-env-for-0.15.0 | [a81f4da](https://github.com/apache/incubator-doris/commit/a81f4da4e461a54782a96433b746d07be89e6b54) or later | 0.15.0 |
| apache/incubator-doris:build-env-latest | trunk | trunk |
**注意**:
@ -60,7 +63,7 @@ under the License.
> 2. doris 0.14.0 版本仍然使用apache/incubator-doris:build-env-1.2 编译,0.14.x 版本的代码将使用apache/incubator-doris:build-env-1.3.1。
> 3. build-env-1.3.1 的docker镜像,同时包含了 OpenJDK 8 和 OpenJDK 11,并且默认使用 OpenJDK 11 编译。请确保编译使用的 JDK 版本和运行时使用的 JDK 版本一致,否则会导致非预期的运行错误。你可以使用在进入编译镜像的容器后,使用以下命令切换默认 JDK 版本:
> 3. build-env-1.3.1 的docker镜像,同时包含了 OpenJDK 8 和 OpenJDK 11,并且默认使用 OpenJDK 11 编译。请确保编译使用的 JDK 版本和运行时使用的 JDK 版本一致,否则会导致非预期的运行错误。你可以使用在进入编译镜像的容器后,使用以下命令切换默认 JDK 版本:
>
> 切换到 JDK 8:
>
@ -80,14 +83,14 @@ under the License.
2. 运行镜像
`$ docker run -it apache/incubator-doris:build-env-for-0.15.0`
`$ docker run -it apache/incubator-doris:build-env-latest`
建议以挂载本地 Doris 源码目录的方式运行镜像,这样编译的产出二进制文件会存储在宿主机中,不会因为镜像退出而消失。
同时,建议同时将镜像中 maven 的 `.m2` 目录挂载到宿主机目录,以防止每次启动镜像编译时,重复下载 maven 的依赖库。
```
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apache/incubator-doris:build-env-for-0.15.0
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apache/incubator-doris:build-env-latest
```
3. 下载源码
@ -108,11 +111,11 @@ under the License.
>**注意:**
>
>如果你使用的是 `build-env-1.4.2 `或 `build-env-for-0.15.0` 这个环境,第一次编译的时候要使用如下命令:
>如果你是第一次使用 `build-env-for-0.15.0` 或之后的版本,第一次编译的时候要使用如下命令:
>
> `sh build.sh --clean --be --fe --ui`
>
> 这是因为1.4.2 版本镜像升级了 thrift(0.9 -> 0.13),需要通过 --clean 命令强制使用新版本的 thrift 生成代码文件,否则会出现不兼容的代码。
> 这是因为 build-env-for-0.15.0 版本镜像升级了 thrift(0.9 -> 0.13),需要通过 --clean 命令强制使用新版本的 thrift 生成代码文件,否则会出现不兼容的代码。
编译完成后,产出文件在 `output/` 目录中。

View File

@ -2,6 +2,13 @@
This file contains version of the third-party dependency libraries in the build-env image. The docker build-env image is apache/incubator-doris, and the tag is `build-env-${version}`
## v20211215
### Changes
- Added: cyrus-sasl
- Modifoed: librdkafka
## build-env-1.4.2
### Changes

View File

@ -523,10 +523,13 @@ build_rocksdb() {
# cyrus_sasl
build_cyrus_sasl() {
check_if_source_exist $CYRUS_SASL_SOURCE
cd $TP_SOURCE_DIR/$CYRUS_SASL_SOURCE
./configure --prefix=$TP_INSTALL_DIR --prefix=$TP_INSTALL_DIR --enable-static --enable-shared=no --with-openssl=$TP_INSTALL_DIR
make -j $PARALLEL && make install
check_if_source_exist $CYRUS_SASL_SOURCE
cd $TP_SOURCE_DIR/$CYRUS_SASL_SOURCE
CPPFLAGS="-I${TP_INCLUDE_DIR}" \
LDFLAGS="-L${TP_LIB_DIR}" \
CFLAGS="-fPIC" \
./configure --prefix=$TP_INSTALL_DIR --enable-static --enable-shared=no --with-openssl=$TP_INSTALL_DIR --with-pic
make -j $PARALLEL && make install
}
# librdkafka