From 345b1e7efc07cf288b86083c978124f07389ce6c Mon Sep 17 00:00:00 2001 From: Sandeep Datta Date: Tue, 17 Oct 2023 10:52:42 -0700 Subject: [PATCH] Now creating a symlink for gcc. --- conda/conda-build/build.sh | 31 +++++++++++++++++++++++++++++-- continuous_integration/Dockerfile | 3 ++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/conda/conda-build/build.sh b/conda/conda-build/build.sh index 55cd57615..d6daf230a 100644 --- a/conda/conda-build/build.sh +++ b/conda/conda-build/build.sh @@ -1,8 +1,35 @@ #!/bin/bash -echo -e "\n\n--------------------- CONDA/CONDA-BUILD/BUILD.SH -----------------------" +echo -e "\n\n--------------------- CONDA/CONDA-BUILD/BUILD.SH -----------------------\n" -set -x +set -xeo pipefail + +check_and_create_gcc_symlink() { + # Check if /usr/bin/gcc exists and is a symlink + if [ -L /usr/bin/gcc ]; then + echo "/usr/bin/gcc is a symlink. Overwriting..." + sudo rm /usr/bin/gcc + elif [ -e /usr/bin/gcc ]; then + echo "/usr/bin/gcc exists but is not a symlink. Exiting." + return 1 + fi + + # Define the path to the GCC binary using CONDA_PREFIX + local GCC_BINARY="$CONDA_PREFIX/bin/x86_64-conda-linux-gnu-gcc" + + # Check if the GCC binary exists + if [ -f "$GCC_BINARY" ]; then + # Create a symlink to GCC in /usr/bin/ + sudo ln -s "$GCC_BINARY" /usr/bin/gcc + echo "Symlink /usr/bin/gcc created." + return 0 + else + echo "GCC binary not found at $GCC_BINARY. Please make sure it exists." + return 1 + fi +} + +check_and_create_gcc_symlink # export CPU_COUNT=1 diff --git a/continuous_integration/Dockerfile b/continuous_integration/Dockerfile index 33fbb3d08..bf72e95bd 100644 --- a/continuous_integration/Dockerfile +++ b/continuous_integration/Dockerfile @@ -4,7 +4,8 @@ FROM ${BASE_IMAGE} as stage0 SHELL ["/bin/bash", "-c"] RUN apt-get update && \ - apt-get install -y vim build-essential + apt-get install -y vim + # build-essential ENV PYTHONDONTWRITEBYTECODE=1 ENV SCCACHE_REGION="us-east-2"