/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 4726 by sshaw, Fri Mar 7 00:23:44 2014 UTC revision 5123 by sshaw, Thu Aug 28 07:02:11 2014 UTC
# Line 46  if not options_file: Line 46  if not options_file:
46  if not os.path.isfile(options_file):  if not os.path.isfile(options_file):
47      print("\nWARNING:\nOptions file %s" % options_file)      print("\nWARNING:\nOptions file %s" % options_file)
48      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.")
49      print("We recommend that you copy one of the TEMPLATE files in the scons/")      print("We recommend that you copy the most relavent options file in the scons/os/")
50      print("subdirectory and customize it to your needs.\n")      print("subdirectory and customize it to your needs.\n")
51      options_file = None      options_file = None
52    
# Line 135  vars.AddVariables( Line 135  vars.AddVariables(
135    ('pythonlibpath', 'Path to the python library. (You should not need to set this unless your python has moved)',''),    ('pythonlibpath', 'Path to the python library. (You should not need to set this unless your python has moved)',''),
136    ('pythonincpath','Path to python include files. (You should not need to set this unless your python has moved',''),    ('pythonincpath','Path to python include files. (You should not need to set this unless your python has moved',''),
137    BoolVariable('BADPYTHONMACROS','Extra \#include to get around a python bug.', True),    BoolVariable('BADPYTHONMACROS','Extra \#include to get around a python bug.', True),
138      BoolVariable('compressed_files','Enables reading from compressed binary files', True),
139      ('compression_libs', 'Compression libraries to link with', ['boost_iostreams'])
140  )  )
141    
142  ##################### Create environment and help text #######################  ##################### Create environment and help text #######################
# Line 151  env = Environment(tools = ['default'], o Line 153  env = Environment(tools = ['default'], o
153  def mkclang(env):  def mkclang(env):
154      env['CXX']='clang++'      env['CXX']='clang++'
155    
156  if env['tools_names'] != 'default':  if env['tools_names'] != ['default']:
157      zz=env['tools_names']      zz=env['tools_names']
158      if 'clang' in zz:      if 'clang' in zz:
159          zz.remove('clang')          zz.remove('clang')
# Line 230  if cc_name == 'icpc': Line 232  if cc_name == 'icpc':
232      # Intel compiler      # Intel compiler
233      # #1875: offsetof applied to non-POD types is nonstandard (in boost)      # #1875: offsetof applied to non-POD types is nonstandard (in boost)
234      # removed -std=c99 because icpc doesn't like it and we aren't using c anymore      # removed -std=c99 because icpc doesn't like it and we aren't using c anymore
235      cc_flags    = "-fPIC -w2 -wd1875 -Wno-unknown-pragmas -DBLOCKTIMER -DCORE_ID1"      cc_flags    = "-fPIC -w2 -wd1875 -Wno-unknown-pragmas"
236      cc_optim    = "-O3 -ftz -fno-alias -ipo -xHost"      cc_optim    = "-O3 -ftz -fno-alias -inline-level=2 -ipo -xHost"
237      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
238      omp_flags   = "-openmp"      omp_flags   = "-openmp"
239      omp_ldflags = "-openmp -openmp_report=1"      omp_ldflags = "-openmp -openmp_report=1"
# Line 240  elif cc_name[:3] == 'g++': Line 242  elif cc_name[:3] == 'g++':
242      # GNU C on any system      # GNU C on any system
243      # note that -ffast-math is not used because it breaks isnan(),      # note that -ffast-math is not used because it breaks isnan(),
244      # see mantis #691      # see mantis #691
245      cc_flags     = "-pedantic -Wall -fPIC -Wno-unknown-pragmas -DBLOCKTIMER  -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing -finline-functions"      cc_flags     = "-pedantic -Wall -fPIC -Wno-unknown-pragmas -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing -finline-functions"
246      cc_optim     = "-O3"      cc_optim     = "-O3"
247      cc_debug     = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug     = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK --param=max-vartrack-size=90000000" #avoids vartrack limit being exceeded with escriptcpp.cpp
248      omp_flags    = "-fopenmp"      omp_flags    = "-fopenmp"
249      omp_ldflags  = "-fopenmp"      omp_ldflags  = "-fopenmp"
250      fatalwarning = "-Werror"      fatalwarning = "-Werror"
# Line 368  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N Line 370  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N
370      try:      try:
371          env['ENV'][key] = os.environ[key]          env['ENV'][key] = os.environ[key]
372      except KeyError:      except KeyError:
373          env['ENV'][key] = 1          env['ENV'][key] = '1'
374    
375  env_export=env['env_export']  env_export=env['env_export']
376  env_export.extend(['ESCRIPT_NUM_THREADS','ESCRIPT_HOSTFILE','DISPLAY','XAUTHORITY','PATH','HOME','KMP_MONITOR_STACKSIZE','TMPDIR','TEMP','TMP'])  env_export.extend(['ESCRIPT_NUM_THREADS','ESCRIPT_HOSTFILE','DISPLAY','XAUTHORITY','PATH','HOME','KMP_MONITOR_STACKSIZE','TMPDIR','TEMP','TMP','LD_PRELOAD'])
377    
378  for key in set(env_export):  for key in set(env_export):
379      try:      try:
# Line 417  env.Append(BUILDERS = {'RunUnitTest' : r Line 419  env.Append(BUILDERS = {'RunUnitTest' : r
419  runPyUnitTest_builder = Builder(action = runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)  runPyUnitTest_builder = Builder(action = runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
420  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
421    
422    runPyExample_builder = Builder(action = runPyExample, suffix = '.passed', src_suffic='.py', single_source=True)
423    env.Append(BUILDERS = {'RunPyExample' : runPyExample_builder});
424    
425  epstopdfbuilder = Builder(action = eps2pdf, suffix='.pdf', src_suffix='.eps', single_source=True)  epstopdfbuilder = Builder(action = eps2pdf, suffix='.pdf', src_suffix='.eps', single_source=True)
426  env.Append(BUILDERS = {'EpsToPDF' : epstopdfbuilder});  env.Append(BUILDERS = {'EpsToPDF' : epstopdfbuilder});
427    
# Line 502  env.SConscript(dirs = ['pasowrap/src'], Line 507  env.SConscript(dirs = ['pasowrap/src'],
507  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)
508  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)
509  env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)  env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)
510    env.SConscript(dirs = ['speckley/src'], variant_dir='$BUILD_DIR/$PLATFORM/speckley', duplicate=0)
511  env.SConscript(dirs = ['downunder/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/downunder', duplicate=0)  env.SConscript(dirs = ['downunder/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/downunder', duplicate=0)
512  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)
513  env.SConscript(dirs = ['pycad/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pycad', duplicate=0)  env.SConscript(dirs = ['pycad/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pycad', duplicate=0)
# Line 544  env.Alias('install_finley', ['build_finl Line 550  env.Alias('install_finley', ['build_finl
550  env.Alias('build_ripley', ['install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])  env.Alias('build_ripley', ['install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])
551  env.Alias('install_ripley', ['build_ripley', 'install_ripley_lib', 'install_ripleycpp_lib', 'install_ripley_py'])  env.Alias('install_ripley', ['build_ripley', 'install_ripley_lib', 'install_ripleycpp_lib', 'install_ripley_py'])
552    
553    env.Alias('build_speckley', ['install_speckley_headers', 'build_speckley_lib', 'build_speckleycpp_lib'])
554    env.Alias('install_speckley', ['build_speckley', 'install_speckley_lib', 'install_speckleycpp_lib', 'install_speckley_py'])
555    
556  env.Alias('build_weipa', ['install_weipa_headers', 'build_weipa_lib', 'build_weipacpp_lib'])  env.Alias('build_weipa', ['install_weipa_headers', 'build_weipa_lib', 'build_weipacpp_lib'])
557  env.Alias('install_weipa', ['build_weipa', 'install_weipa_lib', 'install_weipacpp_lib', 'install_weipa_py'])  env.Alias('install_weipa', ['build_weipa', 'install_weipa_lib', 'install_weipacpp_lib', 'install_weipa_py'])
558    
# Line 559  build_all_list += ['build_pasowrap'] Line 568  build_all_list += ['build_pasowrap']
568  build_all_list += ['build_dudley']  build_all_list += ['build_dudley']
569  build_all_list += ['build_finley']  build_all_list += ['build_finley']
570  build_all_list += ['build_ripley']  build_all_list += ['build_ripley']
571    build_all_list += ['build_speckley']
572  build_all_list += ['build_weipa']  build_all_list += ['build_weipa']
573  if not IS_WINDOWS: build_all_list += ['build_escriptreader']  if not IS_WINDOWS: build_all_list += ['build_escriptreader']
574  if env['usempi']:   build_all_list += ['build_pythonMPI']  if env['usempi']:   build_all_list += ['build_pythonMPI']
# Line 574  install_all_list += ['install_pasowrap'] Line 584  install_all_list += ['install_pasowrap']
584  install_all_list += ['install_dudley']  install_all_list += ['install_dudley']
585  install_all_list += ['install_finley']  install_all_list += ['install_finley']
586  install_all_list += ['install_ripley']  install_all_list += ['install_ripley']
587    install_all_list += ['install_speckley']
588  install_all_list += ['install_weipa']  install_all_list += ['install_weipa']
589  if not IS_WINDOWS: install_all_list += ['install_escriptreader']  if not IS_WINDOWS: install_all_list += ['install_escriptreader']
590  install_all_list += ['install_downunder_py']  install_all_list += ['install_downunder_py']
# Line 653  def print_summary(): Line 664  def print_summary():
664          print("            gmsh:  FOUND")          print("            gmsh:  FOUND")
665      else:      else:
666          print("            gmsh:  NOT FOUND")          print("            gmsh:  NOT FOUND")
667        print(    "            gzip:  " + ("YES" if env['compressed_files'] else "NO"))
668    
669      if ((fatalwarning != '') and (env['werror'])):      if ((fatalwarning != '') and (env['werror'])):
670          print("  Treating warnings as errors")          print("  Treating warnings as errors")

Legend:
Removed from v.4726  
changed lines
  Added in v.5123

  ViewVC Help
Powered by ViewVC 1.1.26