ubuntu:20.04编译arrow

1)拉取代码

git clone https://github.com/apache/arrow.git

2)切换分支

git checkout apache-arrow-11.0.0

3)拉入测试数据并设置环境变量

pushd arrow
git submodule update --init
export PARQUET_TEST_DATA="${PWD}/cpp/submodules/parquet-testing/data"
export ARROW_TEST_DATA="${PWD}/testing/data"
popd

4)使用conda

conda包管理器允许将 Arrow C++ 和 PyArrow构建时依赖项安装为预构建的二进制文件,这可以使 Arrow 开发更轻松、更快速。

让我们创建一个 conda 环境,其中包含来自 conda-forge 的所有 C++ 构建和 Python 依赖项,目标是 Python 3.8 的开发:

conda create -y -n pyarrow-dev -c conda-forge \
       --file arrow/ci/conda_env_unix.txt \
       --file arrow/ci/conda_env_cpp.txt \
       --file arrow/ci/conda_env_python.txt \
       --file arrow/ci/conda_env_gandiva.txt \
       compilers \
       python=3.8 \
       pandas

5)激活pyarrow-dev

conda activate pyarrow-dev

 

 注意:

如果不使用 conda,您必须安排您的系统提供所需的构建工具和依赖项。请注意,如果缺少某些依赖项,Arrow C++ 构建链可能仍然能够即时下载和编译它们,但这将比预安装的二进制文件花费更长的时间。

在 macOS 上,使用 Homebrew 安装构建 Arrow C++ 所需的所有依赖项:

brew update && brew bundle --file=arrow/cpp/Brewfile


请参阅此处以获取您可能需要的依赖项列表。

在 Debian/Ubuntu 上,您需要以下最少的依赖项:

 apt-get install build-essential cmake python3-dev

6)创建python虚拟环境

python3 -m venv pyarrow-dev
source ./pyarrow-dev/bin/activate
pip3 install -r arrow/python/requirements-build.txt

# This is the folder where we will install the Arrow libraries during
# development
mkdir dist

7)设置环境变量,让 Arrow 的构建系统知道我们的构建工具链

export ARROW_HOME=$(pwd)/dist
export LD_LIBRARY_PATH=$(pwd)/dist/lib:$LD_LIBRARY_PATH
export CMAKE_PREFIX_PATH=$ARROW_HOME:$CMAKE_PREFIX_PATH

猜你喜欢

转载自blog.csdn.net/qq_38196982/article/details/129175173