/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2338 by jfenwick, Fri Mar 27 05:01:49 2009 UTC revision 2388 by jfenwick, Wed Apr 15 06:21:25 2009 UTC
# Line 35  prefix = ARGUMENTS.get('prefix', Dir('#. Line 35  prefix = ARGUMENTS.get('prefix', Dir('#.
35    
36  # Read configuration options from file scons/<hostname>_options.py  # Read configuration options from file scons/<hostname>_options.py
37  hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])  hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])
38  tmp = os.path.join("scons",hostname+"_options.py")  ehostname = scons_extensions.effectiveName(hostname)
39    tmp = os.path.join("scons",ehostname+"_options.py")
40  options_file = ARGUMENTS.get('options_file', tmp)  options_file = ARGUMENTS.get('options_file', tmp)
41  if not os.path.isfile(options_file):  if not os.path.isfile(options_file):
42    options_file = False    options_file = False
# Line 243  if env['omp_optim'] == "" and env['omp_d Line 244  if env['omp_optim'] == "" and env['omp_d
244  try: env['ENV']['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS']  try: env['ENV']['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS']
245  except KeyError: env['ENV']['OMP_NUM_THREADS'] = 1  except KeyError: env['ENV']['OMP_NUM_THREADS'] = 1
246    
247    try: env['ENV']['ESCRIPT_NUM_THREADS'] = os.environ['ESCRIPT_NUM_THREADS']
248    except KeyError: pass
249    
250    try: env['ENV']['ESCRIPT_NUM_PROCS'] = os.environ['ESCRIPT_NUM_PROCS']
251    except KeyError: pass
252    
253    try: env['ENV']['ESCRIPT_NUM_NODES'] = os.environ['ESCRIPT_NUM_NODES']
254    except KeyError: pass
255    
256    try: env['ENV']['ESCRIPT_HOSTFILE'] = os.environ['ESCRIPT_HOSTFILE']
257    except KeyError: pass
258    
259  try: env['ENV']['PATH'] = os.environ['PATH']  try: env['ENV']['PATH'] = os.environ['PATH']
260  except KeyError: pass  except KeyError: pass
261    
# Line 467  if env['usemkl']: Line 480  if env['usemkl']:
480    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])
481    
482  if env['usemkl'] and not conf.CheckCHeader('mkl_solver.h'): env['usemkl'] = 0  if env['usemkl'] and not conf.CheckCHeader('mkl_solver.h'): env['usemkl'] = 0
483  if env['usemkl'] and not conf.CheckFunc('pardiso_'): env['usemkl'] = 0  if env['usemkl'] and not conf.CheckFunc('pardiso'): env['usemkl'] = 0
484    
485  # Add MKL to environment env if it was found  # Add MKL to environment env if it was found
486  if env['usemkl']:  if env['usemkl']:
# Line 543  else: Line 556  else:
556  env.Append(CCFLAGS      = env['cc_flags'])  env.Append(CCFLAGS      = env['cc_flags'])
557  env.Append(LIBS         = [env['omp_libs']])  env.Append(LIBS         = [env['omp_libs']])
558    
   
559  ############ Add some custom builders ##########################  ############ Add some custom builders ##########################
560    
561  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
# Line 555  env.Append(BUILDERS = {'RunUnitTest' : r Line 567  env.Append(BUILDERS = {'RunUnitTest' : r
567  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)
568  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
569    
570    epstopdfbuilder = Builder(action = scons_extensions.eps2pdf, suffix=".pdf", src_suffix=".eps", single_source=True)
571    env.Append(BUILDERS = {'EpsToPDF' : epstopdfbuilder});
572    
573  ############ MPI (optional) ####################################  ############ MPI (optional) ####################################
574    if not env['usempi']: env['mpi_flavour']='none'
575    
576  # 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)
577  env_mpi = clone_env(env)  env_mpi = clone_env(env)
# Line 564  env_mpi = clone_env(env) Line 580  env_mpi = clone_env(env)
580  conf = Configure(clone_env(env_mpi))  conf = Configure(clone_env(env_mpi))
581    
582  if env_mpi['usempi']:  if env_mpi['usempi']:
583      VALID_MPIs=[ "MPT", "MPICH", "MPICH2", "OPENMPI", "INTELMPI" ]
584      if not env_mpi['mpi_flavour'] in VALID_MPIs:
585          raise ValueError,"MPI is enabled but mpi_flavour = %s is not a valid key from %s."%( env_mpi['mpi_flavour'],VALID_MPIs)
586    conf.env.AppendUnique(CPPPATH = [env_mpi['mpi_path']])    conf.env.AppendUnique(CPPPATH = [env_mpi['mpi_path']])
587    conf.env.AppendUnique(LIBPATH = [env_mpi['mpi_lib_path']])    conf.env.AppendUnique(LIBPATH = [env_mpi['mpi_lib_path']])
588    conf.env.AppendUnique(LIBS    = [env_mpi['mpi_libs']])    conf.env.AppendUnique(LIBS    = [env_mpi['mpi_libs']])
# Line 584  else: Line 603  else:
603    
604  env['usempi'] = env_mpi['usempi']  env['usempi'] = env_mpi['usempi']
605    
606    
607  ############ ParMETIS (optional) ###############################  ############ ParMETIS (optional) ###############################
608    
609  # 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 639  if env['usesilo']: print " Using Silo" Line 659  if env['usesilo']: print " Using Silo"
659  else: print "   Not using Silo"  else: print "   Not using Silo"
660  if env['useopenmp']: print "    Using OpenMP"  if env['useopenmp']: print "    Using OpenMP"
661  else: print "   Not using OpenMP"  else: print "   Not using OpenMP"
662  if env['usempi']: print "   Using MPI"  if env['usempi']: print "   Using MPI (flavour = %s)"%env['mpi_flavour']
663  else: print "   Not using MPI"  else: print "   Not using MPI"
664  if env['useparmetis']: print "  Using ParMETIS"  if env['useparmetis']: print "  Using ParMETIS"
665  else: print "   Not using ParMETIS (requires MPI)"  else: print "   Not using ParMETIS (requires MPI)"

Legend:
Removed from v.2338  
changed lines
  Added in v.2388

  ViewVC Help
Powered by ViewVC 1.1.26