/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3585 by caltinay, Wed Sep 7 06:16:08 2011 UTC revision 3598 by caltinay, Fri Sep 16 01:01:17 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 119  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 440  except ImportError: Line 442  except ImportError:
442      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)
443      Exit(1)      Exit(1)
444    
445    ######## CppUnit (required for tests)
446    
447    try:
448        cppunit_inc_path,cppunit_lib_path=findLibWithHeader(env, env['cppunit_libs'], 'cppunit/TestFixture.h', env['cppunit_prefix'], lang='c++')
449        env.AppendUnique(CPPPATH = [cppunit_inc_path])
450        env.AppendUnique(LIBPATH = [cppunit_lib_path])
451        env.PrependENVPath(LD_LIBRARY_PATH_KEY, cppunit_lib_path)
452        env['cppunit']=True
453    except:
454        env['cppunit']=False
455    
456  ######## VTK (optional)  ######## VTK (optional)
457    
458  if env['pyvisi']:  if env['pyvisi']:
# Line 563  if env['usempi']: Line 576  if env['usempi']:
576    
577  ######## BOOMERAMG (optional)  ######## BOOMERAMG (optional)
578    
 #if env['boomeramg'] and env['mpi'] == 'none':  
 #    print("boomeramg requires mpi!")  
 #    Exit(1)  
579  if env['mpi'] == 'none': env['boomeramg'] = False  if env['mpi'] == 'none': env['boomeramg'] = False
580    
581  boomeramg_inc_path=''  boomeramg_inc_path=''
# Line 574  if env['boomeramg']: Line 584  if env['boomeramg']:
584      boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c')      boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c')
585      env.AppendUnique(CPPPATH = [boomeramg_inc_path])      env.AppendUnique(CPPPATH = [boomeramg_inc_path])
586      env.AppendUnique(LIBPATH = [boomeramg_lib_path])      env.AppendUnique(LIBPATH = [boomeramg_lib_path])
     # Note that we do not add the libs since they are only needed for the  
     # weipa library and tools.  
587      env.AppendUnique(LIBS = env['boomeramg_libs'])      env.AppendUnique(LIBS = env['boomeramg_libs'])
588      env.PrependENVPath(LD_LIBRARY_PATH_KEY, boomeramg_lib_path)      env.PrependENVPath(LD_LIBRARY_PATH_KEY, boomeramg_lib_path)
589      env.Append(CPPDEFINES = ['BOOMERAMG'])      env.Append(CPPDEFINES = ['BOOMERAMG'])
# Line 652  for i in e_list: Line 660  for i in e_list:
660      print("%16s:  YES"%i)      print("%16s:  YES"%i)
661  for i in d_list:  for i in d_list:
662      print("%16s:  DISABLED"%i)      print("%16s:  DISABLED"%i)
663    if env['cppunit']:
664        print("         CppUnit:  FOUND")
665    else:
666        print("         CppUnit:  NOT FOUND")
667  if env['gmsh']=='m':  if env['gmsh']=='m':
668      print("            gmsh:  FOUND, MPI-ENABLED")      print("            gmsh:  FOUND, MPI-ENABLED")
669  elif env['gmsh']=='s':  elif env['gmsh']=='s':
# Line 688  Export( Line 700  Export(
700    ]    ]
701  )  )
702    
 env.SConscript(dirs = ['tools/CppUnitTest/src'], variant_dir='$BUILD_DIR/$PLATFORM/tools/CppUnitTest', duplicate=0)  
703  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)
704  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)
705  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 809  env.Default('install_all') Line 820  env.Default('install_all')
820    
821  ################## Targets to build and run the test suite ###################  ################## Targets to build and run the test suite ###################
822    
823  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')
824  env.Alias('install_cppunittest', ['build_cppunittest', 'install_cppunittest_lib'])  if not env['cppunit']:
825  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])      env.Alias('run_tests', test_msg)
826  env.Alias('all_tests', ['install_all', 'install_cppunittest_lib', 'run_tests', 'py_tests'])  env.Alias('run_tests', ['install_all'])
827    env.Alias('all_tests', ['install_all', 'run_tests', 'py_tests'])
828  env.Alias('build_full',['install_all','build_tests','build_py_tests'])  env.Alias('build_full',['install_all','build_tests','build_py_tests'])
829  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')
830    

Legend:
Removed from v.3585  
changed lines
  Added in v.3598

  ViewVC Help
Powered by ViewVC 1.1.26