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

Diff of /branches/diaplayground/SConstruct

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

revision 2358 by gross, Wed Apr 1 22:25:24 2009 UTC revision 2409 by jfenwick, Tue May 5 06:22:11 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  # Read configuration options from file scons/<hostname>_options.py  #Determine where to read options from use:
37  hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])  #1. command line
38  tmp = os.path.join("scons",hostname+"_options.py")  #2. scons/<hostname>_options.py
39  options_file = ARGUMENTS.get('options_file', tmp)  #3. name as part of a cluster
40    options_file=ARGUMENTS.get('options_file', None)
41    if not options_file:
42      hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])
43      options_file = os.path.join("scons",hostname+"_options.py")
44      #If there is no options file with that name see if there is a substitute
45      if not os.path.isfile(options_file):
46        tmp = scons_extensions.effectiveName(hostname)
47        options_file = os.path.join("scons",tmp+"_options.py")
48    
49  if not os.path.isfile(options_file):  if not os.path.isfile(options_file):
50      print "Options file not found (expected '%s')" % options_file
51    options_file = False    options_file = False
   print "Options file not found (expected '%s')" % tmp  
52  else:  else:
53    print "Options file is", options_file    print "Options file is", options_file
54    
# Line 243  if env['omp_optim'] == "" and env['omp_d Line 252  if env['omp_optim'] == "" and env['omp_d
252  try: env['ENV']['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS']  try: env['ENV']['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS']
253  except KeyError: env['ENV']['OMP_NUM_THREADS'] = 1  except KeyError: env['ENV']['OMP_NUM_THREADS'] = 1
254    
255    try: env['ENV']['ESCRIPT_NUM_THREADS'] = os.environ['ESCRIPT_NUM_THREADS']
256    except KeyError: pass
257    
258    try: env['ENV']['ESCRIPT_NUM_PROCS'] = os.environ['ESCRIPT_NUM_PROCS']
259    except KeyError: pass
260    
261    try: env['ENV']['ESCRIPT_NUM_NODES'] = os.environ['ESCRIPT_NUM_NODES']
262    except KeyError: pass
263    
264    try: env['ENV']['ESCRIPT_HOSTFILE'] = os.environ['ESCRIPT_HOSTFILE']
265    except KeyError: pass
266    
267  try: env['ENV']['PATH'] = os.environ['PATH']  try: env['ENV']['PATH'] = os.environ['PATH']
268  except KeyError: pass  except KeyError: pass
269    
# Line 554  env.Append(BUILDERS = {'RunUnitTest' : r Line 575  env.Append(BUILDERS = {'RunUnitTest' : r
575  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
576  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
577    
578    epstopdfbuilder = Builder(action = scons_extensions.eps2pdf, suffix=".pdf", src_suffix=".eps", single_source=True)
579    env.Append(BUILDERS = {'EpsToPDF' : epstopdfbuilder});
580    
581  ############ MPI (optional) ####################################  ############ MPI (optional) ####################################
582    if not env['usempi']: env['mpi_flavour']='none'
583    
584  # Create a modified environment for MPI programs (identical to env if usempi=no)  # Create a modified environment for MPI programs (identical to env if usempi=no)
585  env_mpi = clone_env(env)  env_mpi = clone_env(env)
# Line 563  env_mpi = clone_env(env) Line 588  env_mpi = clone_env(env)
588  conf = Configure(clone_env(env_mpi))  conf = Configure(clone_env(env_mpi))
589    
590  if env_mpi['usempi']:  if env_mpi['usempi']:
591    VALID_MPIs=[ "MPT", "OPENMPI", "MPICH", "OPENMPI", "INTELMPI" ]    VALID_MPIs=[ "MPT", "MPICH", "MPICH2", "OPENMPI", "INTELMPI" ]
592    if not env_mpi['mpi_flavour'] in VALID_MPIs:    if not env_mpi['mpi_flavour'] in VALID_MPIs:
593        raise ValueError,"MPI is enabled but mpi_flavour = %s is not a valid key from %s."%( env_mpi['mpi_flavour'],VALID_MPIs)        raise ValueError,"MPI is enabled but mpi_flavour = %s is not a valid key from %s."%( env_mpi['mpi_flavour'],VALID_MPIs)
594    conf.env.AppendUnique(CPPPATH = [env_mpi['mpi_path']])    conf.env.AppendUnique(CPPPATH = [env_mpi['mpi_path']])
# Line 586  else: Line 611  else:
611    
612  env['usempi'] = env_mpi['usempi']  env['usempi'] = env_mpi['usempi']
613    
614    
615  ############ ParMETIS (optional) ###############################  ############ ParMETIS (optional) ###############################
616    
617  # Start a new configure environment that reflects what we've already found  # Start a new configure environment that reflects what we've already found
# Line 779  build_all_list += ['build_paso'] Line 805  build_all_list += ['build_paso']
805  build_all_list += ['build_escript']  build_all_list += ['build_escript']
806  build_all_list += ['build_finley']  build_all_list += ['build_finley']
807  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']
808  if not IS_WINDOWS_PLATFORM: build_all_list += ['target_escript_wrapper']  #if not IS_WINDOWS_PLATFORM:    build_all_list += ['target_escript_wrapper']
809  if env['usesilo']:  build_all_list += ['target_escript2silo']  if env['usesilo']:  build_all_list += ['target_escript2silo']
810  env.Alias('build_all', build_all_list)  env.Alias('build_all', build_all_list)
811    
# Line 793  install_all_list += ['target_install_pyv Line 819  install_all_list += ['target_install_pyv
819  install_all_list += ['target_install_modellib_py']  install_all_list += ['target_install_modellib_py']
820  install_all_list += ['target_install_pycad_py']  install_all_list += ['target_install_pycad_py']
821  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']
822  if not IS_WINDOWS_PLATFORM: install_all_list += ['target_install_escript_wrapper']  #if not IS_WINDOWS_PLATFORM:    install_all_list += ['target_install_escript_wrapper']
823  if env['usesilo']:  install_all_list += ['target_install_escript2silo']  if env['usesilo']:  install_all_list += ['target_install_escript2silo']
824  install_all_list += ['remember_options']  install_all_list += ['remember_options']
825  env.Alias('install_all', install_all_list)  env.Alias('install_all', install_all_list)

Legend:
Removed from v.2358  
changed lines
  Added in v.2409

  ViewVC Help
Powered by ViewVC 1.1.26