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

Diff of /branches/diaplayground/SConstruct

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

revision 4295 by caltinay, Fri Mar 8 04:42:01 2013 UTC revision 4542 by jfenwick, Thu Nov 28 01:33:22 2013 UTC
# Line 43  if not options_file: Line 43  if not options_file:
43  if not os.path.isfile(options_file):  if not os.path.isfile(options_file):
44      print("\nWARNING:\nOptions file %s" % options_file)      print("\nWARNING:\nOptions file %s" % options_file)
45      print("not found! Default options will be used which is most likely suboptimal.")      print("not found! Default options will be used which is most likely suboptimal.")
46      print("It is recommended that you copy one of the TEMPLATE files in the scons/")      print("We recommend that you copy one of the TEMPLATE files in the scons/")
47      print("subdirectory and customize it to your needs.\n")      print("subdirectory and customize it to your needs.\n")
48      options_file = None      options_file = None
49    
# Line 60  vars.AddVariables( Line 60  vars.AddVariables(
60    PathVariable('build_dir', 'Top-level build directory', Dir('#/build').abspath, PathVariable.PathIsDirCreate),    PathVariable('build_dir', 'Top-level build directory', Dir('#/build').abspath, PathVariable.PathIsDirCreate),
61    BoolVariable('verbose', 'Output full compile/link lines', False),    BoolVariable('verbose', 'Output full compile/link lines', False),
62  # Compiler/Linker options  # Compiler/Linker options
   ('cc', 'Path to C compiler', 'default'),  
63    ('cxx', 'Path to C++ compiler', 'default'),    ('cxx', 'Path to C++ compiler', 'default'),
64    ('cc_flags', 'Base C/C++ compiler flags', 'default'),    ('cc_flags', 'Base C++ compiler flags', 'default'),
65    ('cc_optim', 'Additional C/C++ flags for a non-debug build', 'default'),    ('cc_optim', 'Additional C++ flags for a non-debug build', 'default'),
66    ('cc_debug', 'Additional C/C++ flags for a debug build', 'default'),    ('cc_debug', 'Additional C++ flags for a debug build', 'default'),
   ('cc_extra', 'Extra C compiler flags', ''),  
67    ('cxx_extra', 'Extra C++ compiler flags', ''),    ('cxx_extra', 'Extra C++ compiler flags', ''),
68    ('ld_extra', 'Extra linker flags', ''),    ('ld_extra', 'Extra linker flags', ''),
69    BoolVariable('werror','Treat compiler warnings as errors', True),    BoolVariable('werror','Treat compiler warnings as errors', True),
# Line 148  env = Environment(tools = ['default'], o Line 146  env = Environment(tools = ['default'], o
146    
147  # set the vars for clang  # set the vars for clang
148  def mkclang(env):  def mkclang(env):
     env['CC']='clang'  
149      env['CXX']='clang++'      env['CXX']='clang++'
150    
151  if env['tools_names'] != 'default':  if env['tools_names'] != 'default':
# Line 207  env.Append(LIBPATH = [env['libinstall']] Line 204  env.Append(LIBPATH = [env['libinstall']]
204    
205  ################# Fill in compiler options if not set above ##################  ################# Fill in compiler options if not set above ##################
206    
 if env['cc'] != 'default': env['CC']=env['cc']  
