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

Diff of /branches/diaplayground/SConstruct

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

trunk/SConstruct revision 4775 by caltinay, Wed Mar 19 23:12:53 2014 UTC branches/diaplayground/SConstruct revision 5084 by caltinay, Sun Jun 29 23:29:51 2014 UTC
# Line 23  from site_init import * Line 23  from site_init import *
23    
24  # Version number to check for in options file. Increment when new features are  # Version number to check for in options file. Increment when new features are
25  # added or existing options changed.  # added or existing options changed.
26  REQUIRED_OPTS_VERSION=201  REQUIRED_OPTS_VERSION=202
27    
28  # MS Windows support, many thanks to PH  # MS Windows support, many thanks to PH
29  IS_WINDOWS = (os.name == 'nt')  IS_WINDOWS = (os.name == 'nt')
# 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 69  vars.AddVariables( Line 69  vars.AddVariables(
69    ('cc_debug', 'Additional C++ flags for a debug build', 'default'),    ('cc_debug', 'Additional C++ flags for a debug build', 'default'),
70    ('cxx_extra', 'Extra C++ compiler flags', ''),    ('cxx_extra', 'Extra C++ compiler flags', ''),
71    ('ld_extra', 'Extra linker flags', ''),    ('ld_extra', 'Extra linker flags', ''),
72      ('nvcc', 'Path to CUDA compiler', 'default'),
73      ('nvccflags', 'Base CUDA compiler flags', 'default'),
74    BoolVariable('werror','Treat compiler warnings as errors', True),    BoolVariable('werror','Treat compiler warnings as errors', True),
75    BoolVariable('debug', 'Compile with debug flags', False),    BoolVariable('debug', 'Compile with debug flags', False),
76    BoolVariable('openmp', 'Compile parallel version using OpenMP', False),    BoolVariable('openmp', 'Compile parallel version using OpenMP', False),
# Line 113  vars.AddVariables( Line 115  vars.AddVariables(
115    ('visit_prefix', 'Prefix/Paths to VisIt installation', default_prefix),    ('visit_prefix', 'Prefix/Paths to VisIt installation', default_prefix),
116    ('visit_libs', 'VisIt libraries to link with', ['simV2']),    ('visit_libs', 'VisIt libraries to link with', ['simV2']),
117    BoolVariable('vsl_random', 'Use VSL from intel for random data', False),    BoolVariable('vsl_random', 'Use VSL from intel for random data', False),
118      BoolVariable('cuda', 'Enable GPU code with CUDA (requires thrust)', False),
119      ('thrust_prefix', 'Prefix/Paths to NVidia thrust installation', default_prefix),
120  # Advanced settings  # Advanced settings
121    #dudley_assemble_flags = -funroll-loops      to actually do something    #dudley_assemble_flags = -funroll-loops      to actually do something
122    ('dudley_assemble_flags', 'compiler flags for some dudley optimisations', ''),    ('dudley_assemble_flags', 'compiler flags for some dudley optimisations', ''),
# Line 153  env = Environment(tools = ['default'], o Line 157  env = Environment(tools = ['default'], o
157  def mkclang(env):  def mkclang(env):
158      env['CXX']='clang++'      env['CXX']='clang++'
159    
160  if env['tools_names'] != 'default':  if env['tools_names'] != ['default']:
161      zz=env['tools_names']      zz=env['tools_names']
162      if 'clang' in zz:      if 'clang' in zz:
163          zz.remove('clang')          zz.remove('clang')
# Line 183  if len(vars.UnknownVariables())>0: Line 187  if len(vars.UnknownVariables())>0:
187          print("Unknown option '%s'" % k)          print("Unknown option '%s'" % k)
188      Exit(1)      Exit(1)
189    
190    if env['cuda']:
191        env.Tool('nvcc')
192    
193  # create dictionary which will be populated with info for buildvars file  # create dictionary which will be populated with info for buildvars file
194  env['buildvars']={}  env['buildvars']={}
195  # create list which will be populated with warnings if there are any  # create list which will be populated with warnings if there are any
# Line 211  env.Append(LIBPATH = [env['libinstall']] Line 218  env.Append(LIBPATH = [env['libinstall']]
218    
219  if env['cxx'] != 'default': env['CXX']=env['cxx']  if env['cxx'] != 'default': env['CXX']=env['cxx']
220    
221    if env['nvcc'] != 'default':
222        env['NVCC'] = env['nvcc']
223    else:
224        env['NVCC'] = 'nvcc'
225    
226  # 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++
227  # runtimes (icc does not)  # runtimes (icc does not)
228  if not IS_WINDOWS and os.uname()[4]=='ia64' and env['CXX']=='icpc':  if not IS_WINDOWS and os.uname()[4]=='ia64' and env['CXX']=='icpc':
# Line 233  if cc_name == 'icpc': Line 245  if cc_name == 'icpc':
245      # #1875: offsetof applied to non-POD types is nonstandard (in boost)      # #1875: offsetof applied to non-POD types is nonstandard (in boost)
246      # 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
247      cc_flags    = "-fPIC -w2 -wd1875 -Wno-unknown-pragmas"      cc_flags    = "-fPIC -w2 -wd1875 -Wno-unknown-pragmas"
248      cc_optim    = "-O3 -ftz -fno-alias -ipo -xHost"      cc_optim    = "-O3 -ftz -fno-alias -inline-level=2 -ipo -xHost"
249      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
250      omp_flags   = "-openmp"      omp_flags   = "-openmp"
251      omp_ldflags = "-openmp -openmp_report=1"      omp_ldflags = "-openmp -openmp_report=1"
# Line 244  elif cc_name[:3] == 'g++': Line 256  elif cc_name[:3] == 'g++':
256      # see mantis #691      # see mantis #691
257      cc_flags     = "-pedantic -Wall -fPIC -Wno-unknown-pragmas -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"
258      cc_optim     = "-O3"      cc_optim     = "-O3"
259      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
260      omp_flags    = "-fopenmp"      omp_flags    = "-fopenmp"
261      omp_ldflags  = "-fopenmp"      omp_ldflags  = "-fopenmp"
262      fatalwarning = "-Werror"      fatalwarning = "-Werror"
# Line 274  if env['omp_ldflags'] == 'default': env[ Line 286  if env['omp_ldflags'] == 'default': env[
286  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])
287  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])
288    
289    if env['nvccflags'] != 'default':
290        env['NVCCFLAGS'] = env['nvccflags']
291        env['SHNVCCFLAGS'] = env['nvccflags'] + ' -shared'
292    
293  if env['BADPYTHONMACROS']: env.Append(CXXFLAGS = ' -DBADPYTHONMACROS')  if env['BADPYTHONMACROS']: env.Append(CXXFLAGS = ' -DBADPYTHONMACROS')
294    
295  if env['usepython3']:  if env['usepython3']:
# Line 370  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N Line 386  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N
386      try:      try:
387          env['ENV'][key] = os.environ[key]          env['ENV'][key] = os.environ[key]
388      except KeyError:      except KeyError:
389          env['ENV'][key] = 1          env['ENV'][key] = '1'
390    
391  env_export=env['env_export']  env_export=env['env_export']
392  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'])
393    
394  for key in set(env_export):  for key in set(env_export):
395      try:      try:
# Line 419  env.Append(BUILDERS = {'RunUnitTest' : r Line 435  env.Append(BUILDERS = {'RunUnitTest' : r
435  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)
436  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
437    
438    runPyExample_builder = Builder(action = runPyExample, suffix = '.passed', src_suffic='.py', single_source=True)
439    env.Append(BUILDERS = {'RunPyExample' : runPyExample_builder});
440    
441  epstopdfbuilder = Builder(action = eps2pdf, suffix='.pdf', src_suffix='.eps', single_source=True)  epstopdfbuilder = Builder(action = eps2pdf, suffix='.pdf', src_suffix='.eps', single_source=True)
442  env.Append(BUILDERS = {'EpsToPDF' : epstopdfbuilder});  env.Append(BUILDERS = {'EpsToPDF' : epstopdfbuilder});
443    
# Line 523  env.Alias('target_init', [target_init]) Line 542  env.Alias('target_init', [target_init])
542  # delete buildvars upon cleanup  # delete buildvars upon cleanup
543  env.Clean('target_init', os.path.join(env['libinstall'], 'buildvars'))  env.Clean('target_init', os.path.join(env['libinstall'], 'buildvars'))
544    
545    cusphdr_inst = env.Install(env['incinstall'], Dir('#cusplibrary/cusp'))
546    env.Alias('install_cusp_headers', cusphdr_inst)
547  # The headers have to be installed prior to build in order to satisfy  # The headers have to be installed prior to build in order to satisfy
548  # #include <paso/Common.h>  # #include <paso/Common.h>
549  env.Alias('build_esysUtils', ['install_esysUtils_headers', 'build_esysUtils_lib'])  env.Alias('build_esysUtils', ['install_esysUtils_headers', 'build_esysUtils_lib'])
# Line 543  env.Alias('install_dudley', ['build_dudl Line 564  env.Alias('install_dudley', ['build_dudl
564  env.Alias('build_finley', ['install_finley_headers', 'build_finley_lib', 'build_finleycpp_lib'])  env.Alias('build_finley', ['install_finley_headers', 'build_finley_lib', 'build_finleycpp_lib'])
565  env.Alias('install_finley', ['build_finley', 'install_finley_lib', 'install_finleycpp_lib', 'install_finley_py'])  env.Alias('install_finley', ['build_finley', 'install_finley_lib', 'install_finleycpp_lib', 'install_finley_py'])
566    
567  env.Alias('build_ripley', ['install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])  env.Alias('build_ripley', ['install_cusp_headers', 'install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])
568  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'])
569    
570  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'])

Legend:
Removed from v.4775  
changed lines
  Added in v.5084

  ViewVC Help
Powered by ViewVC 1.1.26