From 0abf88823f87a56daa5640cacf3971303405cf91 Mon Sep 17 00:00:00 2001 From: Stefan Wallentowitz Date: Wed, 20 May 2020 12:58:43 +0200 Subject: [PATCH] Docker upgrade to Ubuntu 20.04 (#2318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [docker] Remove versions from Docker files There is no dependency on an actual version, it was only there to silence the linter. Instead the linter is now set to not warn about it. Signed-off-by: Stefan Wallentowitz * [docker] Update to Ubuntu 20.04 Update to new Ubuntu release: - Only GCC 9.3 available. Also add clang (10.0) now. - SystemC is now a package 🎉 Signed-off-by: Stefan Wallentowitz --- ci/docker/buildenv/Dockerfile | 52 +++++++++++++---------------- ci/docker/buildenv/README.adoc | 6 ++-- ci/docker/buildenv/build-systemc.sh | 30 ----------------- ci/docker/buildenv/build.sh | 6 ---- ci/docker/run/Dockerfile | 16 ++++----- 5 files changed, 34 insertions(+), 76 deletions(-) delete mode 100755 ci/docker/buildenv/build-systemc.sh diff --git a/ci/docker/buildenv/Dockerfile b/ci/docker/buildenv/Dockerfile index 7243d30d2..05ab3a830 100644 --- a/ci/docker/buildenv/Dockerfile +++ b/ci/docker/buildenv/Dockerfile @@ -6,44 +6,38 @@ # Version 2.0. # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -FROM ubuntu:18.04 +FROM ubuntu:20.04 RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y \ - autoconf=2.69-11 \ - bc=1.07.1-2 \ - bison=2:3.0.4.dfsg-1build1 \ - build-essential=12.4ubuntu1 \ - ca-certificates=20180409 \ - cmake=3.10.2-1ubuntu2.18.04.1 \ - flex=2.6.4-6 \ - gdb=8.1-0ubuntu3.2 \ - gcc-6=6.5.0-2ubuntu1~18.04 \ - gcc-5=5.5.0-12ubuntu1 \ - gcc-4.8=4.8.5-4ubuntu8 \ - git=1:2.17.1-1ubuntu0.5 \ - gtkwave=3.3.86-1 \ - g++-6=6.5.0-2ubuntu1~18.04 \ - g++-5=5.5.0-12ubuntu1 \ - g++-4.8=4.8.5-4ubuntu8 \ - libfl2=2.6.4-6 \ - libfl-dev=2.6.4-6 \ - numactl=2.0.11-2.1ubuntu0.1 \ - perl=5.26.1-6ubuntu0.3 \ - python3=3.6.7-1~18.04 \ - wget=1.19.4-1ubuntu2.2 \ - zlibc=0.9k-4.3 \ - zlib1g=1:1.2.11.dfsg-0ubuntu2 \ - zlib1g-dev=1:1.2.11.dfsg-0ubuntu2 \ + autoconf \ + bc \ + bison \ + build-essential \ + ca-certificates \ + clang \ + cmake \ + flex \ + gdb \ + git \ + gtkwave \ + libfl2 \ + libfl-dev \ + libsystemc \ + libsystemc-dev \ + numactl \ + perl \ + python3 \ + wget \ + zlibc \ + zlib1g \ + zlib1g-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* WORKDIR /tmp -COPY build-systemc.sh /tmp/ -RUN ./build-systemc.sh - RUN cpan install -fi Unix::Processors Parallel::Forker Bit::Vector RUN git clone https://github.com/veripool/vcddiff.git && \ diff --git a/ci/docker/buildenv/README.adoc b/ci/docker/buildenv/README.adoc index c4747c890..ed2270eed 100644 --- a/ci/docker/buildenv/README.adoc +++ b/ci/docker/buildenv/README.adoc @@ -5,7 +5,7 @@ build. It uses the following parameters: * Source repository (default: https://github.com/verilator/verilator) * Source revision (default: master) -* GCC version (4.8.5, 5.5.0, 6.5.0, 7.4.0, default: 7.4.0) +* Compiler (GCC 9.3.0, clang 10.0.0, default: 9.3.0) The container is published as `verilator/verilator-buildenv` on https://hub.docker.com/repository/docker/verilator/verilator-buildenv[docker hub]. @@ -20,13 +20,13 @@ To also run tests: To change the compiler: - docker run -ti -e CC=gcc-4.8 -e CXX=g++-4.8 verilator/verilator-buildenv test + docker run -ti -e CC=clang-10 -e CXX=clang++-10 verilator/verilator-buildenv test The tests that involve gdb are not working due to security restrictions. To run those too: .... -docker run -ti -v ${PWD}:/tmp/repo -e REPO=/tmp/repo -e REV=`git rev-parse --short HEAD` -e CC=gcc-4.8 -e CXX=g++-4.8 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined verilator/verilator-buildenv test +docker run -ti -e CC=clang-10 -e CXX=clang++-10 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined verilator/verilator-buildenv test .... Rather then building using a remote git repository you may prefer to use a diff --git a/ci/docker/buildenv/build-systemc.sh b/ci/docker/buildenv/build-systemc.sh deleted file mode 100755 index 0500e8ff3..000000000 --- a/ci/docker/buildenv/build-systemc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -e -# DESCRIPTION: Build SystemC in Ubuntu 18.04 with different g++/gcc -# -# Copyright 2020 by Stefan Wallentowitz. This program is free software; you -# can redistribute it and/or modify it under the terms of either the GNU -# Lesser General Public License Version 3 or the Perl Artistic License -# Version 2.0. -# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 - -build_variant () { - version=$($1 --version | grep gcc | awk '{print $4}') - mkdir "/usr/local/systemc-2.3.3-gcc$version" - mkdir build - cd build - ../configure --prefix="/usr/local/systemc-2.3.3-gcc$version" CC="$1" CXX="$2" LD="$2" - make -j - make install - cd .. - rm -r build -} - -wget https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz -tar -xzf systemc-2.3.3.tar.gz -cd systemc-2.3.3 -build_variant gcc g++ -build_variant gcc-6 g++-6 -build_variant gcc-5 g++-5 -build_variant gcc-4.8 g++-4.8 -cd .. -rm -r systemc-2.3.3* diff --git a/ci/docker/buildenv/build.sh b/ci/docker/buildenv/build.sh index f48c1c80b..1ad342151 100755 --- a/ci/docker/buildenv/build.sh +++ b/ci/docker/buildenv/build.sh @@ -12,12 +12,6 @@ : "${CC:=gcc}" : "${CXX:=g++}" -GCCVERSION=$(${CC} --version | grep gcc | awk '{print $4}') - -export SYSTEMC_INCLUDE="/usr/local/systemc-2.3.3-gcc${GCCVERSION}/include" -export SYSTEMC_LIBDIR="/usr/local/systemc-2.3.3-gcc${GCCVERSION}/lib-linux64" -export LD_LIBRARY_PATH=${SYSTEMC_LIBDIR} - SRCS=$PWD/verilator git clone "$REPO" "$SRCS" diff --git a/ci/docker/run/Dockerfile b/ci/docker/run/Dockerfile index e5e063a13..4a10ec336 100644 --- a/ci/docker/run/Dockerfile +++ b/ci/docker/run/Dockerfile @@ -6,19 +6,19 @@ # Version 2.0. # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -FROM ubuntu:18.04 +FROM ubuntu:20.04 RUN apt-get update \ && apt-get install --no-install-recommends -y \ - autoconf=2.69-11 \ - bc=1.07.1-2 \ - bison=2:3.0.4.dfsg-1build1 \ - build-essential=12.4ubuntu1 \ - ca-certificates=20180409 \ + autoconf \ + bc \ + bison \ + build-essential \ + ca-certificates \ ccache \ - flex=2.6.4-6 \ + flex \ git \ - libfl-dev=2.6.4-6 \ + libfl-dev \ libgoogle-perftools-dev \ perl \ python3 \