Updates to from-source builds with conda for gcc '7.5.0'

Overview

Recently conda-forge has switched to publish conda packages using the gcc/g++ 9.3.0 build stack. RAPIDS v0.18 has also switched to this build stack for our conda dependencies resulting in the following changes for developers.

Impact

All from-source builds with conda dependencies for CUDA 10.1/10.2/11.0 using gcc 7.5.0 are affected and need changes to successfully build RAPIDS v0.18+

NOTE: CUDA 11.0 RAPIDS from-source builds with conda dependencies using gcc 9.3.0 are not impacted (CUDA 10.1/10.2 do not support gcc 9.3.0 for builds)

Ubuntu 16.04/18.04/20.04

For all Ubuntu versions, we use this PPA to install gcc 7.5.0 and update the alternatives to set it as the default compiler:

sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-7 g++-7 libstdc++6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
sudo update-alternatives --set gcc /usr/bin/gcc-7
sudo update-alternatives --set g++ /usr/bin/g++-7

NOTE: The docker equivalent for this code can be found here

With the install of gcc 7.5.0 and an updated libstdc++6 pkg, you should be able to build RAPIDS from-source with conda dependencies. If you encounter any GLIBC errors during the build process, be sure the check the version of the libstdc++6 package outlined below.

Check libstdc++6 package version

In order to build with conda dependencies from conda-forge the installed libstdc++6 package must be >= 9.3.0. You can verify the current installed version and available version through the following commands:

sudo apt-get update
sudo apt-cache policy `libstdc++6`

If the version is not >= 9.3.0 install the package again to update it:

sudo apt-get install libstdc++6

CentOS 7/8 or RHEL 7/8

For CentOS and RHEL we build gcc 7.5.0 from source for our docker images and make it available as a tarball. Our public tarball is now patched to include a version of libstdc++ from a gcc 9.3.0 build that allows from-source builds of RAPIDS with conda dependencies to work.

Installing our patched gcc 7.5.0

Download and extract the tarball to the target machine or docker image. The tarball is meant to be extracted from the root and extracts into the following path: /usr/local/gcc7

sudo wget --quiet https://gpuci.s3.us-east-2.amazonaws.com/builds/gcc7.tgz -O /gcc7.tgz
sudo tar xzf /gcc7.tgz
sudo rm -f /gcc7.tgz

NOTE: The docker equivalent for this code can be found here

Once extracted, setup the environment variables to enable the use of the installed gcc 7.5.0:

export GCC7_DIR=/usr/local/gcc7
export CC=${GCC7_DIR}/bin/gcc
export CXX=${GCC7_DIR}/bin/g++
export CUDAHOSTCXX=${GCC7_DIR}/bin/g++
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=${GCC7_DIR}/lib64:$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib
export PATH=${GCC7_DIR}/bin:$PATH

NOTE: The docker equivalent for this code can be found here

From here all ./build.sh scripts in RAPIDS repos should build without error.