From: Matthew Poremba Date: Sat, 7 Nov 2020 20:57:31 +0000 (-0600) Subject: util: Update python version for GCN3 X-Git-Tag: develop-gem5-snapshot~489 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56a549080f45b3d0d0e9d272b7475e35597e31f7;p=gem5.git 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 Reviewed-by: Daniel Gerzhoy Maintainer: Matt Sinclair Tested-by: kokoro --- diff --git a/util/dockerfiles/gcn-gpu/Dockerfile b/util/dockerfiles/gcn-gpu/Dockerfile index 19f3ad7d2..e13367fcd 100644 --- a/util/dockerfiles/gcn-gpu/Dockerfile +++ b/util/dockerfiles/gcn-gpu/Dockerfile @@ -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 /