/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2430 by jfenwick, Wed May 20 03:20:57 2009 UTC revision 2603 by jfenwick, Wed Aug 12 00:44:35 2009 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2008 by University of Queensland  # Copyright (c) 2003-2009 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
6  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
7  #  #
# 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
# Line 356  except: Line 368  except:
368  if global_revision == "": global_revision="-2"  if global_revision == "": global_revision="-2"
369  env.Append(CPPDEFINES = ["SVN_VERSION="+global_revision])  env.Append(CPPDEFINES = ["SVN_VERSION="+global_revision])
370    
371  ############ numarray (required) ###############################  ############ numpy (required) ###############################
372    
373  try:  try:
374    from numarray import identity    from numpy import identity
375  except ImportError:  except ImportError:
376    print "Cannot import numarray, you need to set your PYTHONPATH"    print "Cannot import numpy, you need to set your PYTHONPATH"
377    sys.exit(1)    sys.exit(1)
378    
379  ############ C compiler (required) #############################  ############ C compiler (required) #############################
# Line 536  if env['useumfpack']: Line 548  if env['useumfpack']:
548    conf.env.PrependENVPath('PYTHONPATH', prefix)    conf.env.PrependENVPath('PYTHONPATH', prefix)
549    conf.env.PrependENVPath(LD_LIBRARY_PATH_KEY, env['libinstall'])    conf.env.PrependENVPath(LD_LIBRARY_PATH_KEY, env['libinstall'])
550    
 if env['useumfpack'] and not conf.CheckFunc('umfpack_di_symbolic'): env['useumfpack'] = 0  
551  if env['useumfpack'] and not conf.CheckCHeader('umfpack.h'): env['useumfpack'] = 0  if env['useumfpack'] and not conf.CheckCHeader('umfpack.h'): env['useumfpack'] = 0
552    if env['useumfpack'] and not conf.CheckFunc('umfpack_di_symbolic'): env['useumfpack'] = 0
553  # if env['useumfpack'] and not conf.CheckFunc('daxpy'): env['useumfpack'] = 0 # this does not work on shake73?  # if env['useumfpack'] and not conf.CheckFunc('daxpy'): env['useumfpack'] = 0 # this does not work on shake73?
554    
555  # Add UMFPACK to environment env if it was found  # Add UMFPACK to environment env if it was found
# Line 669  if ((fatalwarning != "") and (env['usewa Line 681  if ((fatalwarning != "") and (env['usewa
681  print ""  print ""
682  print "Summary of configuration (see ./config.log for information)"  print "Summary of configuration (see ./config.log for information)"
683  print " Using python libraries"  print " Using python libraries"
684  print " Using numarray"  print " Using numpy"
685  print " Using boost"  print " Using boost"
686  if env['usenetcdf']: print "    Using NetCDF"  if env['usenetcdf']: print "    Using NetCDF"
687  else: print "   Not using NetCDF"  else: print "   Not using NetCDF"
# Line 853  env.Alias('build_full',['install_all','b Line 865  env.Alias('build_full',['install_all','b
865    
866  ############ Targets to build the documentation ################  ############ Targets to build the documentation ################
867    
868    env.Alias('api_epydoc','install_all')
869    
870  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html','install_pdf'])  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html','install_pdf'])
871    
872  if not IS_WINDOWS_PLATFORM:  if not IS_WINDOWS_PLATFORM:

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

  ViewVC Help
Powered by ViewVC 1.1.26