/[escript]/branches/dirac/SConstruct
ViewVC logotype

Diff of /branches/dirac/SConstruct

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

revision 2602 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2603 by jfenwick, Wed Aug 12 00:44:35 2009 UTC
# Line 33  IS_WINDOWS_PLATFORM = (os.name== "nt") Line 33  IS_WINDOWS_PLATFORM = (os.name== "nt")
33    
34  prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)  prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)
35    
36    #Holds names of variables from the calling environment which need to be passed
37    #to tools
38    env_export=[]
39    
40  #Determine where to read options from use:  #Determine where to read options from use:
41  #1. command line  #1. command line
42  #2. scons/<hostname>_options.py  #2. scons/<hostname>_options.py
43  #3. name as part of a cluster  #3. name as part of a cluster
44  options_file=ARGUMENTS.get('options_file', None)  options_file=ARGUMENTS.get('options_file', None)
45    effective_hostname=socket.gethostname().split('.')[0]
46  if not options_file:  if not options_file:
47    hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])    mangledhostname = re.sub("[^0-9a-zA-Z]", "_", effective_hostname)
48    options_file = os.path.join("scons",hostname+"_options.py")    options_file = os.path.join("scons",mangledhostname+"_options.py")
49    #If there is no options file with that name see if there is a substitute    #If there is no options file with that name see if there is a substitute
50    if not os.path.isfile(options_file):    if not os.path.isfile(options_file):
51      tmp = scons_extensions.effectiveName(hostname)      effective_hostname = scons_extensions.effectiveName(effective_hostname)
52      options_file = os.path.join("scons",tmp+"_options.py")      mangledhostname = re.sub("[^0-9a-zA-Z]", "_", effective_hostname)
53        options_file = os.path.join("scons",mangledhostname+"_options.py")
54    
55  if not os.path.isfile(options_file):  if not os.path.isfile(options_file):
56    print "Options file not found (expected '%s')" % options_file    print "Options file not found (expected '%s')" % options_file
# Line 157  adder( Line 163  adder(
163  # finer control over library building, intel aggressive global optimisation  # finer control over library building, intel aggressive global optimisation
164  # works with dynamic libraries on windows.  # works with dynamic libraries on windows.
165    ('share_esysUtils', 'control static or dynamic esysUtils lib', False),    ('share_esysUtils', 'control static or dynamic esysUtils lib', False),
166    ('share_paso', 'control static or dynamic paso lib', False)    ('share_paso', 'control static or dynamic paso lib', False),
167      ('env_export','Environment variables to be passed to children',[])
168  )  )
169    
170  ############ Specify which compilers to use ####################  ############ Specify which compilers to use ####################
# Line 170  if IS_WINDOWS_PLATFORM: Line 177  if IS_WINDOWS_PLATFORM:
177        env = Environment(tools = ['default'] + env['tools_names'],        env = Environment(tools = ['default'] + env['tools_names'],
178                          options = opts)                          options = opts)
179  else:  else:
180     if socket.gethostname().split('.')[0] == 'service0':     if effective_hostname == 'service0':
181        env = Environment(tools = ['default', 'intelc'], options = opts)        env = Environment(tools = ['default', 'intelc'], options = opts)
182     elif os.uname()[4]=='ia64':     elif os.uname()[4]=='ia64':
183        env = Environment(tools = ['default', 'intelc'], options = opts)        env = Environment(tools = ['default', 'intelc'], options = opts)
# Line 180  else: Line 187  else:
187        env = Environment(tools = ['default'], options = opts)        env = Environment(tools = ['default'], options = opts)
188  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
189    
190    ########## Copy required environment vars ######################
191    
192    for i in env['env_export']:
193       env.Append(ENV = {i:os.environ[i]})
194    
195  ############ Fill in compiler options if not set above #########  ############ Fill in compiler options if not set above #########
196    
197  # Backwards compatibility: allow dodebug=yes and useMPI=yes  # Backwards compatibility: allow dodebug=yes and useMPI=yes

Legend:
Removed from v.2602  
changed lines
  Added in v.2603

  ViewVC Help
Powered by ViewVC 1.1.26