Skip to content

Commit

Permalink
Attempt to build static lib based on manylinux2014
Browse files Browse the repository at this point in the history
  • Loading branch information
nealrichardson committed Jan 12, 2020
1 parent 26f586f commit f9c50fa
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,19 @@ services:
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
/arrow/ci/scripts/r_sanitize.sh /arrow"
r-manylinux2014:
image: ${REPO}:amd64-centos-7.7-python-manylinux2014
build:
context: python/manylinux201x
dockerfile: Dockerfile-x86_64_base_2014
cache_from:
- ${REPO}:amd64-centos-7.7-python-manylinux2014
shm_size: *shm-size
volumes:
- .:/arrow:delegated
- ./python/manylinux201x:/io:delegated
command: /io/build_arrow_static.sh

################################ Rust #######################################

debian-rust:
Expand Down
90 changes: 90 additions & 0 deletions python/manylinux201x/build_arrow_static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Build upon the scripts in https://github.com/matthew-brett/manylinux-builds
# * Copyright (c) 2013-2019, Matt Terry and Matthew Brett (BSD 2-clause)
#
# Usage:
# either build:
# $ docker-compose build centos-python-manylinux2010
# or pull:
# $ docker-compose pull centos-python-manylinux2010
# and then run:
# $ docker-compose run -e PYTHON_VERSION=3.7 centos-python-manylinux2010
# Can use either manylinux2010 or manylinux2014

source /multibuild/manylinux_utils.sh

# Quit on failure
set -e

# Print commands for debugging
# set -x

cd /arrow/python

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/arrow-dist/lib/pkgconfig

# Ensure the target directory exists
mkdir -p /io/dist

ARROW_BUILD_DIR=/io/dist
mkdir -p "${ARROW_BUILD_DIR}"
pushd "${ARROW_BUILD_DIR}"
CC=gcc CXX=g++ cmake -DCMAKE_BUILD_TYPE=Release \
-DARROW_DEPENDENCY_SOURCE=BUNDLED \
-DZLIB_ROOT=/usr/local \
-DCMAKE_INSTALL_PREFIX=/io/dist \
-DCMAKE_INSTALL_LIBDIR=lib \
-DARROW_BUILD_TESTS=OFF \
-DARROW_BUILD_SHARED=OFF \
-DARROW_BUILD_STATIC=ON \
-DARROW_BOOST_USE_SHARED=OFF \
-DARROW_GANDIVA_PC_CXX_FLAGS="-isystem;/opt/rh/devtoolset-8/root/usr/include/c++/8/;-isystem;/opt/rh/devtoolset-8/root/usr/include/c++/8/x86_64-redhat-linux/" \
-DARROW_JEMALLOC=ON \
-DARROW_RPATH_ORIGIN=ON \
-DARROW_PYTHON=OFF \
-DARROW_COMPUTE=ON \
-DARROW_CSV=ON \
-DARROW_FILESYSTEM=ON \
-DARROW_JSON=ON \
-DARROW_PARQUET=ON \
-DARROW_DATASET=ON \
-DARROW_PLASMA=OFF \
-DARROW_TENSORFLOW=OFF \
-DARROW_ORC=OFF \
-DARROW_WITH_BZ2=ON \
-DARROW_WITH_ZLIB=ON \
-DARROW_WITH_ZSTD=ON \
-DARROW_WITH_LZ4=ON \
-DARROW_WITH_SNAPPY=ON \
-DARROW_WITH_BROTLI=ON \
-DARROW_FLIGHT=OFF \
-DARROW_GANDIVA=OFF \
-DARROW_GANDIVA_JAVA=OFF \
-DBoost_NAMESPACE=arrow_boost \
-DBOOST_ROOT=/arrow_boost_dist \
-DOPENSSL_USE_STATIC_LIBS=ON \
-GNinja /arrow/cpp
ninja -v install

# Copy the bundled static libs from the build to the install dir
find . -regex .*/lib/.*\\.a\$ | xargs -I{} cp {} ./lib

popd
5 changes: 5 additions & 0 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ PKG_BREW_NAME="apache-arrow"
PKG_TEST_HEADER="<arrow/api.h>"
PKG_LIBS="-larrow -lparquet -larrow_dataset"

# Temporarily put here
if [ "$LIBARROW_BINARY" ]; then
PKG_LIBS="$PKG_LIBS -lthrift -lsnappy -lz -lzstd -llz4 -lbrotlidec-static -lbrotlienc-static -lbrotlicommon-static -lboost_filesystem -lboost_regex -lboost_system -ljemalloc_pic"
fi

# generate code
if [ "$ARROW_R_DEV" = "TRUE" ]; then
echo "*** Generating code with data-raw/codegen.R"
Expand Down

0 comments on commit f9c50fa

Please sign in to comment.