util-docker: Cleanup the systemc docker

1. Uses the ubuntu-24.04_all-deps as the base image.
2. Unifies the build and cleanup into a single step, thus reducing the
   size of the image.

Change-Id: I63b5dad2af0e8b1f6be8ad1f28321c743f36b2dc
This commit is contained in:
Bobby R. Bruce
2024-06-25 12:35:35 -07:00
parent 58aad68329
commit 2c0c933a3a

View File

@@ -24,30 +24,19 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ubuntu:22.04
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade && \
apt -y install build-essential git m4 scons zlib1g zlib1g-dev \
libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \
python3-dev python-is-python3 doxygen libboost-all-dev \
libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config pip \
python3-venv wget
RUN mkdir /systemc
WORKDIR /systemc
RUN wget https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz; \
tar xf systemc-2.3.3.tar.gz
WORKDIR /systemc/systemc-2.3.3
RUN mkdir objdir
WORKDIR objdir
ENV CXX="g++"
ENV CXXFLAGS="-std=c++17"
RUN ../configure --prefix=/opt/systemc
RUN make -j8 && make install
RUN make clean
WORKDIR /
RUN rm -rf /systemc/systemc-2.3.3/objdir
RUN wget https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz; \
tar xf systemc-2.3.3.tar.gz && \
rm systemc-2.3.3.tar.gz && \
cd systemc-2.3.3 && \
mkdir objdir && \
cd objdir && \
../configure --prefix=/opt/systemc && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf systemc-2.3.3