Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/56750 )
Change subject: SCons: Move the build of ext/ into the variant dirs.
......................................................................
SCons: Move the build of ext/ into the variant dirs.
These are no longer split out and shared in the root build/ directory.
This does result in a small amount of overhead from building redundant
copies of these files, although the overhead is not significant. When
building 7 different variants of gem5, all the ISAs and NULL, the
difference on my machine was:
Before:
real 41m25.372s
user 914m22.266s
sys 41m51.816s
After:
real 42m38.074s
user 921m36.852s
sys 43m2.949s
This is about a 2-3% difference, which is a worse than typical case,
since the overhead scales with the number of variants being built.
The benefit of pulling ext/ into the variant directory is that there can
now be a single config which applies to all files used to build gem5,
and that config is represented by the variant of gem5 being built.
Change-Id: I6f0db97c63a7f3e252e7e351aa862340978e701b
---
M SConstruct
1 file changed, 41 insertions(+), 20 deletions(-)
diff --git a/SConstruct b/SConstruct
index 04515f2..6c31d60 100755
--- a/SConstruct
+++ b/SConstruct
@@ -654,23 +654,6 @@
########################################################################
#
-# Find and process all the SConscript files in ext. These are shared by
-# all variants in a build root.
-#
-########################################################################
-
-ext_dir = Dir('#ext').abspath
-ext_build_dirs = []
-for root, dirs, files in os.walk(ext_dir):
- if 'SConscript' in files:
- build_dir = os.path.relpath(root, ext_dir)
- ext_build_dirs.append(build_dir)
- main.SConscript(os.path.join(root, 'SConscript'),
- variant_dir=os.path.join(build_root, build_dir))
-
-
-########################################################################
-#
# Define build environments for required variants.
#
########################################################################
@@ -707,9 +690,6 @@
if not GetOption('silent'):
print('Using saved variables file(s) %s' %
', '.join(existing_vars_files))
- elif variant_dir in ext_build_dirs:
- # Things in ext are built without a variant directory.
- continue
else:
# Variant specific variables file doesn't exist.
@@ -761,6 +741,15 @@
env.Append(CCFLAGS='$CCFLAGS_EXTRA')
env.Append(LINKFLAGS='$LINKFLAGS_EXTRA')
+ ext_dir = Dir('#ext').abspath
+ variant_ext = os.path.join(variant_path, 'ext')
+ for root, dirs, files in os.walk(ext_dir):
+ if 'SConscript' in files:
+ build_dir = os.path.relpath(root, ext_dir)
+ SConscript(os.path.join(root, 'SConscript'),
+ variant_dir=os.path.join(variant_ext, build_dir),
+ exports={'main': env})
+
exports=['env', 'gem5py_env']
# The src/SConscript file sets up the build rules in 'env' according
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56750
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6f0db97c63a7f3e252e7e351aa862340978e701b
Gerrit-Change-Number: 56750
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s