207  if env['cxx'] != 'default': env['CXX']=env['cxx']  if env['cxx'] != 'default': env['CXX']=env['cxx']
208    
209  # version >=9 of intel C++ compiler requires use of icpc to link in C++  # version >=9 of intel C++ compiler requires use of icpc to link in C++
# Line 225  fatalwarning = '' # switch to turn warni Line 221  fatalwarning = '' # switch to turn warni
221  sysheaderopt = '' # how to indicate that a header is a system header  sysheaderopt = '' # how to indicate that a header is a system header
222    
223  # env['CC'] might be a full path  # env['CC'] might be a full path
224  cc_name=os.path.basename(env['CC'])  cc_name=os.path.basename(env['CXX'])
225    
226  if cc_name == 'icc':  if cc_name == 'icpc':
227      # Intel compiler      # Intel compiler
228      # #1875: offsetof applied to non-POD types is nonstandard (in boost)      # #1875: offsetof applied to non-POD types is nonstandard (in boost)
229      cc_flags    = "-std=c99 -fPIC -w2 -wd1875 -Wno-unknown-pragmas -DBLOCKTIMER -DCORE_ID1"      # removed -std=c99 because icpc doesn't like it and we aren't using c anymore
230        cc_flags    = "-fPIC -w2 -wd1875 -Wno-unknown-pragmas -DBLOCKTIMER -DCORE_ID1"
231      cc_optim    = "-O3 -ftz -fno-alias -ipo -xHost"      cc_optim    = "-O3 -ftz -fno-alias -ipo -xHost"
232      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
233      omp_flags   = "-openmp"      omp_flags   = "-openmp"
234      omp_ldflags = "-openmp -openmp_report=1"      omp_ldflags = "-openmp -openmp_report=1"
235      fatalwarning = "-Werror"      fatalwarning = "-Werror"
236  elif cc_name[:3] == 'gcc':  elif cc_name[:3] == 'g++':
237      # GNU C on any system      # GNU C on any system
238      # note that -ffast-math is not used because it breaks isnan(),      # note that -ffast-math is not used because it breaks isnan(),
239      # see mantis #691      # see mantis #691
# Line 269  if env['cc_optim']    == 'default': env[ Line 266  if env['cc_optim']    == 'default': env[
266  if env['cc_debug']    == 'default': env['cc_debug'] = cc_debug  if env['cc_debug']    == 'default': env['cc_debug'] = cc_debug
267  if env['omp_flags']   == 'default': env['omp_flags'] = omp_flags  if env['omp_flags']   == 'default': env['omp_flags'] = omp_flags
268  if env['omp_ldflags'] == 'default': env['omp_ldflags'] = omp_ldflags  if env['omp_ldflags'] == 'default': env['omp_ldflags'] = omp_ldflags
 if env['cc_extra']  != '': env.Append(CFLAGS = env['cc_extra'])  
269  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])
270  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])
271    
# Line 446  env.PrependENVPath('PYTHONPATH', prefix) Line 442  env.PrependENVPath('PYTHONPATH', prefix)
442  env['ENV']['ESCRIPT_ROOT'] = prefix  env['ENV']['ESCRIPT_ROOT'] = prefix
443    
444  if not env['verbose']:  if not env['verbose']:
     env['CCCOMSTR'] = "Compiling $TARGET"  
445      env['CXXCOMSTR'] = "Compiling $TARGET"      env['CXXCOMSTR'] = "Compiling $TARGET"
     env['SHCCCOMSTR'] = "Compiling $TARGET"  
