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

Diff of /branches/escript3047_with_pastix2995/SConstruct

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

revision 2132 by jfenwick, Fri Dec 5 00:18:06 2008 UTC revision 2254 by jfenwick, Sun Feb 8 23:40:22 2009 UTC
# Line 119  opts.AddOptions( Line 119  opts.AddOptions(
119    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),
120    ('umf_lib_path', 'Path to UMFPACK libs', usr_lib),    ('umf_lib_path', 'Path to UMFPACK libs', usr_lib),
121    ('umf_libs', 'UMFPACK libraries to link with', ['umfpack']),    ('umf_libs', 'UMFPACK libraries to link with', ['umfpack']),
122    # Silo
123      BoolOption('usesilo', 'switch on/off the usage of Silo', 'yes'),
124      ('silo_path', 'Path to Silo includes', '/usr/include'),
125      ('silo_lib_path', 'Path to Silo libs', usr_lib),
126      ('silo_libs', 'Silo libraries to link with', ['siloh5', 'hdf5']),
127  # AMD (used by UMFPACK)  # AMD (used by UMFPACK)
128    ('amd_path', 'Path to AMD includes', '/usr/include/suitesparse'),    ('amd_path', 'Path to AMD includes', '/usr/include/suitesparse'),
129    ('amd_lib_path', 'Path to AMD libs', usr_lib),    ('amd_lib_path', 'Path to AMD libs', usr_lib),
# Line 180  if env["CC"] == "icc": Line 185  if env["CC"] == "icc":
185  elif env["CC"] == "gcc":  elif env["CC"] == "gcc":
186    # GNU C on any system    # GNU C on any system
187    cc_flags      = "-pedantic -Wall -fPIC -ansi -ffast-math -Wno-unknown-pragmas -DBLOCKTIMER  -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing"    cc_flags      = "-pedantic -Wall -fPIC -ansi -ffast-math -Wno-unknown-pragmas -DBLOCKTIMER  -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing"
 #The strict aliasing error occurs for some versions of boost  
188  #the long long warning occurs on the Mac  #the long long warning occurs on the Mac
189    cc_optim      = "-O3"    cc_optim      = "-O3"
190    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
# Line 474  if env['useumfpack']: Line 478  if env['useumfpack']:
478  else:  else:
479    conf.Finish()    conf.Finish()
480    
481    ############ Silo (optional) ###################################
482    
483    if env['usesilo']:
484      conf = Configure(clone_env(env))
485      conf.env.AppendUnique(CPPPATH = [env['silo_path']])
486      conf.env.AppendUnique(LIBPATH = [env['silo_lib_path']])
487      conf.env.AppendUnique(LIBS = [env['silo_libs']])
488      if not conf.CheckCHeader('silo.h'): env['usesilo'] = 0
489      if not conf.CheckFunc('DBMkDir'): env['usesilo'] = 0
490      conf.Finish()
491    
492    # Add the path to Silo to environment env if it was found.
493    # Note that we do not add the libs since they are only needed for the
494    # escriptreader library and tools.
495    if env['usesilo']:
496      env.AppendUnique(CPPPATH = [env['silo_path']])
497      env.AppendUnique(LIBPATH = [env['silo_lib_path']])
498      env.Append(CPPDEFINES = ['HAVE_SILO'])
499    
500  ############ Add the compiler flags ############################  ############ Add the compiler flags ############################
501    
502  # Enable debug by choosing either cc_debug or cc_optim  # Enable debug by choosing either cc_debug or cc_optim
# Line 488  else: Line 511  else:
511  env.Append(CCFLAGS      = env['cc_flags'])  env.Append(CCFLAGS      = env['cc_flags'])
512  env.Append(LIBS         = [env['omp_libs']])  env.Append(LIBS         = [env['omp_libs']])
513    
514    
515    ############ Add some custom builders ##########################
516    
517    py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
518    env.Append(BUILDERS = {'PyCompile' : py_builder});
519    
520    runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix=env['PROGSUFFIX'], single_source=True)
521    env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
522    
523    runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
524    env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
525    
526  ############ MPI (optional) ####################################  ############ MPI (optional) ####################################
527    
528  # 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)
# Line 562  if env['usemkl']: print "  Using MKL" Line 597  if env['usemkl']: print "  Using MKL"
597  else: print "   Not using MKL"  else: print "   Not using MKL"
598  if env['useumfpack']: print "   Using UMFPACK"  if env['useumfpack']: print "   Using UMFPACK"
599  else: print "   Not using UMFPACK"  else: print "   Not using UMFPACK"
600    if env['usesilo']: print "  Using Silo"
601    else: print "   Not using Silo"
602  if env['useopenmp']: print "    Using OpenMP"  if env['useopenmp']: print "    Using OpenMP"
603  else: print "   Not using OpenMP"  else: print "   Not using OpenMP"
604  if env['usempi']: print "   Using MPI"  if env['usempi']: print "   Using MPI"
# Line 584  Execute(Delete(env['libinstall'] + "/Com Line 621  Execute(Delete(env['libinstall'] + "/Com
621  Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))  Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))
622  if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))  if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))
623    
 ############ Add some custom builders ##########################  
