Skip to content

Commit

Permalink
Merge pull request #45 from derickson2402/feature/f23
Browse files Browse the repository at this point in the history
Update container for fall 23 semester
  • Loading branch information
derickson2402 authored Sep 7, 2023
2 parents 7b91c95 + 7a45de4 commit fe96295
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
33 changes: 30 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SHELL ["/bin/bash", "-c"]
#
# Builder stage for compiling gcc-6.2.0 compiler

FROM caen-base as gcc-builder
FROM caen-base as gcc-6-builder

# Install pre-requisite programs for compiling gcc-6.2.0
RUN dnf update -y && dnf install -y --nodocs \
Expand Down Expand Up @@ -169,9 +169,10 @@ COPY --from=builder-golang /usr/um/go /usr/um/go
RUN ln -s /usr/um/go/bin/go /usr/bin/go

# Set our compiled gcc to custom software location
COPY --from=gcc-builder /usr/um/gcc-6.2.0/ /usr/um/gcc-6.2.0/
COPY --from=gcc-6-builder /usr/um/gcc-6.2.0/ /usr/um/gcc-6.2.0/

# Install dev packages and tools, clean dnf cache to save space
# Install dev packages and tools, clean dnf cache to save space. Also install
# gcc-12.2.1
RUN dnf --setopt=group_package_types=mandatory \
groupinstall --nodocs -y "Development Tools" \
&& dnf install --nodocs -y \
Expand All @@ -181,10 +182,36 @@ RUN dnf --setopt=group_package_types=mandatory \
vim \
which \
gnupg2 \
gcc-toolset-12 \
&& dnf clean all \
&& rm -rf /var/cache/yum \
&& rm -rf /var/cache/dnf

# Configure versions of gcc. Default is 12.2.1, but gcc-12, gcc-12.2,
# gcc-12.2.1, gcc-8, gcc-8.5, gcc-8.5.0, gcc-6, gcc-6.2, gcc-6.2.0 should all
# work as expected
WORKDIR /usr/local/bin
RUN ln -s /usr/bin/gcc gcc \
&& ln -s /usr/bin/g++ g++ \
&& ln -s /opt/rh/gcc-toolset-12/root/bin/gcc gcc-12 \
&& ln -s /opt/rh/gcc-toolset-12/root/bin/gcc g++-12 \
&& ln -s /opt/rh/gcc-toolset-12/root/bin/gcc gcc-12.2 \
&& ln -s /opt/rh/gcc-toolset-12/root/bin/gcc g++-12.2 \
&& ln -s /opt/rh/gcc-toolset-12/root/bin/gcc gcc-12.2.1 \
&& ln -s /opt/rh/gcc-toolset-12/root/bin/gcc g++-12.2.1 \
&& ln -s /usr/bin/gcc gcc-8 \
&& ln -s /usr/bin/g++ g++-8 \
&& ln -s /usr/bin/gcc gcc-8.5 \
&& ln -s /usr/bin/g++ g++-8.5 \
&& ln -s /usr/bin/gcc gcc-8.5.0 \
&& ln -s /usr/bin/g++ g++-8.5.0 \
&& ln -s /usr/um/gcc-6.2.0/bin/gcc gcc-6 \
&& ln -s /usr/um/gcc-6.2.0/bin/g++ g++-6 \
&& ln -s /usr/um/gcc-6.2.0/bin/gcc gcc-6.2 \
&& ln -s /usr/um/gcc-6.2.0/bin/g++ g++-6.2 \
&& ln -s /usr/um/gcc-6.2.0/bin/gcc gcc-6.2.0 \
&& ln -s /usr/um/gcc-6.2.0/bin/g++ g++-6.2.0

# Give bash a pretty prompt
ENV PS1="\[\e[0;1;38;5;82m\]CAEN ~\[\e[0m\] "

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ Everything you do is now running in a CAEN environment!
If you don't see the prompt, you can also open the command palette and run ```Remote-Containers: Reopen in Container```.
Happy coding!

## How Does This Work?
## Compiler Versions

There are currently 3 compiler versions available. ```gcc-6.2.0``` is a legacy version that EECS 281 used a few years ago, ```gcc-8.5.0``` is the default on CAEN (and RHEL 8), and ```gcc-12.2.1``` is a newer version for EECS 482.

The default when you run ```gcc``` is ```gcc-8.5.0```, but if you wanted to use for example ```gcc-12.2.1``` then ```gcc-12```, ```gcc-12.2```, and ```gcc-12.2.1``` all work the same.

## How Does This Project Work?

Great question!
It uses a [Docker Container](https://www.docker.com/resources/what-container/), which is like a virtual environment running Linux.
Expand Down

0 comments on commit fe96295

Please sign in to comment.