Skip to content

Commit

Permalink
update gcc build, moved to external
Browse files Browse the repository at this point in the history
  • Loading branch information
admercs committed May 6, 2024
1 parent 1d3da18 commit 030ebf1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
uses: actions/cache@v4
with:
path: |
"~/gcc-${GCC_VERSION}"
key: ${{ runner.os }}-gcc-${{ hashFiles('**/*gcc-${GCC_VERSION}*') }}
"~/external/gcc-${GCC_VERSION}"
key: ${{ runner.os }}-gcc-${{ hashFiles('**/*external/gcc-${GCC_VERSION}*') }}
restore-keys: |
${{ runner.os }}-gcc-
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ RPCLIB_VERSION='2.3.0'
PROJECT_DIR="$(realpath $PWD)"
SCRIPT_DIR="$(realpath ${BASH_SOURCE[0]})"

GCC_DIR="${PROJECT_DIR}/deps/gcc-${GCC_VERSION}/bin"
GCC_DIR="${PROJECT_DIR}/external/gcc/gcc-${GCC_VERSION}/bin"
GCC_VERSION_MAJOR="${GCC_VERSION%%.*}"

if [ "$(uname)" = 'Darwin' ]; then
Expand Down
11 changes: 6 additions & 5 deletions scripts/build_gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ while [ $# -gt 0 ]; do
done

# create dependencies directory if it does not exist.
mkdir -p deps/gcc_build
pushd deps
mkdir -p ./external/gcc
mkdir -p ./external/gcc_build
pushd external
pushd gcc_build

echo "Downloading GCC from GNU/Linux mirror: GCC ${GCC_VERSION}..."
Expand All @@ -63,7 +64,7 @@ source ./contrib/download_prerequisites
echo 'Building GCC from source...'
mkdir build
pushd build
../configure --prefix="${PROJECT_DIR}/deps/gcc-${GCC_VERSION}" --disable-multilib
../configure --prefix="${PROJECT_DIR}/external/gcc/gcc-${GCC_VERSION}" --disable-multilib
make
make install

Expand All @@ -72,11 +73,11 @@ popd # exit build
popd # exit gcc-$GCC_VERSION
popd # exit gcc_build
rm -rf gcc_build
popd # exit deps
popd # exit external

# echo "Prepending GCC ${GCC_VERSION} binary directory path to user PATH variable..."
# echo 'WARNING: This may have some undesirable side-effects.'
# echo "export PATH=\$HOME/AutonomySim/deps/gcc-${GCC_VERSION}/bin:\$PATH" | tee -a "${HOME}/.bashrc"
# echo "export PATH=\$HOME/AutonomySim/external/gcc-${GCC_VERSION}/bin:\$PATH" | tee -a "${HOME}/.bashrc"

echo 'GCC build completed successfully.'

Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ else
"libc++-${CLANG_VERSION}-dev" \
"libc++abi-${CLANG_VERSION}-dev"
# Conditionally download and build GCC from source
if [ ! -d "${PROJECT_DIR}/deps/gcc-${GCC_VERSION}/bin" ]; then
if [ ! -d "${PROJECT_DIR}/external/gcc/gcc-${GCC_VERSION}/bin" ]; then
source "${SCRIPT_DIR}/build_gcc.sh" --version "$GCC_VERSION"
fi
#sudo apt-get install -y \
Expand Down

0 comments on commit 030ebf1

Please sign in to comment.