Skip to content

Commit

Permalink
Another round
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkeane committed Jul 1, 2021
1 parent 63ec5ee commit 9e932c0
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 18 deletions.
10 changes: 10 additions & 0 deletions ci/docker/linux-apt-r.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ RUN apt-get update -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ARG gcc_version=""
RUN if [ "${gcc_version}" != "" ]; then \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gcc_version} 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${gcc_version} 100 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 && \
update-alternatives --set cc /usr/bin/gcc && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 && \
update-alternatives --set c++ /usr/bin/g++; \
fi

# Ensure parallel R package installation, set CRAN repo mirror,
# and use pre-built binaries where possible
COPY ci/etc/rprofile /arrow/ci/etc/
Expand Down
41 changes: 24 additions & 17 deletions ci/docker/ubuntu-21.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ RUN if [ "${llvm}" -gt "10" ]; then \
apt-get clean && \
rm -rf /var/lib/apt/lists*

ARG gcc_version=""
RUN if [ "${gcc_version}" = "" ]; then \
apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
g++ \
gcc; \
else \
apt-get update -y -q && \
apt-get install -y -q --no-install-recommends software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/volatile && \
apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
g++-${gcc_version} \
gcc-${gcc_version}; \
fi


# Installs C++ toolchain and dependencies
RUN apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
Expand Down Expand Up @@ -151,3 +134,27 @@ ENV ARROW_BUILD_TESTS=ON \
PARQUET_BUILD_EXECUTABLES=ON \
PATH=/usr/lib/ccache/:$PATH \
PYTHON=python3

ARG gcc_version=""
RUN if [ "${gcc_version}" = "" ]; then \
apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
g++ \
gcc; \
else \
if [ "${gcc_version}" -gt "10" ]; then \
apt-get update -y -q && \
apt-get install -y -q --no-install-recommends software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/volatile; \
fi; \
apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
g++-${gcc_version} \
gcc-${gcc_version} && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gcc_version} 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${gcc_version} 100 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 100 && \
update-alternatives --set cc /usr/bin/gcc && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 100 && \
update-alternatives --set c++ /usr/bin/g++; \
fi
1 change: 1 addition & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ tasks:
CLANG_TOOLS: 9 # can remove this when >=9 is the default
GCC_VERSION: 11
ARROW_HOME: ""
ARROW_S3: OFF # S3 support is not buildable with gcc11
image: ubuntu-r-static


Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,8 @@ services:
arch: ${ARCH}
r: ${R}
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
arrow_home: ${ARROW_HOME}
gcc_version: ${GCC_VERSION}
shm_size: *shm-size
environment:
<<: *ccache
Expand Down Expand Up @@ -1038,6 +1040,7 @@ services:
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
arrow_home: ${ARROW_HOME}
arrow_build_static: "ON"
gcc_version: ${GCC_VERSION}
shm_size: *shm-size
environment:
<<: *ccache
Expand Down
3 changes: 2 additions & 1 deletion r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ if [ $? -eq 0 ] || [ "$UNAME" = "Darwin" ]; then
# Check for features
LIB_DIR=`echo $PKG_DIRS | sed -e 's/^-L//'`
ARROW_OPTS_CMAKE="$LIB_DIR/cmake/arrow/ArrowOptions.cmake"
echo "Checking ARROW_OPTS_CMAKE for features: $ARROW_OPTS_CMAKE"
# Check for Parquet
grep 'set(ARROW_PARQUET "ON")' $ARROW_OPTS_CMAKE >/dev/null 2>&1
if [ $? -eq 0 ]; then
Expand All @@ -244,7 +245,7 @@ if [ $? -eq 0 ] || [ "$UNAME" = "Darwin" ]; then
fi
fi
# prepend PKG_DIRS and append BUNDLED_LIBS to PKG_LIBS
PKG_LIBS="$PKG_DIRS $PKG_LIBS $BUNDLED_LIBS"
PKG_LIBS="$PKG_DIRS $PKG_LIBS $BUNDLED_LIBS -fno-lto"
echo "PKG_CFLAGS=$PKG_CFLAGS"
echo "PKG_LIBS=$PKG_LIBS"
else
Expand Down
1 change: 1 addition & 0 deletions r/tools/nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ build_libarrow <- function(src_dir, dst_dir) {
CC = R_CMD_config("CC"),
CXX = paste(R_CMD_config("CXX11"), R_CMD_config("CXX11STD")),
# CXXFLAGS = R_CMD_config("CXX11FLAGS"), # We don't want the same debug symbols
ARROW_R_CXXFLAGS = paste(Sys.getenv("ARROW_R_CXXFLAGS", ""), "-fno-lto"),
LDFLAGS = R_CMD_config("LDFLAGS")
)
env_vars <- paste0(names(env_var_list), '="', env_var_list, '"', collapse = " ")
Expand Down

0 comments on commit 9e932c0

Please sign in to comment.