446      env['SHCXXCOMSTR'] = "Compiling $TARGET"      env['SHCXXCOMSTR'] = "Compiling $TARGET"
447      env['ARCOMSTR'] = "Linking $TARGET"      env['ARCOMSTR'] = "Linking $TARGET"
448      env['LINKCOMSTR'] = "Linking $TARGET"      env['LINKCOMSTR'] = "Linking $TARGET"
# Line 488  Export( Line 482  Export(
482  env.SConscript(dirs = ['tools/escriptconvert'], variant_dir='$BUILD_DIR/$PLATFORM/tools/escriptconvert', duplicate=0)  env.SConscript(dirs = ['tools/escriptconvert'], variant_dir='$BUILD_DIR/$PLATFORM/tools/escriptconvert', duplicate=0)
483  env.SConscript(dirs = ['paso/src'], variant_dir='$BUILD_DIR/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], variant_dir='$BUILD_DIR/$PLATFORM/paso', duplicate=0)
484  env.SConscript(dirs = ['weipa/src'], variant_dir='$BUILD_DIR/$PLATFORM/weipa', duplicate=0)  env.SConscript(dirs = ['weipa/src'], variant_dir='$BUILD_DIR/$PLATFORM/weipa', duplicate=0)
485  env.SConscript(dirs = ['escript/src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)
486    
487    #This will pull in the escriptcore/py_src and escriptcore/test
488    env.SConscript(dirs = ['escriptcore/src'], variant_dir='$BUILD_DIR/$PLATFORM/escriptcore', duplicate=0)
489    #env.SConscript(dirs = ['escript/test'], variant_dir='$BUILD_DIR/$PLATFORM/escript/test', duplicate=0)
490  env.SConscript(dirs = ['esysUtils/src'], variant_dir='$BUILD_DIR/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], variant_dir='$BUILD_DIR/$PLATFORM/esysUtils', duplicate=0)
491  env.SConscript(dirs = ['pasowrap/src'], variant_dir='$BUILD_DIR/$PLATFORM/pasowrap', duplicate=0)  env.SConscript(dirs = ['pasowrap/src'], variant_dir='$BUILD_DIR/$PLATFORM/pasowrap', duplicate=0)
492  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)
# Line 522  env.Alias('build_paso', ['install_paso_h Line 520  env.Alias('build_paso', ['install_paso_h
520  env.Alias('install_paso', ['build_paso', 'install_paso_lib'])  env.Alias('install_paso', ['build_paso', 'install_paso_lib'])
521    
522  env.Alias('build_escript', ['install_escript_headers', 'build_escript_lib', 'build_escriptcpp_lib'])  env.Alias('build_escript', ['install_escript_headers', 'build_escript_lib', 'build_escriptcpp_lib'])
523  env.Alias('install_escript', ['build_escript', 'install_escript_lib', 'install_escriptcpp_lib', 'install_escript_py'])  env.Alias('install_escript', ['build_escript', 'install_escript_lib', 'install_escriptcpp_lib', 'install_escriptcore_py', 'install_escript_py'])
524    
525  env.Alias('build_pasowrap', ['install_pasowrap_headers', 'build_pasowrap_lib', 'build_pasowrapcpp_lib'])  env.Alias('build_pasowrap', ['install_pasowrap_headers', 'build_pasowrap_lib', 'build_pasowrapcpp_lib'])
526  env.Alias('install_pasowrap', ['build_pasowrap', 'install_pasowrap_lib', 'install_pasowrapcpp_lib', 'install_pasowrap_py'])  env.Alias('install_pasowrap', ['build_pasowrap', 'install_pasowrap_lib', 'install_pasowrapcpp_lib', 'install_pasowrap_py'])
# Line 581  env.Default('install_all') Line 579  env.Default('install_all')
579  ################## Targets to build and run the test suite ###################  ################## Targets to build and run the test suite ###################
580    
581  if not env['cppunit']:  if not env['cppunit']:
582      test_msg = env.Command('.dummy.', None, '@echo "Cannot run C/C++ unit tests, CppUnit not found!";exit 1')      test_msg = env.Command('.dummy.', None, '@echo "Cannot run C++ unit tests, CppUnit not found!";exit 1')
583      env.Alias('run_tests', test_msg)      env.Alias('run_tests', test_msg)
584      env.Alias('build_tests', '')      env.Alias('build_tests', '')
585  env.Alias('run_tests', ['install_all'])  env.Alias('run_tests', ['install_all'])
# Line 609  if not IS_WINDOWS: Line 607  if not IS_WINDOWS:
607  ######################## Summarize our environment ###########################  ######################## Summarize our environment ###########################
608  def print_summary():  def print_summary():
609      print("")      print("")
610      print("*** Config Summary (see config.log and lib/buildvars for details) ***")      print("*** Config Summary (see config.log and <prefix>/lib/buildvars for details) ***")
611      print("Escript/Finley revision %s"%global_revision)      print("Escript/Finley revision %s"%global_revision)
612      print("  Install prefix:  %s"%env['prefix'])      print("  Install prefix:  %s"%env['prefix'])
613      print("          Python:  %s"%sysconfig.PREFIX)      print("          Python:  %s"%sysconfig.PREFIX)
614      print("           boost:  %s"%env['boost_prefix'])      print("           boost:  %s"%env['boost_prefix'])
615      print("           numpy:  YES")      if env['numpy_h']:
616            print("           numpy:  YES (with headers)")
617        else:
618            print("           numpy:  YES (without headers)")
619      if env['usempi']:      if env['usempi']:
620          print("             MPI:  YES (flavour: %s)"%env['mpi'])          print("             MPI:  YES (flavour: %s)"%env['mpi'])
621      else:      else:
# Line 625  def print_summary(): Line 626  def print_summary():
626          print("          LAPACK:  DISABLED")          print("          LAPACK:  DISABLED")
627      d_list=[]      d_list=[]
628      e_list=[]      e_list=[]
629      for i in 'debug','openmp','boomeramg','mkl','netcdf','papi','parmetis','pyproj','silo','sympy','umfpack','visit','vsl_random':      for i in 'debug','openmp','boomeramg','gdal','mkl','netcdf','papi','parmetis','pyproj','scipy','silo','sympy','umfpack','visit','vsl_random':
630          if env[i]: e_list.append(i)          if env[i]: e_list.append(i)
631          else: d_list.append(i)          else: d_list.append(i)
632      for i in e_list:      for i in e_list:
# Line 642  def print_summary(): Line 643  def print_summary():
643          print("            gmsh:  FOUND")          print("            gmsh:  FOUND")
644      else:      else:
645          print("            gmsh:  NOT FOUND")          print("            gmsh:  NOT FOUND")
646      if env['numpy_h']:  
         print("   numpy headers:  FOUND")  
     else:  
         print("   numpy headers:  NOT FOUND")  
     print("   vsl_random:  %s"%env['vsl_random'])  
           
647      if ((fatalwarning != '') and (env['werror'])):      if ((fatalwarning != '') and (env['werror'])):
648          print("  Treating warnings as errors")          print("  Treating warnings as errors")
649      else:      else:

Legend:
Removed from v.4295  
changed lines
  Added in v.4542

  ViewVC Help
Powered by ViewVC 1.1.26