aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xlinden/indra/develop.py29
1 files changed, 23 insertions, 6 deletions
diff --git a/linden/indra/develop.py b/linden/indra/develop.py
index af7e42f..a705719 100755
--- a/linden/indra/develop.py
+++ b/linden/indra/develop.py
@@ -367,23 +367,31 @@ class LinuxSetup(UnixSetup):
367 cpus += m and int(m.group(1)) or 1 367 cpus += m and int(m.group(1)) or 1
368 return hosts, cpus 368 return hosts, cpus
369 369
370 def mk_distcc_hosts(): 370 def mk_distcc_hosts(basename, range, num_cpus):
371 '''Generate a list of LL-internal machines to build on.''' 371 '''Generate a list of LL-internal machines to build on.'''
372 loc_entry, cpus = localhost() 372 loc_entry, cpus = localhost()
373 hosts = [loc_entry] 373 hosts = [loc_entry]
374 dead = [] 374 dead = []
375 stations = [s for s in xrange(36) if s not in dead] 375 stations = [s for s in xrange(range) if s not in dead]
376 random.shuffle(stations) 376 random.shuffle(stations)
377 hosts += ['station%d.lindenlab.com/2,lzo' % s for s in stations] 377 hosts += ['station%d.lindenlab.com/2,lzo' % s for s in stations]
378 hosts += ['%s%d.lindenlab.com/%d,lzo' % (basename, s, num_cpus) for s in stations]
378 cpus += 2 * len(stations) 379 cpus += 2 * len(stations)
379 return ' '.join(hosts), cpus 380 return ' '.join(hosts), cpus
380 381
381 if job_count is None: 382 if job_count is None:
382 hosts, job_count = count_distcc_hosts() 383 hosts, job_count = count_distcc_hosts()
383 if hosts == 1 and socket.gethostname().startswith('station'): 384 if hosts == 1:
384 hosts, job_count = mk_distcc_hosts() 385 hostname = socket.gethostname()
385 os.putenv('DISTCC_HOSTS', hosts) 386 if hostname.startswith('station'):
386 opts.extend(['-j', str(2)]) 387 hosts, job_count = mk_distcc_hosts('station', 36, 2)
388 os.environ['DISTCC_HOSTS'] = hosts
389 if hostname.startswith('eniac'):
390 hosts, job_count = mk_distcc_hosts('eniac', 71, 2)
391 os.environ['DISTCC_HOSTS'] = hosts
392 opts.extend(['-j', str(job_count)])
393
394 '''opts.extend(['-j', str(2)])'''
387 395
388 if targets: 396 if targets:
389 targets = ' '.join(targets) 397 targets = ' '.join(targets)
@@ -729,6 +737,15 @@ Examples:
729''' 737'''
730 738
731def main(arguments): 739def main(arguments):
740 if os.getenv('DISTCC_DIR') is None:
741 distcc_dir = os.path.join(getcwd(), '.distcc')
742 if not os.path.exists(distcc_dir):
743 os.mkdir(distcc_dir)
744 print "setting DISTCC_DIR to %s" % distcc_dir
745 os.environ['DISTCC_DIR'] = distcc_dir
746 else:
747 print "DISTCC_DIR is set to %s" % os.getenv('DISTCC_DIR')
748
732 setup = setup_platform[sys.platform]() 749 setup = setup_platform[sys.platform]()
733 try: 750 try:
734 opts, args = getopt.getopt( 751 opts, args = getopt.getopt(