From fc462127a1f0988e2ba85952fba4719e844a004e Mon Sep 17 00:00:00 2001 From: Heiko Joerg Schick Date: Fri, 9 Aug 2024 13:12:36 +0200 Subject: [PATCH] Initial commit --- Dockerfile | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2a24996 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,69 @@ +FROM ubuntu:23.10 + +ENV DEBIAN_FRONTEND=noninteractive + +WORKDIR /root + +# Install prerequisites +RUN apt update -qq && apt install -y --no-install-recommends \ + autoconf \ + automake \ + autotools-dev \ + curl \ + python3 \ + python3-pip \ + libmpc-dev \ + libmpfr-dev \ + libgmp-dev \ + gawk \ + build-essential \ + bison \ + flex \ + texinfo \ + gperf \ + libtool \ + patchutils \ + bc \ + zlib1g-dev \ + libexpat-dev \ + ninja-build \ + git \ + cmake \ + libglib2.0-dev \ + libslirp-dev \ + && rm -rf /var/lib/apt/lists/* + +# Compile and install toolchain +RUN git clone https://github.com/riscv/riscv-gnu-toolchain + +WORKDIR /root/riscv-gnu-toolchain + +RUN ./configure --prefix=/opt/riscv && \ + make -j8 + +WORKDIR /root + +RUN rm -rf /root/riscv-gnu-toolchain + +# Install additional prerequisites +RUN apt update -qq && apt install -y --no-install-recommends \ + device-tree-compiler \ + && rm -rf /var/lib/apt/lists/* + +# Compile and install Spike +RUN git clone https://github.com/riscv/riscv-isa-sim.git + +WORKDIR /root/riscv-isa-sim + +RUN mkdir build && \ + cd build && \ + ../configure --prefix=/opt/riscv && \ + make -j8 && \ + make install + +WORKDIR /root + +RUN rm -rf /root/riscv-isa-sim + +# Pass commands into container +ENTRYPOINT ["bash", "-lc"] \ No newline at end of file