Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Ubuntu Focal gcc-10 setup and update related usage instructions. #371

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ ADD ./tools/scripts/lib_install ./tools/scripts/lib_install
# `install-prebuilt-packages.sh` and `install-packages-from-source.sh`.
RUN ./tools/scripts/lib_install/ubuntu-focal/install-prebuilt-packages.sh

# Set gcc/g++ 10 as the default compiler
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
RUN update-alternatives --set gcc /usr/bin/gcc-10
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 20
# Set cpp, cc, and c++ to v10
RUN update-alternatives --set cc /usr/bin/gcc-10
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
RUN update-alternatives --set g++ /usr/bin/g++-10
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-10 20
RUN update-alternatives --set c++ /usr/bin/g++-10
RUN update-alternatives --set cpp /usr/bin/cpp-10

RUN ./tools/scripts/lib_install/ubuntu-focal/install-packages-from-source.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
python3 \
python3-pip \
zlib1g-dev

# Add alternatives for cpp-10, gcc-10, and g++-10
# NOTE: We use a low priority to avoid affecting the prioritization of any existing alternatives
# on the user's system.
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 0 \
--slave /usr/share/mna/man1/cc.1.gz cc.1.gz /usr/share/man/man1/gcc.1.gz
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-10 0 \
--slave /usr/share/mna/man1/c++.1.gz c++.1.gz /usr/share/man/man1/g++.1.gz
update-alternatives --install /lib/cpp cpp /usr/bin/cpp-10 0
10 changes: 1 addition & 9 deletions docs/src/dev-guide/components-core/ubuntu-focal-deps-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ components/core/tools/scripts/lib_install/ubuntu-focal/install-all.sh
Enable GCC 10 as the default compiler by running:

```shell
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
update-alternatives --set gcc /usr/bin/gcc-10

update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 20
update-alternatives --set cc /usr/bin/gcc-10

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
update-alternatives --set g++ /usr/bin/g++-10

update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-10 20
update-alternatives --set c++ /usr/bin/g++-10
update-alternatives --set cpp /usr/bin/cpp-10
```
Loading