Skip to content

Commit

Permalink
Now creating a symlink for gcc.
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepd-nv committed Oct 17, 2023
1 parent 58ea289 commit 345b1e7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
31 changes: 29 additions & 2 deletions conda/conda-build/build.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion continuous_integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 345b1e7

Please sign in to comment.