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
This commit is contained in:
Bobby R. Bruce
2023-11-20 13:24:32 -08:00
parent 6e433ed885
commit cb61d01ede

View File

@@ -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(