/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3506 by jfenwick, Wed May 11 01:59:45 2011 UTC revision 3602 by caltinay, Mon Sep 19 02:38:11 2011 UTC
# Line 19  from site_init import * Line 19  from site_init import *
19    
20  # 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
21  # added or existing options changed.  # added or existing options changed.
22  REQUIRED_OPTS_VERSION=200  REQUIRED_OPTS_VERSION=201
23    
24  # MS Windows support, many thanks to PH  # MS Windows support, many thanks to PH
25  IS_WINDOWS = (os.name == 'nt')  IS_WINDOWS = (os.name == 'nt')
# Line 73  vars.AddVariables( Line 73  vars.AddVariables(
73  # Mandatory libraries  # Mandatory libraries
74    ('boost_prefix', 'Prefix/Paths of boost installation', default_prefix),    ('boost_prefix', 'Prefix/Paths of boost installation', default_prefix),
75    ('boost_libs', 'Boost libraries to link with', ['boost_python-mt']),    ('boost_libs', 'Boost libraries to link with', ['boost_python-mt']),
76    # Mandatory for tests
77      ('cppunit_prefix', 'Prefix/Paths of CppUnit installation', default_prefix),
78      ('cppunit_libs', 'CppUnit libraries to link with', ['cppunit']),
79  # Optional libraries and options  # Optional libraries and options
80    EnumVariable('mpi', 'Compile parallel version using MPI flavour', 'none', allowed_values=mpi_flavours),    EnumVariable('mpi', 'Compile parallel version using MPI flavour', 'none', allowed_values=mpi_flavours),
81    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),
# Line 93  vars.AddVariables( Line 96  vars.AddVariables(
96    BoolVariable('umfpack', 'Enable UMFPACK', False),    BoolVariable('umfpack', 'Enable UMFPACK', False),
97    ('umfpack_prefix', 'Prefix/Paths to UMFPACK installation', default_prefix),    ('umfpack_prefix', 'Prefix/Paths to UMFPACK installation', default_prefix),
98    ('umfpack_libs', 'UMFPACK libraries to link with', ['umfpack']),    ('umfpack_libs', 'UMFPACK libraries to link with', ['umfpack']),
99      BoolVariable('boomeramg', 'Enable BoomerAMG', False),
100      ('boomeramg_prefix', 'Prefix/Paths to BoomerAMG installation', default_prefix),
101      ('boomeramg_libs', 'BoomerAMG libraries to link with', ['boomeramg']),
102    EnumVariable('lapack', 'Set LAPACK flavour', 'none', allowed_values=lapack_flavours),    EnumVariable('lapack', 'Set LAPACK flavour', 'none', allowed_values=lapack_flavours),
103    ('lapack_prefix', 'Prefix/Paths to LAPACK installation', default_prefix),    ('lapack_prefix', 'Prefix/Paths to LAPACK installation', default_prefix),
104    ('lapack_libs', 'LAPACK libraries to link with', []),    ('lapack_libs', 'LAPACK libraries to link with', []),
# Line 116  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  )  )
# Line 290  env['svn_revision']=global_revision Line 295  env['svn_revision']=global_revision
295  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])
296    
297  if IS_WINDOWS:  if IS_WINDOWS:
298      if not env['share_esysutils']:      if not env['build_shared']:
299          env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB'])          env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB'])
     if not env['share_paso']:  
