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

Diff of /branches/dirac/SConstruct

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

revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 3393 by caltinay, Fri Dec 3 04:14:56 2010 UTC
# Line 54  vars = Variables(options_file, ARGUMENTS Line 54  vars = Variables(options_file, ARGUMENTS
54  vars.AddVariables(  vars.AddVariables(
55    PathVariable('options_file', 'Path to options file', options_file, PathVariable.PathIsFile),    PathVariable('options_file', 'Path to options file', options_file, PathVariable.PathIsFile),
56    PathVariable('prefix', 'Installation prefix', Dir('#.').abspath, PathVariable.PathIsDirCreate),    PathVariable('prefix', 'Installation prefix', Dir('#.').abspath, PathVariable.PathIsDirCreate),
57      PathVariable('build_dir', 'Top-level build directory', Dir('#/build').abspath, PathVariable.PathIsDirCreate),
58    BoolVariable('verbose', 'Output full compile/link lines', False),    BoolVariable('verbose', 'Output full compile/link lines', False),
59  # Compiler/Linker options  # Compiler/Linker options
60    ('cc', 'Path to C compiler', 'default'),    ('cc', 'Path to C compiler', 'default'),
# Line 71  vars.AddVariables( Line 72  vars.AddVariables(
72    ('omp_ldflags', 'OpenMP linker flags', 'default'),    ('omp_ldflags', 'OpenMP linker flags', 'default'),
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']),    ('boost_libs', 'Boost libraries to link with', ['boost_python-mt']),
76  # Optional libraries and options  # Optional libraries and options
77    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),
78    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),
# Line 125  vars.AddVariables( Line 126  vars.AddVariables(
126  # Intel's compiler uses regular expressions improperly and emits a warning  # Intel's compiler uses regular expressions improperly and emits a warning
127  # about failing to find the compilers. This warning can be safely ignored.  # about failing to find the compilers. This warning can be safely ignored.
128    
129  env = Environment(tools = ['default'], options = vars)  # PATH is needed so the compiler, linker and tools are found if they are not
130    # in default locations.
131    env = Environment(tools = ['default'], options = vars,
132                      ENV = {'PATH': os.environ['PATH']})
133  if env['tools_names'] != 'default':  if env['tools_names'] != 'default':
134      env = Environment(tools = ['default'] + env['tools_names'], options = vars)      env = Environment(tools = ['default'] + env['tools_names'], options = vars,
135                          ENV = {'PATH' : os.environ['PATH']})
136    
137  if options_file:  if options_file:
138      opts_valid=False      opts_valid=False
# Line 146  if options_file: Line 151  if options_file:
151  Help(vars.GenerateHelpText(env))  Help(vars.GenerateHelpText(env))
152    
153  # Check for superfluous options  # Check for superfluous options
154  for k in vars.UnknownVariables():  if len(vars.UnknownVariables())>0:
155      print("WARNING: Ignoring unknown option '%s'" % k)      for k in vars.UnknownVariables():
156            print("Unknown option '%s'" % k)
157        Exit(1)
158    
159  #################### Make sure install directories exist #####################  #################### Make sure install directories exist #####################
160    
161    env['BUILD_DIR']=env['build_dir']
162  prefix=Dir(env['prefix']).abspath  prefix=Dir(env['prefix']).abspath
163  env['incinstall'] = os.path.join(prefix, 'include')  env['incinstall'] = os.path.join(prefix, 'include')
164  env['bininstall'] = os.path.join(prefix, 'bin')  env['bininstall'] = os.path.join(prefix, 'bin')
# Line 277  try: Line 285  try:
285      if global_revision == '': global_revision='-2'      if global_revision == '': global_revision='-2'
286  except:  except:
287      global_revision = '-1'      global_revision = '-1'
288    env['svn_revision']=global_revision
289  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])
290    
291  if IS_WINDOWS:  if IS_WINDOWS:
# Line 294  if IS_WINDOWS: Line 303  if IS_WINDOWS:
303  else:  else:
304      LD_LIBRARY_PATH_KEY='LD_LIBRARY_PATH'      LD_LIBRARY_PATH_KEY='LD_LIBRARY_PATH'
305    
306  # the following env variables are exported for the unit tests, PATH is needed  # the following env variables are exported for the unit tests
 # so the compiler/linker is found if they are not in default locations.  
