From 9e932c03c602e1a58e33533d6b1ce1965aa33e5e Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Wed, 30 Jun 2021 18:32:00 -0500 Subject: [PATCH] Another round --- ci/docker/linux-apt-r.dockerfile | 10 +++++++ ci/docker/ubuntu-21.04-cpp.dockerfile | 41 ++++++++++++++++----------- dev/tasks/tasks.yml | 1 + docker-compose.yml | 3 ++ r/configure | 3 +- r/tools/nixlibs.R | 1 + 6 files changed, 41 insertions(+), 18 deletions(-) diff --git a/ci/docker/linux-apt-r.dockerfile b/ci/docker/linux-apt-r.dockerfile index 634c68d253362..2e20418fd8b20 100644 --- a/ci/docker/linux-apt-r.dockerfile +++ b/ci/docker/linux-apt-r.dockerfile @@ -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/ diff --git a/ci/docker/ubuntu-21.04-cpp.dockerfile b/ci/docker/ubuntu-21.04-cpp.dockerfile index 6bdf5f81b0717..18c377811bcf5 100644 --- a/ci/docker/ubuntu-21.04-cpp.dockerfile +++ b/ci/docker/ubuntu-21.04-cpp.dockerfile @@ -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 \ @@ -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 \ No newline at end of file diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index d167be18aea83..14e152806ba23 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 856a14fcfe8c2..19a0c3531bb2f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 @@ -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 diff --git a/r/configure b/r/configure index aa7e7a8d01b35..336a277833e6f 100755 --- a/r/configure +++ b/r/configure @@ -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 @@ -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 diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index 97cc69fa62d7e..d653839ade0db 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -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 = " ")