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

Diff of /branches/diaplayground/SConstruct

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

revision 3597 by caltinay, Thu Sep 15 06:03:17 2011 UTC revision 3784 by caltinay, Wed Jan 25 01:31:42 2012 UTC
# Line 47  if not os.path.isfile(options_file): Line 47  if not os.path.isfile(options_file):
47  ############################### Build options ################################  ############################### Build options ################################
48    
49  default_prefix='/usr'  default_prefix='/usr'
50  mpi_flavours=('none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI')  mpi_flavours=('no', 'none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI')
51  lapack_flavours=('none', 'clapack', 'mkl')  lapack_flavours=('none', 'clapack', 'mkl')
52    
53  vars = Variables(options_file, ARGUMENTS)  vars = Variables(options_file, ARGUMENTS)
# Line 122  vars.AddVariables( Line 122  vars.AddVariables(
122    EnumVariable('forcecollres', 'For testing use only - set the default value for force resolving collective ops', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')),    EnumVariable('forcecollres', 'For testing use only - set the default value for force resolving collective ops', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')),
123    # finer control over library building, intel aggressive global optimisation    # finer control over library building, intel aggressive global optimisation
124    # works with dynamic libraries on windows.    # works with dynamic libraries on windows.
125    ('share_esysutils', 'Build a dynamic esysUtils library', False),    ('build_shared', 'Build dynamic libraries only', False),
   ('share_paso', 'Build a dynamic paso library', False),  
126    ('sys_libs', 'Extra libraries to link with', []),    ('sys_libs', 'Extra libraries to link with', []),
127    ('escript_opts_version', 'Version of options file (do not specify on command line)'),    ('escript_opts_version', 'Version of options file (do not specify on command line)'),
128      ('SVN_VERSION', 'Do not use from options file', -2),
129  )  )
130    
131  ##################### Create environment and help text #######################  ##################### Create environment and help text #######################
# Line 284  env.Append(CCFLAGS = env['cc_flags']) Line 284  env.Append(CCFLAGS = env['cc_flags'])
284  # add system libraries  # add system libraries
285  env.AppendUnique(LIBS = env['sys_libs'])  env.AppendUnique(LIBS = env['sys_libs'])
286    
287  # Get the global Subversion revision number for the getVersion() method  
288  try:  global_revision=ARGUMENTS.get('SVN_VERSION', None)
289    if global_revision:
290        global_revision = re.sub(':.*', '', global_revision)
291        global_revision = re.sub('[^0-9]', '', global_revision)
292        if global_revision == '': global_revision='-2'
293    else:
294      # Get the global Subversion revision number for the getVersion() method
295      try:
296      global_revision = os.popen('svnversion -n .').read()      global_revision = os.popen('svnversion -n .').read()
297      global_revision = re.sub(':.*', '', global_revision)      global_revision = re.sub(':.*', '', global_revision)
298      global_revision = re.sub('[^0-9]', '', global_revision)      global_revision = re.sub('[^0-9]', '', global_revision)
299      if global_revision == '': global_revision='-2'      if global_revision == '': global_revision='-2'
300  except:    except:
301      global_revision = '-1'      global_revision = '-1'
302  env['svn_revision']=global_revision  env['svn_revision']=global_revision
303  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])
304    
305  if IS_WINDOWS:  if IS_WINDOWS:
306      if not env['share_esysutils']:      if not env['build_shared']:
307          env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB'])          env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB'])
     if not env['share_paso']:  
