util: Update python version for GCN3

The Python version installed in the Dockerfile for GCN3 by apt-get is
too old to build gem5. This bumps the version to the most recent Python
to avoid needing to update this file too much.

Python 3.9 is install via PPA since it is not available in the official
Ubuntu 16.04 repository. Likewise, pip is installed from "source" as it
is not available for Python 3.9 in from neither the PPA nor Ubuntu.

Change-Id: Ia919f31cf9c9063e1df091cea15590526715739b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37219
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Daniel Gerzhoy <daniel.gerzhoy@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Matthew Poremba
2020-11-07 14:57:31 -06:00
parent 5586484344
commit 56a549080f

View File

@@ -1,5 +1,12 @@
FROM ubuntu:16.04
# Needed for add-apt-repository
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common
# Ubuntu 16.04 does not have a python package new enough for gem5, use a PPA
RUN add-apt-repository ppa:deadsnakes/ppa && apt-get update
# Should be minimal needed packages
RUN apt-get update && apt-get install -y --no-install-recommends \
findutils \
@@ -20,11 +27,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libprotoc-dev \
libgoogle-perftools-dev \
python-yaml \
python3-dev \
python3 \
python3-yaml \
python3-six \
python3-pip \
python3.9 \
python3.9-dev \
python3.9-distutils \
wget \
libpci3 \
libelf1 \
@@ -37,8 +42,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libboost-dev \
libpng12-dev
RUN python3 -m pip install -U pip && \
python3 -m pip install -U setuptools scons==3.1.2
# Use python 3.9 by default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
# Setuptools is needed for cmake for ROCm build. Install using pip.
# Instructions to install PIP from https://pypi.org/project/pip/
RUN wget https://bootstrap.pypa.io/get-pip.py -qO get-pip.py
RUN python3 get-pip.py
RUN pip install -U setuptools scons==3.1.2 six
ARG gem5_dist=http://dist.gem5.org/dist/develop
@@ -152,5 +163,7 @@ RUN cp gfx803_64.cd.pdb.txt gfx801_4.cd.pdb.txt && \
WORKDIR /ROCm-Profiler
RUN dpkg -i package/rocm-profiler_4.0.6036_amd64.deb
# Always use python3 and create a link to config command for gem5 to find
RUN ln -sf /usr/bin/python3 /usr/bin/python
RUN ln -sf /usr/bin/python3.9-config /usr/bin/python3-config
WORKDIR /