11 from __future__
import print_function
13 from BaseMTTUtility
import *
22 BaseMTTUtility.__init__(self)
30 lines = testDef.printOptions(self.
options)
41 if self.
check_c_if(testDef,
"defined(__INTEL_COMPILER) || defined(__ICC)",
"icc"):
46 compiler =
"pathscale"
64 elif self.
check_c_if(testDef,
"defined(__DECC) || defined(VAXC) || defined(__VAXC)",
"cc"):
67 elif self.
check_c_if(testDef,
"defined(__osf__) || defined(__LANGUAGE_C__)",
"cc"):
82 elif self.
check_c_if(testDef,
"defined(__DMC__) || defined(__SC__) || defined(__ZTC__)",
"cc"):
83 compiler =
"digital mars"
86 elif self.
check_c_if(testDef,
"defined(__HP_cc) || defined(__HP_aCC)",
"cc"):
90 elif self.
check_c_if(testDef,
"defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)",
"cc"):
94 elif self.
check_c_if(testDef,
"defined(_AIX) && defined(__GNUC__)",
"cc"):
107 compiler =
"metaware high"
111 compiler =
"metrowerks"
114 elif self.
check_c_if(testDef,
"defined(sgi) || defined(__sgi)",
"cc"):
118 elif self.
check_c_if(testDef,
"defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)",
"cpp"):
124 elif self.
check_c_if(testDef,
"defined(_MSC_VER) || defined(__MSC_VER)",
"cc"):
125 compiler =
"microsoft"
129 compiler =
"norcroft"
140 elif self.
check_c_if(testDef,
"defined(SASC) || defined(__SASC) || defined(__SASC__)",
"cc"):
144 elif self.
check_c_if(testDef,
"defined(__SUNPRO_C) || defined(__SUNPRO_CC)",
"cc"):
162 status, vsn = self.
check_version(
"cpp",
"--version", testDef)
170 log[
'status'] = status
171 log[
'compiler'] = compiler
172 log[
'version'] = vsn[0][:64]
177 fh = open(
"spastic.c",
'w')
183 mycmdargs = [compiler,
"-c",
"spastic.c"]
184 status, stdout, stderr, _ = testDef.execmd.execute(
None, mycmdargs, testDef)
187 os.remove(
"spastic.c")
188 if os.path.exists(
"spastic.o"):
189 os.remove(
"spastic.o")
197 c_code = [
"/*",
"* This program is automatically generated by compiler.py",
198 "* of MPI Testing Tool (MTT). Any changes you make here may",
200 "* Copyrights and licenses of this file are the same as for the MTT.",
201 "*/",
"#ifndef " + macro,
"#error",
"choke me",
"#endif"]
207 c_code = [
"/*",
"* This program is automatically generated by compiler.py",
208 "* of MPI Testing Tool (MTT). Any changes you make here may",
210 "* Copyrights and licenses of this file are the same as for the MTT.",
211 "*/",
"#if !( " + macro +
" )",
"#error",
"choke me",
"#endif"]
217 mycmdargs = [compiler, version]
218 status, stdout, stderr, _ = testDef.execmd.execute(
None, mycmdargs, testDef)
219 return status, stdout