/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 5123 by sshaw, Thu Aug 28 07:02:11 2014 UTC revision 5184 by caltinay, Wed Oct 1 04:19:22 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 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      ListVariable('domains', 'Which domains to build', 'all',\
120                   ['dudley','finley','ripley','speckley']),
121      ('thrust_prefix', 'Prefix/Paths to NVidia thrust installation', default_prefix),
122  # Advanced settings  # Advanced settings
123    #dudley_assemble_flags = -funroll-loops      to actually do something    #dudley_assemble_flags = -funroll-loops      to actually do something
124    ('dudley_assemble_flags', 'compiler flags for some dudley optimisations', ''),    ('dudley_assemble_flags', 'compiler flags for some dudley optimisations', ''),
# Line 131  vars.AddVariables( Line 137  vars.AddVariables(
137    ('SVN_VERSION', 'Do not use from options file', -2),    ('SVN_VERSION', 'Do not use from options file', -2),
138    ('pythoncmd', 'which python to compile with','python'),    ('pythoncmd', 'which python to compile with','python'),
139    ('usepython3', 'Is this a python3 build? (experimental)', False),    ('usepython3', 'Is this a python3 build? (experimental)', False),
140      ('longindices', 'use long indices (for very large matrices)', False),
141    ('pythonlibname', 'Name of the python library to link. (This is found automatically for python2.X.)', ''),    ('pythonlibname', 'Name of the python library to link. (This is found automatically for python2.X.)', ''),
142    ('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)',''),
143    ('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',''),
# Line 183  if len(vars.UnknownVariables())>0: Line 190  if len(vars.UnknownVariables())>0:
190          print("Unknown option '%s'" % k)          print("Unknown option '%s'" % k)
191      Exit(1)      Exit(1)
192    
193    if env['cuda']:
194        if env['nvcc'] != 'default':
195            env['NVCC'] = env['nvcc']
196        env.Tool('nvcc')
197    
198  # create dictionary which will be populated with info for buildvars file  # create dictionary which will be populated with info for buildvars file
199  env['buildvars']={}  env['buildvars']={}
200  # 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 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['BADPYTHONMACROS']: env.Append(CXXFLAGS = ' -DBADPYTHONMACROS')  if env['nvccflags'] != 'default':
290        env['NVCCFLAGS'] = env['nvccflags']
291        env['SHNVCCFLAGS'] = env['nvccflags'] + ' -shared'
292    
293    if env['BADPYTHONMACROS']:
294        env.Append(CPPDEFINES = ['BADPYTHONMACROS'])
295    
296    if env['longindices']:
297        env.Append(CPPDEFINES = ['ESYS_INDEXTYPE_LONG'])
298    
299  if env['usepython3']:  if env['usepython3']:
300      env.Append(CPPDEFINES=['ESPYTHON3'])      env.Append(CPPDEFINES=['ESPYTHON3'])
# Line 436  env=checkPython(env) Line 456  env=checkPython(env)
456  ######## boost & boost-python (required)  ######## boost & boost-python (required)
457  env=checkBoost(env)  env=checkBoost(env)
458    
459    ######## NVCC version (optional)
460    if env['cuda']:
461        env=checkCudaVersion(env)
462    
463  ######## numpy (required) and numpy headers (optional)  ######## numpy (required) and numpy headers (optional)
464  env=checkNumpy(env)  env=checkNumpy(env)
465    
# Line 494  Export( Line 518  Export(
518    ]    ]
519  )  )
520    
521    #do not auto build
522  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)
523  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)
524  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)
525  env.SConscript(dirs = ['escript/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)
526    
527    env.SConscript(dirs = ['cusplibrary'])
528    
529  #This will pull in the escriptcore/py_src and escriptcore/test  #This will pull in the escriptcore/py_src and escriptcore/test
530  env.SConscript(dirs = ['escriptcore/src'], variant_dir='$BUILD_DIR/$PLATFORM/escriptcore', duplicate=0)  env.SConscript(dirs = ['escriptcore/src'], variant_dir='$BUILD_DIR/$PLATFORM/escriptcore', duplicate=0)
531  #env.SConscript(dirs = ['escript/test'], variant_dir='$BUILD_DIR/$PLATFORM/escript/test', duplicate=0)  #env.SConscript(dirs = ['escript/test'], variant_dir='$BUILD_DIR/$PLATFORM/escript/test', duplicate=0)
532  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)
533  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)
534  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)  if 'dudley' in env['domains']:
535  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)      env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)
536  env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)  if 'finley' in env['domains']:
537  env.SConscript(dirs = ['speckley/src'], variant_dir='$BUILD_DIR/$PLATFORM/speckley', duplicate=0)      env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)
538    if 'ripley' in env['domains']:
539        env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)
540    if 'speckley' in env['domains']:
541        env.SConscript(dirs = ['speckley/src'], variant_dir='$BUILD_DIR/$PLATFORM/speckley', duplicate=0)
542  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)
543  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)
544  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 541  env.Alias('install_escript', ['build_esc Line 572  env.Alias('install_escript', ['build_esc
572  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'])
573  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'])
574    
575  env.Alias('build_dudley', ['install_dudley_headers', 'build_dudley_lib', 'build_dudleycpp_lib'])  if 'dudley' in env['domains']:
576  env.Alias('install_dudley', ['build_dudley', 'install_dudley_lib', 'install_dudleycpp_lib', 'install_dudley_py'])      env.Alias('build_dudley', ['install_dudley_headers', 'build_dudley_lib', 'build_dudleycpp_lib'])
577        env.Alias('install_dudley', ['build_dudley', 'install_dudley_lib', 'install_dudleycpp_lib', 'install_dudley_py'])
578  env.Alias('build_finley', ['install_finley_headers', 'build_finley_lib', 'build_finleycpp_lib'])  
579  env.Alias('install_finley', ['build_finley', 'install_finley_lib', 'install_finleycpp_lib', 'install_finley_py'])  if 'finley' in env['domains']:
580        env.Alias('build_finley', ['install_finley_headers', 'build_finley_lib', 'build_finleycpp_lib'])
581  env.Alias('build_ripley', ['install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])      env.Alias('install_finley', ['build_finley', 'install_finley_lib', 'install_finleycpp_lib', 'install_finley_py'])
582  env.Alias('install_ripley', ['build_ripley', 'install_ripley_lib', 'install_ripleycpp_lib', 'install_ripley_py'])  
583    if 'ripley' in env['domains']:
584  env.Alias('build_speckley', ['install_speckley_headers', 'build_speckley_lib', 'build_speckleycpp_lib'])      env.Alias('build_ripley', ['install_cusp_headers', 'install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])
585  env.Alias('install_speckley', ['build_speckley', 'install_speckley_lib', 'install_speckleycpp_lib', 'install_speckley_py'])      env.Alias('install_ripley', ['build_ripley', 'install_ripley_lib', 'install_ripleycpp_lib', 'install_ripley_py'])
586    
587    if 'speckley' in env['domains']:
588        env.Alias('build_speckley', ['install_speckley_headers', 'build_speckley_lib', 'build_speckleycpp_lib'])
589        env.Alias('install_speckley', ['build_speckley', 'install_speckley_lib', 'install_speckleycpp_lib', 'install_speckley_py'])
590    
591  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'])
592  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'])
# Line 565  build_all_list += ['build_esysUtils'] Line 600  build_all_list += ['build_esysUtils']
600  build_all_list += ['build_paso']  build_all_list += ['build_paso']
601  build_all_list += ['build_escript']  build_all_list += ['build_escript']
602  build_all_list += ['build_pasowrap']  build_all_list += ['build_pasowrap']
603  build_all_list += ['build_dudley']  if 'dudley' in env['domains']: build_all_list += ['build_dudley']
604  build_all_list += ['build_finley']  if 'finley' in env['domains']: build_all_list += ['build_finley']
605  build_all_list += ['build_ripley']  if 'ripley' in env['domains']: build_all_list += ['build_ripley']
606  build_all_list += ['build_speckley']  if 'speckley' in env['domains']: build_all_list += ['build_speckley']
607  build_all_list += ['build_weipa']  build_all_list += ['build_weipa']
608  if not IS_WINDOWS: build_all_list += ['build_escriptreader']  if not IS_WINDOWS and 'finley' in env['domains']:
609        build_all_list += ['build_escriptreader']
610  if env['usempi']:   build_all_list += ['build_pythonMPI']  if env['usempi']:   build_all_list += ['build_pythonMPI']
 build_all_list += ['build_escriptconvert']  
611  env.Alias('build_all', build_all_list)  env.Alias('build_all', build_all_list)
612    
613  install_all_list = []  install_all_list = []
# Line 581  install_all_list += ['install_esysUtils' Line 616  install_all_list += ['install_esysUtils'
616  install_all_list += ['install_paso']  install_all_list += ['install_paso']
617  install_all_list += ['install_escript']  install_all_list += ['install_escript']
618  install_all_list += ['install_pasowrap']  install_all_list += ['install_pasowrap']
619  install_all_list += ['install_dudley']  if 'dudley' in env['domains']: install_all_list += ['install_dudley']
620  install_all_list += ['install_finley']  if 'finley' in env['domains']: install_all_list += ['install_finley']
621  install_all_list += ['install_ripley']  if 'ripley' in env['domains']: install_all_list += ['install_ripley']
622  install_all_list += ['install_speckley']  if 'speckley' in env['domains']: install_all_list += ['install_speckley']
623  install_all_list += ['install_weipa']  install_all_list += ['install_weipa']
624  if not IS_WINDOWS: install_all_list += ['install_escriptreader']  if not IS_WINDOWS and 'finley' in env['domains']:
625        install_all_list += ['install_escriptreader']
626  install_all_list += ['install_downunder_py']  install_all_list += ['install_downunder_py']
627  install_all_list += ['install_modellib_py']  install_all_list += ['install_modellib_py']
628  install_all_list += ['install_pycad_py']  install_all_list += ['install_pycad_py']
629  if env['usempi']:   install_all_list += ['install_pythonMPI']  if env['usempi']:   install_all_list += ['install_pythonMPI']
 install_all_list += ['install_escriptconvert']  
630  env.Alias('install_all', install_all_list)  env.Alias('install_all', install_all_list)
631    
632  # Default target is install  # Default target is install
# Line 645  def print_summary(): Line 680  def print_summary():
680          print("          LAPACK:  YES (flavour: %s)"%env['lapack'])          print("          LAPACK:  YES (flavour: %s)"%env['lapack'])
681      else:      else:
682          print("          LAPACK:  DISABLED")          print("          LAPACK:  DISABLED")
683        if env['cuda']:
684            print("            CUDA:  YES (nvcc: %s)"%env['nvcc_version'])
685        else:
686            print("            CUDA:  DISABLED")
687      d_list=[]      d_list=[]
688      e_list=[]      e_list=[]
689      for i in 'debug','openmp','boomeramg','gdal','mkl','netcdf','papi','parmetis','pyproj','scipy','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':

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

  ViewVC Help
Powered by ViewVC 1.1.26