/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 4426 by jfenwick, Mon May 27 06:14:19 2013 UTC revision 4542 by jfenwick, Thu Nov 28 01:33:22 2013 UTC
# 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'])

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

  ViewVC Help
Powered by ViewVC 1.1.26