Exemplo n.º 1
0
def xml2db2(xmlBase, verbose=0):
    script = bgutils.installbase() + 'usr/opt/bluegene/bin/setup/xml2db2.pl'
    rc = commands.getstatusoutput("perl " + script + " " + xmlBase + ".xml")
    sysId = '-1'
    syspat = re.compile(r'^SystemId:\s+(\d+)')
    successpat = re.compile(r'SUCCESS:')
    errorpat = re.compile(r'ERROR:')
    xmlLines = rc[1].split('\n')
    for xmlLine in xmlLines:
        if verbose:
            print("xml2db2:",xmlLine)
        ma = re.match(syspat, xmlLine)
        mb = re.match(successpat, xmlLine)
        mc = re.match(errorpat, xmlLine)
        if ma != None:
            sysId = ma.expand(r'\1')
        elif mb != None:
            if verbose:
                print(xmlLine)
        elif mc != None:
            raise RuntimeError('xml2db2: Error loading xml into db2. Please check the XML.\n' + xmlLine)
                
    if rc[0] != 0:
        raise RuntimeError('xml2db2 error')
    return sysId
Exemplo n.º 2
0
def cpp2exe(dest, buildmode, buildopts, verbose=0):
    exeFile = dest + '.smp.aix.exe'
    os.system('rm -f ' + exeFile)
    script = str(bgutils.installbase()) + \
             'usr/opt/bluegene/bin/setup/compile_msd.sh '
    cmd = 'time ' + script + dest + ' ' + buildmode + ' ' + buildopts
    rc = commands.getstatusoutput(cmd)
    if rc[0] != 0:
        raise RuntimeError('cpp2exe non-zero return code')
    if os.access(exeFile, os.R_OK) == 0:
        raise RuntimeError('cpp2exe did not generate the exe')
    if verbose:
        print(exeFile, "successfully created by cpp2exe")
Exemplo n.º 3
0
  buildmode = sys.argv[4]

buildopts = "Default"
if len(sys.argv) > 5:
  buildopts = sys.argv[5]

if os.access(xmlname,os.R_OK) == 0:
   print('cannot read ' + xmlname)
   sys.exit(-1)
if os.access(rtpname,os.R_OK) == 0:
   print('cannot read ' + rtpname)
   sys.exit(-1)

#SB = os.environ['SANDBOXBASE']
#BG = SB + '/inst.images/rios_aix_4/shipdata/usr/opt/bluegene'
BG = bgutils.installbase() + 'usr/opt/bluegene'
BG_SETUP = BG + '/bin/setup'
BG_UTIL = BG + '/bin/util'

# Make the generated files readable by others and the web server
os.umask(0o22)


#########################################################
#                     xml2db2
#########################################################
xmlcom = "perl " + BG_SETUP + "/xml2db2.pl " + xmlname 
print(xmlcom)

wcf = os.popen(xmlcom)
XMLLines = wcf.readlines()
Exemplo n.º 4
0
#!/usr/bin/env python
from __future__ import print_function
import glob
import sys
import bgutils

if len(sys.argv) < 2:
    print(sys.argv[0], " optSetting")
    sys.exit(-1)

optSetting = sys.argv[1]
print("installbase", bgutils.installbase())
#print "ffinfo", bgutils.ffinfo()

info = bgutils.PlatformInfo("mdsetup")
#print info.choices()

print("Implementation Parameters\n")
info.implParams(info.choices()[optSetting][0])

print("\n\nPlatform Parameters\n")
info.platformParams(info.choices()[optSetting][1])
Exemplo n.º 5
0
import re
import os.path
import pwd

if len(sys.argv) < 3:
    print(
        sys.argv[0],
        "sourceFile buildOpts <profileBuild = 0> <targetPlatform = 0 (rs/6000 aix)> <install_image_path=$PACKAGEBASE/shipdata/usr/opt/bluegene>  <compiler=xlC_r> <executable_extension=smp.aix.exe>"
    )
    sys.exit(-1)

sourceFile = sys.argv[1]
buildOpts = sys.argv[2]
profileBuild = 0
targetPlatform = 0
installImagePath = bgutils.installbase() + 'usr/opt/bluegene'

compilerFamily = "xlC_r"
exeExtension = "smp.aix.exe"
objExtension = "o"

print("buildOpts:\n", buildOpts)

if (len(sys.argv) > 3):
    profileBuild = int(sys.argv[3])
if (len(sys.argv) > 4):
    targetPlatform = sys.argv[4]
if (len(sys.argv) > 5):
    installImagePath = sys.argv[5]
if (len(sys.argv) > 6):
    compilerFamily = sys.argv[6]
Exemplo n.º 6
0
 def __init__(self):
     self.installRoot = bgutils.installbase() + 'usr/opt/bluegene'
Exemplo n.º 7
0
#!/usr/bin/env python
# utility to return path to root of bluematter install image based on
# environment variable settings

from __future__ import print_function
import bgutils

print(bgutils.installbase())
Exemplo n.º 8
0
DoSummary = 0
DoDir = 0
DoDirCmd = ''
UserArgs = ''
DoRun = 1
InternalVars["DoRun"] = 1
DataDirSet = 0
BuildLocal = 1
TestOnly = 0
NoLog = 0

localdir = CleanDirName(os.getenv('PWD'))
MultiRunDirectory = localdir
DataDirectory = localdir

BG_INSTALL_BASE = CleanDirName(bgutils.installbase())
BG_MDTEST_DIR   = BG_INSTALL_BASE+"/usr/opt/bluegene/mdtest"

InternalVars["BG_INSTALL_BASE"] = BG_INSTALL_BASE
InternalVars["BG_MDTEST_DIR"]   = BG_MDTEST_DIR

# Make the generated files readable by others and the web server
os.umask(0o22)

ListOnly = 0
argnum = 1
nargs = len(sys.argv)
while argnum < nargs:
  if sys.argv[argnum] == '-listonly':
    ListOnly = 1
  elif sys.argv[argnum] == '-summarize':