From cb61d01ededc4ef6d7297f6064b71ac0b198e020 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 20 Nov 2023 13:24:32 -0800 Subject: [PATCH 1/4] ext: Add 'cmake' dep check to DRAMSys install CMake is not required to build gem5. It is only required to build and link the optional DRAMSysm library. Therefore, if the DRAMSys repo has been cloned but CMake is not present this patch ensures no attempt at building or linking DRAMSysm is made. A warning is thrown inform the user of the missing CMake. Change-Id: I4d22e3a16655fd90f6b109b4e75859628f7d532d --- ext/dramsys/SConscript | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ext/dramsys/SConscript b/ext/dramsys/SConscript index 0cf163aede..bfe4ee5ec1 100644 --- a/ext/dramsys/SConscript +++ b/ext/dramsys/SConscript @@ -27,6 +27,10 @@ import os import subprocess +from shutil import which + +from gem5_scons import warning + Import("env") build_root = Dir("../..").abspath @@ -40,6 +44,16 @@ if not os.path.exists(Dir(".").srcnode().abspath + "/DRAMSys"): env["HAVE_DRAMSYS"] = False Return() +# DRAMSys requires CMake to build but this is is not a dependency for +# gem5 outside of this DRAMSys integration. Therefore, we do not fail the +# entire gem5 build if CMake is not found. Instead we just skip the building of +# DRAMSys and print a warning. +if which("cmake") is None: + warning("The DRAMSys repo is present but CMake cannot be found. " + "DRAMSys will not be built.") + env["HAVE_DRAMSYS"] = False + Return() + env["HAVE_DRAMSYS"] = True subprocess.run( From 575114b63b39e1b102eb58fcdc72ed2277466784 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 20 Nov 2023 13:31:42 -0800 Subject: [PATCH 2/4] ext: Add .gitignore to ext/dramsys Change-Id: Ifc1a3c77b56cbe5777d041a88b2c0d5cb77eaf89 --- ext/dramsys/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/dramsys/.gitignore diff --git a/ext/dramsys/.gitignore b/ext/dramsys/.gitignore new file mode 100644 index 0000000000..0193b6e8f3 --- /dev/null +++ b/ext/dramsys/.gitignore @@ -0,0 +1 @@ +DRAMSys From 8f9a3286529a81903ed4434e85d791e1aac69775 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 20 Nov 2023 13:32:10 -0800 Subject: [PATCH 3/4] util-docker: Add 'cmake' to all-deps 'cmake' is required to build DRAMSysm. This is an optional dependency for compiling DRAMSys. It is therefore not required. It is included in the "all-dependencies" Docker images as they may be needed if DRAMSys is desired. Change-Id: I1a3e1a6fa2da4d0116d423e9267d4d3095000d4e --- util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile | 2 +- util/dockerfiles/ubuntu-22.04_all-dependencies/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile b/util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile index 8f092adc7a..ba3d554c3b 100644 --- a/util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile +++ b/util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile @@ -32,7 +32,7 @@ RUN apt -y update && apt -y upgrade && \ 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 black gcc-10 g++-10 + python3-venv black gcc-10 g++-10 cmake RUN pip install mypy pre-commit diff --git a/util/dockerfiles/ubuntu-22.04_all-dependencies/Dockerfile b/util/dockerfiles/ubuntu-22.04_all-dependencies/Dockerfile index 9e2580e642..679248a081 100644 --- a/util/dockerfiles/ubuntu-22.04_all-dependencies/Dockerfile +++ b/util/dockerfiles/ubuntu-22.04_all-dependencies/Dockerfile @@ -31,6 +31,6 @@ 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 doxygen libboost-all-dev libhdf5-serial-dev python3-pydot \ - libpng-dev libelf-dev pkg-config pip python3-venv black + libpng-dev libelf-dev pkg-config pip python3-venv black cmake RUN pip install mypy pre-commit From 36e83943b594c829e2f3d97e709fab30516a6bd4 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 20 Nov 2023 13:35:19 -0800 Subject: [PATCH 4/4] tests,misc: Update DRAMSys test clone command This clone is updated to reflect the new advice given in ext/dramasys/README that was introduced in PR https://github.com/gem5/gem5/pull/525 to upgrade DRAMSysm to v5.0. Change-Id: I868619ecc1a44298dd3885e5719979bdaa24e9c2 --- .github/workflows/weekly-tests.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 72b1454a5e..6c211435c2 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -89,11 +89,7 @@ jobs: - name: Checkout DRAMSys working-directory: ${{ github.workspace }}/ext/dramsys - run: | - git clone https://github.com/tukl-msd/DRAMSys DRAMSys - cd DRAMSys - git checkout -b gem5 09f6dcbb91351e6ee7cadfc7bc8b29d97625db8f - git submodule update --init --recursive + run: git clone https://github.com/tukl-msd/DRAMSys --branch v5.0 --depth 1 DRAMSys # gem5 is built separately because it depends on the DRAMSys library - name: Build gem5