308          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])
309    
310  ###################### Copy required environment vars ########################  ###################### Copy required environment vars ########################
# Line 415  if not conf.CheckFunc('Py_Exit'): Line 421  if not conf.CheckFunc('Py_Exit'):
421      print("Cannot find python library method Py_Main (tried %s in directory %s)" % (python_libs, python_lib_path))      print("Cannot find python library method Py_Main (tried %s in directory %s)" % (python_libs, python_lib_path))
422      Exit(1)      Exit(1)
423    
424    # reuse conf to check for numpy header (optional)
425    if conf.CheckCXXHeader(['Python.h','numpy/ndarrayobject.h']):
426        conf.env.Append(CPPDEFINES = ['HAVE_NUMPY_H'])
427        conf.env['numpy_h']=True
428    else:
429        conf.env['numpy_h']=False
430    
431  # Commit changes to environment  # Commit changes to environment
432  env = conf.Finish()  env = conf.Finish()
433    
# Line 559  if env['visit']: Line 572  if env['visit']:
572    
573  ######## MPI (optional)  ######## MPI (optional)
574    
575    if env['mpi']=='no':
576        env['mpi']='none'
577    
578  env['usempi'] = env['mpi']!='none'  env['usempi'] = env['mpi']!='none'
579  mpi_inc_path=''  mpi_inc_path=''
580  mpi_lib_path=''  mpi_lib_path=''
# Line 616  try: Line 632  try:
632  except OSError:  except OSError:
633      env['gmsh']=False      env['gmsh']=False
634    
635    ######## PDFLaTeX (for documentation)
636    if 'PDF' in dir(env) and '.tex' in env.PDF.builder.src_suffixes(env):
637        env['pdflatex']=True
638    else:
639        env['pdflatex']=False
640    
641  ######################## Summarize our environment ###########################  ######################## Summarize our environment ###########################
642    
643  # keep some of our install paths first in the list for the unit tests  # keep some of our install paths first in the list for the unit tests
# Line 654  else: Line 676  else:
676      print("          LAPACK:  DISABLED")      print("          LAPACK:  DISABLED")
677  d_list=[]  d_list=[]
678  e_list=[]  e_list=[]
679  for i in 'debug','openmp','netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit':  for i in 'debug','openmp','netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit','vsl_random':
680      if env[i]: e_list.append(i)      if env[i]: e_list.append(i)
681      else: d_list.append(i)      else: d_list.append(i)
682  for i in e_list:  for i in e_list:
# Line 671  elif env['gmsh']=='s': Line 693  elif env['gmsh']=='s':
693      print("            gmsh:  FOUND")      print("            gmsh:  FOUND")
694  else:  else:
695      print("            gmsh:  NOT FOUND")      print("            gmsh:  NOT FOUND")
696  print("      vsl_random:  %s"%env['vsl_random'])  if env['numpy_h']:
697        print("   numpy headers:  FOUND")
698    else:
699        print("   numpy headers:  NOT FOUND")
700            
701  if ((fatalwarning != '') and (env['werror'])):  if ((fatalwarning != '') and (env['werror'])):
702      print("  Treating warnings as errors")      print("  Treating warnings as errors")
# Line 706  env.SConscript(dirs = ['paso/src'], vari Line 731  env.SConscript(dirs = ['paso/src'], vari
731  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)
732  env.SConscript(dirs = ['escript/src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)
733  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)
734    env.SConscript(dirs = ['pasowrap/src'], variant_dir='$BUILD_DIR/$PLATFORM/pasowrap', duplicate=0)
735  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)
736  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)
737  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)
# Line 761  buildvars.close() Line 787  buildvars.close()
787    
788  ################### Targets to build and install libraries ###################  ################### Targets to build and install libraries ###################
789    
790  target_init = env.Command(env['pyinstall']+'/__init__.py', None, Touch('$TARGET'))  target_init = env.Command(os.path.join(env['pyinstall'],'__init__.py'), None, Touch('$TARGET'))
791  env.Alias('target_init', [target_init])  env.Alias('target_init', [target_init])
792    # delete buildvars upon cleanup
793    env.Clean('target_init', os.path.join(env['libinstall'], 'buildvars'))
794    
795  # 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
796  # #include <paso/Common.h>  # #include <paso/Common.h>
# Line 775  env.Alias('install_paso', ['build_paso', Line 803  env.Alias('install_paso', ['build_paso',
803  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'])
804  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_escript_py'])
805    
806    env.Alias('build_pasowrap', ['install_pasowrap_headers', 'build_pasowrap_lib', 'build_pasowrapcpp_lib'])
807    env.Alias('install_pasowrap', ['build_pasowrap', 'install_pasowrap_lib', 'install_pasowrapcpp_lib', 'install_pasowrap_py'])
808    
809    
810  env.Alias('build_dudley', ['install_dudley_headers', 'build_dudley_lib', 'build_dudleycpp_lib'])  env.Alias('build_dudley', ['install_dudley_headers', 'build_dudley_lib', 'build_dudleycpp_lib'])
811  env.Alias('install_dudley', ['build_dudley', 'install_dudley_lib', 'install_dudleycpp_lib', 'install_dudley_py'])  env.Alias('install_dudley', ['build_dudley', 'install_dudley_lib', 'install_dudleycpp_lib', 'install_dudley_py'])
812    
# Line 792  build_all_list = [] Line 824  build_all_list = []
824  build_all_list += ['build_esysUtils']  build_all_list += ['build_esysUtils']
825  build_all_list += ['build_paso']  build_all_list += ['build_paso']
826  build_all_list += ['build_escript']  build_all_list += ['build_escript']
827    build_all_list += ['build_pasowrap']
828  build_all_list += ['build_dudley']  build_all_list += ['build_dudley']
829  build_all_list += ['build_finley']  build_all_list += ['build_finley']
830  build_all_list += ['build_weipa']  build_all_list += ['build_weipa']
# Line 805  install_all_list += ['target_init'] Line 838  install_all_list += ['target_init']
838  install_all_list += ['install_esysUtils']  install_all_list += ['install_esysUtils']
839  install_all_list += ['install_paso']  install_all_list += ['install_paso']
840  install_all_list += ['install_escript']  install_all_list += ['install_escript']
841    install_all_list += ['install_pasowrap']
842  install_all_list += ['install_dudley']  install_all_list += ['install_dudley']
843  install_all_list += ['install_finley']  install_all_list += ['install_finley']
844  install_all_list += ['install_weipa']  install_all_list += ['install_weipa']
# Line 848  if not IS_WINDOWS: Line 882  if not IS_WINDOWS:
882          print("Error attempting to write unittests file.")          print("Error attempting to write unittests file.")
883          Exit(1)          Exit(1)
884    
885        # delete utest.sh upon cleanup
886        env.Clean('target_init', 'utest.sh')
887    
888      # Make sure that the escript wrapper is in place      # Make sure that the escript wrapper is in place
889      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):
890          print("Copying escript wrapper.")          print("Copying escript wrapper.")

Legend:
Removed from v.3597  
changed lines
  Added in v.3784

  ViewVC Help
Powered by ViewVC 1.1.26