version 1.18, 2014/05/07 18:45:36
|
version 1.22, 2014/09/11 16:54:15
|
Line 90 class DRMSParams: |
|
Line 90 class DRMSParams: |
|
| |
PY_FXNS_B = """ def get(self, name): | PY_FXNS_B = """ def get(self, name): |
if name in self.params: | if name in self.params: |
return self.parms[name] |
return self.params[name] |
else: | else: |
return None | return None |
""" | """ |
| |
|
PY_FXNS_C = """ def getBool(self, name): |
|
if name in self.params: |
|
return bool(self.params[name] == '1') |
|
else: |
|
return None |
|
""" |
|
|
|
|
SUMRM_COMMENT = """# This is the configuration file for the sum_rm program. It was auto-generated by the DRMS master configure script. | SUMRM_COMMENT = """# This is the configuration file for the sum_rm program. It was auto-generated by the DRMS master configure script. |
# It controls the behavior of the sum_rm program, and is loaded each time sum_rm runs. To change the | # It controls the behavior of the sum_rm program, and is loaded each time sum_rm runs. To change the |
# parameter values in this configuration file, modify config.local, then re-run configure. This configuration | # parameter values in this configuration file, modify config.local, then re-run configure. This configuration |
Line 545 def parseConfig(fin, keymap, addenda, de |
|
Line 553 def parseConfig(fin, keymap, addenda, de |
|
# Must parse xml and use the project-specific information to populate the Rules.mk and target.mk files. | # Must parse xml and use the project-specific information to populate the Rules.mk and target.mk files. |
# Collect all xml lines for now, then process after file-read loop. | # Collect all xml lines for now, then process after file-read loop. |
if xml is None: | if xml is None: |
xml = line |
# The first time through this section, line is the config.local div, __PROJ__. Discard that. |
|
xml = '' |
|
continue |
else: | else: |
xml += line | xml += line |
else: | else: |
Line 679 def configureComps(defs, mDefs): |
|
Line 689 def configureComps(defs, mDefs): |
|
| |
# Try gcc. | # Try gcc. |
if not hasicc: | if not hasicc: |
|
rv = bool(0) |
cmd = 'gcc -v 2>&1' | cmd = 'gcc -v 2>&1' |
try: | try: |
ret = check_output(cmd, shell=True) | ret = check_output(cmd, shell=True) |
Line 687 def configureComps(defs, mDefs): |
|
Line 698 def configureComps(defs, mDefs): |
|
print('Command ' + "'" + cmd + "'" + ' ran improperly.') | print('Command ' + "'" + cmd + "'" + ' ran improperly.') |
rv = bool(1) | rv = bool(1) |
| |
if rv == bool(0): |
if not rv: |
regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL) | regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL) |
matchobj = regexp.match(ret) | matchobj = regexp.match(ret) |
if matchobj is None: | if matchobj is None: |
Line 699 def configureComps(defs, mDefs): |
|
Line 710 def configureComps(defs, mDefs): |
|
hasgcc = bool(1) | hasgcc = bool(1) |
| |
# Try ifort. | # Try ifort. |
|
rv = bool(0) |
cmd = 'ifort --version 2>&1' | cmd = 'ifort --version 2>&1' |
try: | try: |
ret = check_output(cmd, shell=True) | ret = check_output(cmd, shell=True) |
Line 720 def configureComps(defs, mDefs): |
|
Line 732 def configureComps(defs, mDefs): |
|
| |
# Try gfortran | # Try gfortran |
if not hasifort: | if not hasifort: |
|
rv = bool(0) |
cmd = 'gfortran -v 2>&1' | cmd = 'gfortran -v 2>&1' |
try: | try: |
ret = check_output(cmd, shell=True) | ret = check_output(cmd, shell=True) |
Line 728 def configureComps(defs, mDefs): |
|
Line 741 def configureComps(defs, mDefs): |
|
print('Command ' + "'" + cmd + "'" + ' ran improperly.') | print('Command ' + "'" + cmd + "'" + ' ran improperly.') |
rv = bool(1) | rv = bool(1) |
| |
if rv == bool(0): |
if not rv: |
regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL) | regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL) |
matchobj = regexp.match(ret) | matchobj = regexp.match(ret) |
if matchobj is None: | if matchobj is None: |
Line 740 def configureComps(defs, mDefs): |
|
Line 753 def configureComps(defs, mDefs): |
|
hasgfort = bool(1) | hasgfort = bool(1) |
| |
# Append the compiler make variables to the make file | # Append the compiler make variables to the make file |
|
rv = bool(0) |
|
|
if not hasicc and not hasgcc: | if not hasicc and not hasgcc: |
print('Fatal error: Acceptable C compiler not found! You will be unable to build the DRMS library.', file=sys.stderr) | print('Fatal error: Acceptable C compiler not found! You will be unable to build the DRMS library.', file=sys.stderr) |
rv = bool(1) | rv = bool(1) |
Line 807 def writeParamsFiles(base, cfile, mfile, |
|
Line 822 def writeParamsFiles(base, cfile, mfile, |
|
print(PY_FXNS_A, file=pyout, end='') | print(PY_FXNS_A, file=pyout, end='') |
print(''.join(pyInitSection), file=pyout) | print(''.join(pyInitSection), file=pyout) |
print(PY_FXNS_B, file=pyout) | print(PY_FXNS_B, file=pyout) |
|
print(PY_FXNS_C, file=pyout) |
| |
except IOError as exc: | except IOError as exc: |
type, value, traceback = sys.exc_info() | type, value, traceback = sys.exc_info() |