624    
625  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)  ############ Build the subdirectories ##########################
 env.Append(BUILDERS = {'PyCompile' : py_builder});  
   
 runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix=env['PROGSUFFIX'], single_source=True)  
 env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});  
626    
627  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)  from grouptest import *
 env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  
628    
629  ############ Build the subdirectories ##########################  TestGroups=[]
630    
631  Export(  Export(
632    ["env",    ["env",
633     "env_mpi",     "env_mpi",
634     "clone_env",     "clone_env",
635     "IS_WINDOWS_PLATFORM"     "IS_WINDOWS_PLATFORM",
636       "TestGroups"
637     ]     ]
638    )    )
639    
640  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
641    env.SConscript(dirs = ['tools/libescriptreader/src'], build_dir='build/$PLATFORM/tools/libescriptreader', duplicate=0)
642  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
643  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
644  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
# Line 616  env.SConscript(dirs = ['pyvisi/py_src'], Line 649  env.SConscript(dirs = ['pyvisi/py_src'],
649  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
650  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
651  env.SConscript(dirs = ['scripts'], build_dir='build/$PLATFORM/scripts', duplicate=0)  env.SConscript(dirs = ['scripts'], build_dir='build/$PLATFORM/scripts', duplicate=0)
652    env.SConscript(dirs = ['paso/profiling'], build_dir='build/$PLATFORM/paso/profiling', duplicate=0)
653    
654    
655  ############ Remember what optimizations we used ###############  ############ Remember what optimizations we used ###############
656    
# Line 658  build_all_list += ['build_escript'] Line 693  build_all_list += ['build_escript']
693  build_all_list += ['build_finley']  build_all_list += ['build_finley']
694  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']
695  if not IS_WINDOWS_PLATFORM: build_all_list += ['target_finley_wrapper']  if not IS_WINDOWS_PLATFORM: build_all_list += ['target_finley_wrapper']
696    if env['usesilo']:  build_all_list += ['target_escript2silo']
697  env.Alias('build_all', build_all_list)  env.Alias('build_all', build_all_list)
698    
699  install_all_list = []  install_all_list = []
# Line 671  install_all_list += ['target_install_mod Line 707  install_all_list += ['target_install_mod
707  install_all_list += ['target_install_pycad_py']  install_all_list += ['target_install_pycad_py']
708  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']
709  if not IS_WINDOWS_PLATFORM: install_all_list += ['target_install_finley_wrapper']  if not IS_WINDOWS_PLATFORM: install_all_list += ['target_install_finley_wrapper']
710    if env['usesilo']:  install_all_list += ['target_install_escript2silo']
711  install_all_list += ['remember_options']  install_all_list += ['remember_options']
712  env.Alias('install_all', install_all_list)  env.Alias('install_all', install_all_list)
713    
# Line 688  env.Alias('all_tests', ['install_all', ' Line 725  env.Alias('all_tests', ['install_all', '
725    
726  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html'])  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html'])
727    
728    if not IS_WINDOWS_PLATFORM:
729       try:
730        utest=open("utest.sh","w")
731        utest.write(GroupTest.makeHeader())
732        for tests in TestGroups:
733            utest.write(tests.makeString())
734        utest.close()
735        print "utest.sh written"
736       except IOError:
737        print "Error attempting to write unittests file."
738        sys.exit(1)
739    

Legend:
Removed from v.2132  
changed lines
  Added in v.2254

  ViewVC Help
Powered by ViewVC 1.1.26