300          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])
301    
302  ###################### Copy required environment vars ########################  ###################### Copy required environment vars ########################
# Line 437  except ImportError: Line 441  except ImportError:
441      print("Cannot import numpy, you need to set your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)      print("Cannot import numpy, you need to set your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)
442      Exit(1)      Exit(1)
443    
444    ######## CppUnit (required for tests)
445    
446    try:
447        cppunit_inc_path,cppunit_lib_path=findLibWithHeader(env, env['cppunit_libs'], 'cppunit/TestFixture.h', env['cppunit_prefix'], lang='c++')
448        env.AppendUnique(CPPPATH = [cppunit_inc_path])
449        env.AppendUnique(LIBPATH = [cppunit_lib_path])
450        env.PrependENVPath(LD_LIBRARY_PATH_KEY, cppunit_lib_path)
451        env['cppunit']=True
452    except:
453        env['cppunit']=False
454    
455  ######## VTK (optional)  ######## VTK (optional)
456    
457  if env['pyvisi']:  if env['pyvisi']:
# Line 558  if env['usempi']: Line 573  if env['usempi']:
573      if env['netcdf'] and env['mpi'] in ['MPT','OPENMPI']:      if env['netcdf'] and env['mpi'] in ['MPT','OPENMPI']:
574          env.Append(CPPDEFINES = ['MPI_INCLUDED'])          env.Append(CPPDEFINES = ['MPI_INCLUDED'])
575    
576    ######## BOOMERAMG (optional)
577    
578    if env['mpi'] == 'none': env['boomeramg'] = False
579    
580    boomeramg_inc_path=''
581    boomeramg_lib_path=''
582    if env['boomeramg']:
583        boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c')
584        env.AppendUnique(CPPPATH = [boomeramg_inc_path])
585        env.AppendUnique(LIBPATH = [boomeramg_lib_path])
586        env.AppendUnique(LIBS = env['boomeramg_libs'])
587        env.PrependENVPath(LD_LIBRARY_PATH_KEY, boomeramg_lib_path)
588        env.Append(CPPDEFINES = ['BOOMERAMG'])
589    
590  ######## ParMETIS (optional)  ######## ParMETIS (optional)
591    
592  if not env['usempi']: env['parmetis'] = False  if not env['usempi']: env['parmetis'] = False
# Line 576  if env['parmetis']: Line 605  if env['parmetis']:
605    
606  try:  try:
607      import subprocess      import subprocess
608      p=subprocess.Popen(['gmsh', '-version'], stderr=subprocess.PIPE)      p=subprocess.Popen(['gmsh', '-info'], stderr=subprocess.PIPE)
609      p.poll()      _,e=p.communicate()
610      env['gmsh']=True      if e.split().count("MPI"):
611            env['gmsh']='m'
612        else:
613            env['gmsh']='s'
614  except OSError:  except OSError:
615      env['gmsh']=False      env['gmsh']=False
616    
# Line 620  else: Line 652  else:
652      print("          LAPACK:  DISABLED")      print("          LAPACK:  DISABLED")
653  d_list=[]  d_list=[]
654  e_list=[]  e_list=[]
655  for i in 'debug','openmp','netcdf','parmetis','papi','mkl','umfpack','silo','visit':  for i in 'debug','openmp','netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit':
656      if env[i]: e_list.append(i)      if env[i]: e_list.append(i)
657      else: d_list.append(i)      else: d_list.append(i)
658  for i in e_list:  for i in e_list:
659      print("%16s:  YES"%i)      print("%16s:  YES"%i)
660  for i in d_list:  for i in d_list:
661      print("%16s:  DISABLED"%i)      print("%16s:  DISABLED"%i)
662  if env['gmsh']:  if env['cppunit']:
663        print("         CppUnit:  FOUND")
664    else:
665        print("         CppUnit:  NOT FOUND")
666    if env['gmsh']=='m':
667        print("            gmsh:  FOUND, MPI-ENABLED")
668    elif env['gmsh']=='s':
669      print("            gmsh:  FOUND")      print("            gmsh:  FOUND")
670  else:  else:
671      print("            gmsh:  NOT FOUND")      print("            gmsh:  NOT FOUND")
# Line 661  Export( Line 699  Export(
699    ]    ]
700  )  )
701    
 env.SConscript(dirs = ['tools/CppUnitTest/src'], variant_dir='$BUILD_DIR/$PLATFORM/tools/CppUnitTest', duplicate=0)  
702  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)
703  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)
704  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)
# Line 712  buildvars.write("mpi_inc_path=%s\n"%mpi_ Line 749  buildvars.write("mpi_inc_path=%s\n"%mpi_
749  buildvars.write("mpi_lib_path=%s\n"%mpi_lib_path)  buildvars.write("mpi_lib_path=%s\n"%mpi_lib_path)
750  buildvars.write("lapack=%s\n"%env['lapack'])  buildvars.write("lapack=%s\n"%env['lapack'])
751  buildvars.write("pyvisi=%d\n"%env['pyvisi'])  buildvars.write("pyvisi=%d\n"%env['pyvisi'])
752  buildvars.write("vsl_random=%d"%int(env['vsl_random']))  buildvars.write("vsl_random=%d\n"%int(env['vsl_random']))
753  for i in 'netcdf','parmetis','papi','mkl','umfpack','silo','visit':  for i in 'netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit':
754      buildvars.write("%s=%d\n"%(i, int(env[i])))      buildvars.write("%s=%d\n"%(i, int(env[i])))
755      if env[i]:      if env[i]:
756          buildvars.write("%s_inc_path=%s\n"%(i, eval(i+'_inc_path')))          buildvars.write("%s_inc_path=%s\n"%(i, eval(i+'_inc_path')))
# Line 782  env.Default('install_all') Line 819  env.Default('install_all')
819    
820  ################## Targets to build and run the test suite ###################  ################## Targets to build and run the test suite ###################
821    
822  env.Alias('build_cppunittest', ['install_cppunittest_headers', 'build_cppunittest_lib'])  test_msg = env.Command('.dummy.', None, '@echo "Cannot run C/C++ unit tests, CppUnit not found!";exit 1')
823  env.Alias('install_cppunittest', ['build_cppunittest', 'install_cppunittest_lib'])  if not env['cppunit']:
824  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])      env.Alias('run_tests', test_msg)
825  env.Alias('all_tests', ['install_all', 'install_cppunittest_lib', 'run_tests', 'py_tests'])  env.Alias('run_tests', ['install_all'])
826    env.Alias('all_tests', ['install_all', 'run_tests', 'py_tests'])
827  env.Alias('build_full',['install_all','build_tests','build_py_tests'])  env.Alias('build_full',['install_all','build_tests','build_py_tests'])
828  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')
829    

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

  ViewVC Help
Powered by ViewVC 1.1.26