BUILD: GCC 4.4.1/2 have a bug in their auto-vectorizer that we trip on
[gem5.git] / SConstruct
index 55cf71876a79909cacf248b81b6e383d45e7d15e..850c122ca5337260635b1a92ab5b2b15b222f927 100644 (file)
@@ -314,7 +314,6 @@ global_sticky_vars.AddVariables(
     ('BATCH_CMD', 'Batch pool submission command name', 'qdo'),
     ('EXTRAS', 'Add Extra directories to the compilation', '',
      PathListAllExist, PathListMakeAbsolute),
-    BoolVariable('RUBY', 'Build with Ruby', False),
     )
 
 # base help text
@@ -362,6 +361,14 @@ if main['GCC']:
     main.Append(CCFLAGS='-fno-strict-aliasing')
     main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
     main.Append(CXXFLAGS='-Wno-deprecated')
+    # Read the GCC version to check for versions with bugs
+    # Note CCVERSION doesn't work here because it is run with the CC
+    # before we override it from the command line
+    gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
+    if not compareVersions(gcc_version, '4.4.1') or \
+       not compareVersions(gcc_version, '4.4.2'):
+        print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
+        main.Append(CCFLAGS='-fno-tree-vectorize')
 elif main['ICC']:
     pass #Fix me... add warning flags once we clean up icc warnings
 elif main['SUNCC']:
@@ -516,7 +523,8 @@ from distutils import sysconfig
 
 py_getvar = sysconfig.get_config_var
 
-py_version = 'python' + py_getvar('VERSION')
+py_debug = getattr(sys, 'pydebug', False)
+py_version = 'python' + py_getvar('VERSION') + (py_debug and "_d" or "")
 
 py_general_include = sysconfig.get_python_inc()
 py_platform_include = sysconfig.get_python_inc(plat_specific=True)
@@ -688,6 +696,7 @@ sticky_vars.AddVariables(
     BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
     BoolVariable('USE_CHECKER', 'Use checker for detailed CPU models', False),
     BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
+    BoolVariable('RUBY', 'Build with Ruby', False),
     )
 
 nonsticky_vars.AddVariables(