598 |
|
|
599 |
|
defs = {} |
600 |
|
cDefs = list() |
601 |
< |
mDefs = list() |
601 |
> |
mDefsGen = list() |
602 |
> |
mDefsMake = list() |
603 |
> |
mDefsComps = list() |
604 |
|
perlConstSection = list() |
605 |
|
perlInitSection = list() |
606 |
|
addenda = {} |
607 |
|
|
608 |
< |
addenda['a:BUILD_TYPE'] = 'JSOC_SDP' |
608 |
> |
addenda['a:USER'] = 'NULL' |
609 |
> |
addenda['a:PASSWD'] = 'NULL' |
610 |
> |
addenda['p:DSDS_SUPPORT'] = '1' |
611 |
> |
addenda['a:BUILD_TYPE'] = 'JSOC_SDP' # Means a Stanford build. This will set one additional macro used by make: JSOC_SDP_BUILD. |
612 |
|
|
613 |
|
try: |
614 |
|
with open(cfgfile, 'r') as fin: |
615 |
< |
rv = parseConfig(cfgfile, keymap, addenda, defs, cDefs, mDefs, perlConstSection, perlInitSection) |
615 |
> |
rv = parseConfig(cfgfile, keymap, addenda, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection) |
616 |
|
if rv == bool(0): |
617 |
|
# Must add a parameter for the SUMS_MANAGER UID (for some reason) |
618 |
|
uidParam = {} |
619 |
|
rv = getMgrUIDLine(defs, uidParam) |
620 |
|
if rv == bool(0): |
621 |
< |
rv = parseConfig(None, keymap, uidParam, defs, cDefs, mDefs, perlConstSection, perlInitSection) |
621 |
> |
rv = parseConfig(None, keymap, uidParam, defs, cDefs, mDefsGen, NONE, perlConstSection, perlInitSection) |
622 |
|
|
623 |
+ |
# Configure the compiler-selection make variables. |
624 |
+ |
if rv == bool(0): |
625 |
+ |
rv = configureComps(defs, mDefsComps) |
626 |
|
|
619 |
– |
# So, we need to rename __MAKE__ in configsdp.txt to something else (__PROJ_MK_RULES__). |
620 |
– |
# The only code that currently reads this file is configproj.pl, so we change that logic to use __PROJ_MK_RULES__ |
621 |
– |
# for the make rules. |
627 |
|
if rv == bool(0): |
628 |
< |
rv = writeFiles(base, cfile, mfile, pfile, cDefs, mDefs, perlConstSection, perlInitSection) |
628 |
> |
rv = writeFiles(base, cfile, mfile, pfile, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection) |
629 |
|
except IOError as exc: |
630 |
|
sys.stderr.write(exc.strerror) |
631 |
|
sys.stderr.write('Unable to read configuration file ' + cfgfile + '.') |
632 |
< |
|
632 |
> |
except Exception as exc: |
633 |
> |
type, msg = exc.args |
634 |
> |
if type == 'unexpectedIccRet': |
635 |
> |
print('icc -V returned this unexpected message:\n' + msg, file=sys.stderr) |
636 |
> |
rv = bool(1) |
637 |
> |
elif type == 'unexpectedGccRet': |
638 |
> |
print('gcc -v returned this unexpected message:\n' + msg, file=sys.stderr) |
639 |
> |
rv = bool(1) |
640 |
> |
elif type == 'unexpectedIfortRet': |
641 |
> |
print('ifort -V returned this unexpected message:\n' + msg, file=sys.stderr) |
642 |
> |
rv = bool(1) |
643 |
> |
elif type == 'unexpectedGfortranRet': |
644 |
> |
print('gfortran -v returned this unexpected message:\n' + msg, file=sys.stderr) |
645 |
> |
rv = bool(1) |
646 |
> |
else: |
647 |
> |
# re-raise the exception |
648 |
> |
raise |
649 |
> |
|
650 |
|
return rv |
651 |
|
|
652 |
|
# Beginning of program |