Skip to content

Commit

Permalink
docs(compile): briefly introduce arm building
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd committed Mar 15, 2024
1 parent d09a1e7 commit 006abb1
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/en/deploy/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,34 @@ After forking the OpenMLDB repository, you can trigger the `Other OS Build` work
Please note that this compilation process involves building third-party dependencies from source code, and it may take a while to complete due to limited resources. The approximate time for this process is around 3 hours and 5 minutes (2 hours for third-party dependencies and 1 hour for OpenMLDB). However, the workflow caches the compilation output for third-party dependencies, so the second compilation will be much faster, taking approximately 1 hour and 15 minutes for OpenMLDB.
### Linux for ARM64
It's possible to run OpenMLDB on Linux for ARM64(AArch64), which you may compile the source from scratch. ARM version of compile image `ghcr.io/4paradigm/hybridsql` is recommended:

```sh
docker run -it ghcr.io/4paradigm/hybridsql:latest
# inside docker container
git clone https://github.com/4paradigm/OpenMLDB
cd OpenMLDB
# necessary deps for all third-party
yum install -y flex autoconf automake unzip bc expect libtool \
rh-python38-python-devel gettext byacc xz tcl cppunit-devel rh-python38-python-wheel patch java-1.8.0-openjdk-devel
# bazel
curl --create-dirs -SLo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64
chmod +x /usr/local/bin/bazel
# third-party
cmake -S third-party -B .deps -DBUILD_BUNDELD=ON -DMAKEOPTS=-j$(nproc)
cmake --build .deps
# OpenMLDB source
cmake -S . -B build -DCMKAE_PREFIX_PATH=$(pwd)/.deps/usr -DSQL_JAVASDK_ENABLE=ON -DSQL_PYSDK_ENABLE=ON
cmake --build build -- -j$(nproc)
```


### Macos 10.15, 11

MacOS doesn't require compiling third-party dependencies from source code, so compilation is relatively faster, taking about 1 hour and 15 minutes. Local compilation is similar to the steps outlined in the [Detailed Instructions for Build](#detailed-instructions-for-build) and does not require compiling third-party dependencies (`BUILD_BUNDLED=OFF`). For cloud compilation on macOS, trigger the `Other OS Build` workflow in `Actions` with the specified macOS version (`os name` as `macos10` or `macos11`). You can also disable Java or Python SDK compilation if they are not needed, by setting `java sdk enable` or `python sdk enable` to `OFF`.
Expand Down
28 changes: 28 additions & 0 deletions docs/zh/deploy/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,34 @@ Fork OpenMLDB仓库后,可以使用在`Actions`中触发workflow `Other OS Bui
此编译流程需要从源码编译thirdparty,且资源较少,无法开启较高的并发编译。因此编译时间较长,大约需要3h5m(2h thirdparty+1h OpenMLDB)。workflow会缓存thirdparty的编译产出,因此第二次编译会快很多(1h15m OpenMLDB)。
### Linux for ARM64
支持在 AArch64 架构的 Linux 系统上编译, 建议选择编译镜像 `ghcr.io/4paradigm/hybridsql` 在容器内编译. 在容器内:
```sh
# 建议在编译镜像内进行
docker run -it ghcr.io/4paradigm/hybridsql:latest
# inside docker container
git clone https://github.com/4paradigm/OpenMLDB
cd OpenMLDB
# 安装 third-party 编译 deps
yum install -y flex autoconf automake unzip bc expect libtool \
rh-python38-python-devel gettext byacc xz tcl cppunit-devel rh-python38-python-wheel patch java-1.8.0-openjdk-devel
# bazel
curl --create-dirs -SLo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64
chmod +x /usr/local/bin/bazel
# third-party
cmake -S third-party -B .deps -DBUILD_BUNDELD=ON -DMAKEOPTS=-j$(nproc)
cmake --build .deps
# OpenMLDB source
cmake -S . -B build -DCMKAE_PREFIX_PATH=$(pwd)/.deps/usr -DSQL_JAVASDK_ENABLE=ON -DSQL_PYSDK_ENABLE=ON
cmake --build build -- -j$(nproc)
```
### Macos 10.15, 11
Macos适配不需要从源码编译thirdparty,所以云编译耗时不会太长,大约1h15m。本地编译与[从源码全量编译](#从源码全量编译)章节相同,无需编译thirdparty(`BUILD_BUNDLED=OFF`)。云编译需要在`Actions`中触发workflow `Other OS Build`,编译产出在`Actions`的`Artifacts`中。workflow 配置 `os name`为`macos10`/`macos11`,同样可配置`java sdk enable`或`python sdk enable`为`OFF`。
11 changes: 11 additions & 0 deletions third-party/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ The pre-compiled thirdparty for Linux is built on Centos7 with gcc8, and macOS i
- make, autoreconf
- pkg-config


For Debian:
```sh
sudo apt-get install bison python3-dev libcppunit-dev build-essential cmake autoconf tcl pkg-config git curl patch libtool-bin unzip
# ensure python3 is the default, you may skip if it already is
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100

curl --create-dirs -SLo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
chmod +x /usr/local/bin/bazel
```

### Build thirdparty

```bash
Expand Down

0 comments on commit 006abb1

Please sign in to comment.