changeset 1e2cf7b3e9d4 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=1e2cf7b3e9d4
description:
        scons: Add --without-tcmalloc build option

        Disabling tcmalloc is required for valgrind's memcheck to work properly;
        this option makes it easier to create such a build.

diffstat:

 SConstruct |  22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diffs (39 lines):

diff -r 30b40ca619ba -r 1e2cf7b3e9d4 SConstruct
--- a/SConstruct        Tue Aug 12 17:35:28 2014 -0500
+++ b/SConstruct        Mon Sep 22 14:37:23 2014 -0500
@@ -186,6 +186,9 @@
 AddLocalOption('--without-python', dest='without_python',
                action='store_true',
                help='Build without Python configuration support')
+AddLocalOption('--without-tcmalloc', dest='without_tcmalloc',
+               action='store_true',
+               help='Disable linking against tcmalloc')
 
 termcap = get_termcap(GetOption('use_colors'))
 
@@ -973,15 +976,16 @@
     conf.CheckLibWithHeader([None, 'rt'], [ 'time.h', 'signal.h' ], 'C',
                             'timer_create(CLOCK_MONOTONIC, NULL, NULL);')
 
-if conf.CheckLib('tcmalloc'):
-    main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
-elif conf.CheckLib('tcmalloc_minimal'):
-    main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
-else:
-    print termcap.Yellow + termcap.Bold + \
-          "You can get a 12% performance improvement by installing tcmalloc "\
-          "(libgoogle-perftools-dev package on Ubuntu or RedHat)." + \
-          termcap.Normal
+if not GetOption('without_tcmalloc'):
+    if conf.CheckLib('tcmalloc'):
+        main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
+    elif conf.CheckLib('tcmalloc_minimal'):
+        main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
+    else:
+        print termcap.Yellow + termcap.Bold + \
+              "You can get a 12% performance improvement by "\
+              "installing tcmalloc (libgoogle-perftools-dev package "\
+              "on Ubuntu or RedHat)." + termcap.Normal
 
 if not have_posix_clock:
     print "Can't find library for POSIX clocks."
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to