/[escript]/branches/4.0fordebian/site_scons/site_init.py
ViewVC logotype

Diff of /branches/4.0fordebian/site_scons/site_init.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5229 by caltinay, Mon Oct 27 23:39:15 2014 UTC revision 5266 by caltinay, Mon Nov 17 06:45:01 2014 UTC
# Line 89  def write_buildvars(env): Line 89  def write_buildvars(env):
89          buildvars.write("%s=%s\n"%(k,v))          buildvars.write("%s=%s\n"%(k,v))
90      buildvars.close()      buildvars.close()
91    
92    def write_launcher(env):
93        reps={'%n':'${ESCRIPT_NUM_NODES}', '%p':'${ESCRIPT_NUM_PROCS}',
94              '%N':'${TOTPROC}', '%t':'${ESCRIPT_NUM_THREADS}', '%f':'${HOSTFILE}',
95              '%h':'${HOSTLIST}', '%e':'${EXPORT_ENV}', '%b':'${EXEC_CMD}'}
96        pre=env['prelaunch']
97        cmd=env['launcher']
98        post=env['postlaunch']
99        # %b should be present in launcher at least
100        if not '%b' in cmd:
101            raise RuntimeError('option "launcher" must contain %b!')
102    
103        for k, v in reps.iteritems():
104            pre = pre.replace(k, v)
105            cmd = cmd.replace(k, v)
106            post = post.replace(k, v)
107        try:
108            launchscript = os.path.join(env['bininstall'], 'run-escript')
109            launcher=open(launchscript, 'w')
110            for line in open('run-escript.in','r').readlines():
111                launcher.write(line.replace('@@PRELAUNCH', pre).replace('@@LAUNCH', cmd).replace('@@POSTLAUNCH', post))
112            launcher.close()
113            env.Execute(Chmod(launchscript, 0o755))
114        except IOError:
115            env['warnings'].append("Error attempting to write launcher script.")
116    
117  def generateTestScripts(env, TestGroups):  def generateTestScripts(env, TestGroups):
118      try:      try:
119          utest=open('utest.sh','w')          utest=open('utest.sh','w')
# Line 115  def generateTestScripts(env, TestGroups) Line 140  def generateTestScripts(env, TestGroups)
140      env.Clean('target_init', 'utest.sh')      env.Clean('target_init', 'utest.sh')
141      env.Clean('target_init', 'itest.sh')      env.Clean('target_init', 'itest.sh')
142    
     # Make sure that the escript wrapper is in place  
     if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):  
         print("Copying escript wrapper.")  
         env.Execute(Copy(os.path.join(env['bininstall'],'run-escript'), 'bin/run-escript'))  
   
143  # Code to build .pyc from .py  # Code to build .pyc from .py
144  def build_py(target, source, env):  def build_py(target, source, env):
145      try:      try:

Legend:
Removed from v.5229  
changed lines
  Added in v.5266

  ViewVC Help
Powered by ViewVC 1.1.26