From 77e4f9f09a8eb735faebc4e0efccbee60ac21a1c Mon Sep 17 00:00:00 2001 From: Yong Hoon Shin Date: Mon, 23 Dec 2024 12:20:18 -0800 Subject: [PATCH] Update gcc version for FBGEMM install in CI (#2654) Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of https://github.com/pytorch/pytorch/pull/141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and https://github.com/pytorch/FBGEMM/issues/3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624 --- .github/workflows/docs.yml | 12 ++++++++++-- .github/workflows/release_build.yml | 14 +++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 51217790e..176322cfe 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -33,7 +33,8 @@ jobs: - name: Setup conda run: | wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh - bash ~/miniconda.sh -b -p $HOME/miniconda + bash ~/miniconda.sh -b -p $HOME/miniconda -u + conda update -n base -c defaults -y conda - name: setup Path run: | echo "/home/ec2-user/miniconda/bin" >> $GITHUB_PATH @@ -51,7 +52,14 @@ jobs: - name: Install gcc shell: bash run: | - sudo apt-get install build-essential + conda install -n build_binary -c conda-forge -y gxx_linux-64=11.4.0 + echo "[INSTALL] Setting the C/C++ compiler symlinks ..." + cc_path=$(conda run -n build_binary printenv CC) + cxx_path=$(conda run -n build_binary printenv CXX) + ln -sf "${cc_path}" "$(dirname "$cc_path")/cc" + ln -sf "${cc_path}" "$(dirname "$cc_path")/gcc" + ln -sf "${cxx_path}" "$(dirname "$cxx_path")/c++" + ln -sf "${cxx_path}" "$(dirname "$cxx_path")/g++" - name: setup Path run: | echo /usr/local/bin >> $GITHUB_PATH diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 1ea837d4b..2e86e434f 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -48,6 +48,7 @@ jobs: run: | wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh bash ~/miniconda.sh -b -p $HOME/miniconda -u + conda update -n base -c defaults -y conda - name: setup Path run: | echo "/home/ec2-user/miniconda/bin" >> $GITHUB_PATH @@ -62,9 +63,16 @@ jobs: - name: check python version run: | conda run -n build_binary python --version - - name: Install C/C++ compilers - run: | - sudo yum install -y gcc gcc-c++ + - name: Install gcc + run: | + conda install -n build_binary -c conda-forge -y gxx_linux-64=11.4.0 + echo "[INSTALL] Setting the C/C++ compiler symlinks ..." + cc_path=$(conda run -n build_binary printenv CC) + cxx_path=$(conda run -n build_binary printenv CXX) + ln -sf "${cc_path}" "$(dirname "$cc_path")/cc" + ln -sf "${cc_path}" "$(dirname "$cc_path")/gcc" + ln -sf "${cxx_path}" "$(dirname "$cxx_path")/c++" + ln -sf "${cxx_path}" "$(dirname "$cxx_path")/g++" - name: Install PyTorch and CUDA shell: bash run: |