/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3602 by caltinay, Mon Sep 19 02:38:11 2011 UTC revision 3675 by jfenwick, Thu Nov 17 00:53:38 2011 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 125  vars.AddVariables( Line 125  vars.AddVariables(
125    ('build_shared', 'Build dynamic libraries only', False),    ('build_shared', 'Build dynamic libraries only', 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 283  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])
# Line 557  if env['visit']: Line 565  if env['visit']:
565    
566  ######## MPI (optional)  ######## MPI (optional)
567    
568    if env['mpi']=='no':
569        env['mpi']='none'
570    
571  env['usempi'] = env['mpi']!='none'  env['usempi'] = env['mpi']!='none'
572  mpi_inc_path=''  mpi_inc_path=''
573  mpi_lib_path=''  mpi_lib_path=''
# Line 614  try: Line 625  try:
625  except OSError:  except OSError:
626      env['gmsh']=False      env['gmsh']=False
627    
628    ######## PDFLaTeX (for documentation)
629    if 'PDF' in dir(env) and '.tex' in env.PDF.builder.src_suffixes(env):
630        env['pdflatex']=True
631    else:
632        env['pdflatex']=False
633    
634  ######################## Summarize our environment ###########################  ######################## Summarize our environment ###########################
635    
636  # 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 704  env.SConscript(dirs = ['paso/src'], vari Line 721  env.SConscript(dirs = ['paso/src'], vari
721  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)
722  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)
723  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)
724    env.SConscript(dirs = ['pasowrap/src'], variant_dir='$BUILD_DIR/$PLATFORM/pasowrap', duplicate=0)
725  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)
726  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)
727  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 759  buildvars.close() Line 777  buildvars.close()
777    
778  ################### Targets to build and install libraries ###################  ################### Targets to build and install libraries ###################
779    
780  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'))
781  env.Alias('target_init', [target_init])  env.Alias('target_init', [target_init])
782    # delete buildvars upon cleanup
783    env.Clean('target_init', os.path.join(env['libinstall'], 'buildvars'))
784    
785  # 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
786  # #include <paso/Common.h>  # #include <paso/Common.h>
# Line 773  env.Alias('install_paso', ['build_paso', Line 793  env.Alias('install_paso', ['build_paso',
793  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'])
794  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'])
795    
796    env.Alias('build_pasowrap', ['install_pasowrap_headers', 'build_pasowrap_lib', 'build_pasowrapcpp_lib'])
797    env.Alias('install_pasowrap', ['build_pasowrap', 'install_pasowrap_lib', 'install_pasowrapcpp_lib', 'install_pasowrap_py'])
798    
799    
800  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'])
801  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'])
802    
# Line 790  build_all_list = [] Line 814  build_all_list = []
814  build_all_list += ['build_esysUtils']  build_all_list += ['build_esysUtils']
815  build_all_list += ['build_paso']  build_all_list += ['build_paso']
816  build_all_list += ['build_escript']  build_all_list += ['build_escript']
817    build_all_list += ['build_pasowrap']
818  build_all_list += ['build_dudley']  build_all_list += ['build_dudley']
819  build_all_list += ['build_finley']  build_all_list += ['build_finley']
820  build_all_list += ['build_weipa']  build_all_list += ['build_weipa']
# Line 803  install_all_list += ['target_init'] Line 828  install_all_list += ['target_init']
828  install_all_list += ['install_esysUtils']  install_all_list += ['install_esysUtils']
829  install_all_list += ['install_paso']  install_all_list += ['install_paso']
830  install_all_list += ['install_escript']  install_all_list += ['install_escript']
831    install_all_list += ['install_pasowrap']
832  install_all_list += ['install_dudley']  install_all_list += ['install_dudley']
833  install_all_list += ['install_finley']  install_all_list += ['install_finley']
834  install_all_list += ['install_weipa']  install_all_list += ['install_weipa']
# Line 846  if not IS_WINDOWS: Line 872  if not IS_WINDOWS:
872          print("Error attempting to write unittests file.")          print("Error attempting to write unittests file.")
873          Exit(1)          Exit(1)
874    
875        # delete utest.sh upon cleanup
876        env.Clean('target_init', 'utest.sh')
877    
878      # Make sure that the escript wrapper is in place      # Make sure that the escript wrapper is in place
879      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):
880          print("Copying escript wrapper.")          print("Copying escript wrapper.")

Legend:
Removed from v.3602  
changed lines
  Added in v.3675

  ViewVC Help
Powered by ViewVC 1.1.26