/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2184 by caltinay, Mon Dec 22 04:27:26 2008 UTC revision 2273 by jfenwick, Tue Feb 17 01:22:48 2009 UTC
# Line 75  opts.AddOptions( Line 75  opts.AddOptions(
75    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),
76    BoolOption('usepedantic', 'Compile with -pedantic if using gcc', 'no'),    BoolOption('usepedantic', 'Compile with -pedantic if using gcc', 'no'),
77    BoolOption('usewarnings','Compile with warnings as errors if using gcc','yes'),    BoolOption('usewarnings','Compile with warnings as errors if using gcc','yes'),
78      ('forcelazy','for testing use only - set the default value for autolazy','leave_alone'),
79  # Python  # Python
80    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),
81    ('python_lib_path', 'Path to Python libs', usr_lib),    ('python_lib_path', 'Path to Python libs', usr_lib),
# Line 184  if env["CC"] == "icc": Line 185  if env["CC"] == "icc":
185    sysheaderopt      = ""    sysheaderopt      = ""
186  elif env["CC"] == "gcc":  elif env["CC"] == "gcc":
187    # GNU C on any system    # GNU C on any system
188    cc_flags      = "-pedantic -Wall -fPIC -ansi -ffast-math -Wno-unknown-pragmas -DBLOCKTIMER  -Wno-sign-compare -Wno-system-headers -Wno-long-long"    cc_flags      = "-pedantic -Wall -fPIC -ansi -ffast-math -Wno-unknown-pragmas -DBLOCKTIMER  -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing"
189  #the long long warning occurs on the Mac  #the long long warning occurs on the Mac
190    cc_optim      = "-O3"    cc_optim      = "-O3"
191    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
# Line 220  if env["omp_optim"]    == "-DEFAULT_4": env Line 221  if env["omp_optim"]    == "-DEFAULT_4": env
221  if env["omp_debug"] == "-DEFAULT_5": env['omp_debug'] = omp_debug  if env["omp_debug"] == "-DEFAULT_5": env['omp_debug'] = omp_debug
222  if env["omp_libs"]  == "-DEFAULT_6": env['omp_libs'] = omp_libs  if env["omp_libs"]  == "-DEFAULT_6": env['omp_libs'] = omp_libs
223    
224    #set up the autolazy values
225    if env['forcelazy']    != "leave_alone":
226      if env['forcelazy'] == 'on':
227        env.Append(CPPDEFINES='FAUTOLAZYON')
228      else:
229         if env['forcelazy'] == 'off':
230        env.Append(CPPDEFINES='FAUTOLAZYOFF')
231    
232  # OpenMP is disabled if useopenmp=no or both variables omp_optim and omp_debug are empty  # OpenMP is disabled if useopenmp=no or both variables omp_optim and omp_debug are empty
233  if not env["useopenmp"]:  if not env["useopenmp"]:
234    env['omp_optim'] = ""    env['omp_optim'] = ""
# Line 511  else: Line 520  else:
520  env.Append(CCFLAGS      = env['cc_flags'])  env.Append(CCFLAGS      = env['cc_flags'])
521  env.Append(LIBS         = [env['omp_libs']])  env.Append(LIBS         = [env['omp_libs']])
522    
523    
524    ############ Add some custom builders ##########################
525    
526    py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
527    env.Append(BUILDERS = {'PyCompile' : py_builder});
528    
529    runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix=env['PROGSUFFIX'], single_source=True)
530    env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
531    
532    runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
533    env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
534    
535  ############ MPI (optional) ####################################  ############ MPI (optional) ####################################
536    
537  # 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 609  Execute(Delete(env['libinstall'] + "/Com Line 630  Execute(Delete(env['libinstall'] + "/Com
630  Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))  Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))
631  if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))  if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))
632    
 ############ Add some custom builders ##########################  
   
 py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)  
 env.Append(BUILDERS = {'PyCompile' : py_builder});  
633    
634  runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix=env['PROGSUFFIX'], single_source=True)  ############ Build the subdirectories ##########################
 env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});  
635    
636  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)  from grouptest import *
 env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  
637    
638  ############ Build the subdirectories ##########################  TestGroups=[]
639    
640  Export(  Export(
641    ["env",    ["env",
642     "env_mpi",     "env_mpi",
643     "clone_env",     "clone_env",
644     "IS_WINDOWS_PLATFORM"     "IS_WINDOWS_PLATFORM",
645       "TestGroups"
646     ]     ]
647    )    )
648    
# Line 644  env.SConscript(dirs = ['pythonMPI/src'], Line 660  env.SConscript(dirs = ['pythonMPI/src'],
660  env.SConscript(dirs = ['scripts'], build_dir='build/$PLATFORM/scripts', duplicate=0)  env.SConscript(dirs = ['scripts'], build_dir='build/$PLATFORM/scripts', duplicate=0)
661  env.SConscript(dirs = ['paso/profiling'], build_dir='build/$PLATFORM/paso/profiling', duplicate=0)  env.SConscript(dirs = ['paso/profiling'], build_dir='build/$PLATFORM/paso/profiling', duplicate=0)
662    
663    
664  ############ Remember what optimizations we used ###############  ############ Remember what optimizations we used ###############
665    
666  remember_list = []  remember_list = []
# Line 717  env.Alias('all_tests', ['install_all', ' Line 734  env.Alias('all_tests', ['install_all', '
734    
735  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'])
736    
737    if not IS_WINDOWS_PLATFORM:
738       try:
739        utest=open("utest.sh","w")
740        utest.write(GroupTest.makeHeader())
741        for tests in TestGroups:
742            utest.write(tests.makeString())
743        utest.close()
744        print "utest.sh written"
745       except IOError:
746        print "Error attempting to write unittests file."
747        sys.exit(1)
748    

Legend:
Removed from v.2184  
changed lines
  Added in v.2273

  ViewVC Help
Powered by ViewVC 1.1.26