307    
308  for key in 'OMP_NUM_THREADS', 'ESCRIPT_NUM_PROCS', 'ESCRIPT_NUM_NODES':  for key in 'OMP_NUM_THREADS', 'ESCRIPT_NUM_PROCS', 'ESCRIPT_NUM_NODES':
309      try:      try:
# Line 373  if conf.CheckFunc('gethostname'): Line 381  if conf.CheckFunc('gethostname'):
381  python_inc_path=sysconfig.get_python_inc()  python_inc_path=sysconfig.get_python_inc()
382  if IS_WINDOWS:  if IS_WINDOWS:
383      python_lib_path=os.path.join(sysconfig.get_config_var('prefix'), 'libs')      python_lib_path=os.path.join(sysconfig.get_config_var('prefix'), 'libs')
384    elif env['PLATFORM']=='darwin':
385        python_lib_path=sysconfig.get_config_var('LIBPL')
386  else:  else:
387      python_lib_path=sysconfig.get_config_var('LIBDIR')      python_lib_path=sysconfig.get_config_var('LIBDIR')
388  #python_libs=[sysconfig.get_config_var('LDLIBRARY')] # only on linux  #python_libs=[sysconfig.get_config_var('LDLIBRARY')] # only on linux
# Line 572  if not env['verbose']: Line 582  if not env['verbose']:
582      env['ARCOMSTR'] = "Linking $TARGET"      env['ARCOMSTR'] = "Linking $TARGET"
583      env['LINKCOMSTR'] = "Linking $TARGET"      env['LINKCOMSTR'] = "Linking $TARGET"
584      env['SHLINKCOMSTR'] = "Linking $TARGET"      env['SHLINKCOMSTR'] = "Linking $TARGET"
585        env['PDFLATEXCOMSTR'] = "Building $TARGET from LaTeX input $SOURCES"
586        env['BIBTEXCOMSTR'] = "Generating bibliography $TARGET"
587        env['MAKEINDEXCOMSTR'] = "Generating index $TARGET"
588        env['PDFLATEXCOMSTR'] = "Building $TARGET from LaTeX input $SOURCES"
589      #Progress(['Checking -\r', 'Checking \\\r', 'Checking |\r', 'Checking /\r'], interval=17)      #Progress(['Checking -\r', 'Checking \\\r', 'Checking |\r', 'Checking /\r'], interval=17)
590    
591  print("")  print("")
# Line 626  Export( Line 640  Export(
640    ]    ]
641  )  )
642    
643  env.SConscript(dirs = ['tools/CppUnitTest/src'], variant_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)  env.SConscript(dirs = ['tools/CppUnitTest/src'], variant_dir='$BUILD_DIR/$PLATFORM/tools/CppUnitTest', duplicate=0)
644  env.SConscript(dirs = ['tools/escriptconvert'], variant_dir='build/$PLATFORM/tools/escriptconvert', duplicate=0)  env.SConscript(dirs = ['tools/escriptconvert'], variant_dir='$BUILD_DIR/$PLATFORM/tools/escriptconvert', duplicate=0)
645  env.SConscript(dirs = ['paso/src'], variant_dir='build/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], variant_dir='$BUILD_DIR/$PLATFORM/paso', duplicate=0)
646  env.SConscript(dirs = ['weipa/src'], variant_dir='build/$PLATFORM/weipa', duplicate=0)  env.SConscript(dirs = ['weipa/src'], variant_dir='$BUILD_DIR/$PLATFORM/weipa', duplicate=0)
647  env.SConscript(dirs = ['escript/src'], variant_dir='build/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)
648  env.SConscript(dirs = ['esysUtils/src'], variant_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], variant_dir='$BUILD_DIR/$PLATFORM/esysUtils', duplicate=0)
649  env.SConscript(dirs = ['dudley/src'], variant_dir='build/$PLATFORM/dudley', duplicate=0)  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)
650  env.SConscript(dirs = ['finley/src'], variant_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)
651  env.SConscript(dirs = ['modellib/py_src'], variant_dir='build/$PLATFORM/modellib', duplicate=0)  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)
652  env.SConscript(dirs = ['doc'], variant_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)
653  env.SConscript(dirs = ['pyvisi/py_src'], variant_dir='build/$PLATFORM/pyvisi', duplicate=0)  env.SConscript(dirs = ['pyvisi/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pyvisi', duplicate=0)
654  env.SConscript(dirs = ['pycad/py_src'], variant_dir='build/$PLATFORM/pycad', duplicate=0)  env.SConscript(dirs = ['pycad/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pycad', duplicate=0)
655  env.SConscript(dirs = ['pythonMPI/src'], variant_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], variant_dir='$BUILD_DIR/$PLATFORM/pythonMPI', duplicate=0)
656  env.SConscript(dirs = ['paso/profiling'], variant_dir='build/$PLATFORM/paso/profiling', duplicate=0)  env.SConscript(dirs = ['paso/profiling'], variant_dir='$BUILD_DIR/$PLATFORM/paso/profiling', duplicate=0)
657    
658  ######################## Populate the buildvars file #########################  ######################## Populate the buildvars file #########################
659    
# Line 751  env.Alias('install_cppunittest', ['build Line 765  env.Alias('install_cppunittest', ['build
765  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])
766  env.Alias('all_tests', ['install_all', 'install_cppunittest_lib', 'run_tests', 'py_tests'])  env.Alias('all_tests', ['install_all', 'install_cppunittest_lib', 'run_tests', 'py_tests'])
767  env.Alias('build_full',['install_all','build_tests','build_py_tests'])  env.Alias('build_full',['install_all','build_tests','build_py_tests'])
768  env.Alias('build_PasoTests','build/$PLATFORM/paso/profiling/PasoTests')  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')
769    
770  ##################### Targets to build the documentation #####################  ##################### Targets to build the documentation #####################
771    
772  env.Alias('api_epydoc','install_all')  env.Alias('api_epydoc','install_all')
773  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html','install_pdf', 'cookbook_pdf'])  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'user_pdf', 'install_pdf', 'cookbook_pdf'])
774  env.Alias('release_prep', ['docs', 'install_all'])  env.Alias('release_prep', ['docs', 'install_all'])
775    
776  if not IS_WINDOWS:  if not IS_WINDOWS:
# Line 775  if not IS_WINDOWS: Line 789  if not IS_WINDOWS:
789      # Make sure that the escript wrapper is in place      # Make sure that the escript wrapper is in place
790      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):
791          print("Copying escript wrapper.")          print("Copying escript wrapper.")
792          Execute(Copy(os.path.join(env['bininstall'],'escript'), 'bin/run-escript'))          Execute(Copy(os.path.join(env['bininstall'],'run-escript'), 'bin/run-escript'))
793    

Legend:
Removed from v.3259  
changed lines
  Added in v.3393

  ViewVC Help
Powered by ViewVC 1.1.26