/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3304 by caltinay, Mon Oct 25 04:43:48 2010 UTC revision 3359 by jfenwick, Wed Nov 17 23:32:36 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 153  if len(vars.UnknownVariables())>0: Line 158  if len(vars.UnknownVariables())>0:
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 297  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 633  Export( Line 638  Export(
638    ]    ]
639  )  )
640    
641  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)
642  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)
643  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)
644  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)
645  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)
646  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)
647  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)
648  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)
649  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)
650  env.SConscript(dirs = ['doc'], variant_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)
651  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)
652  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)
653  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)
654  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)
655    
656  ######################## Populate the buildvars file #########################  ######################## Populate the buildvars file #########################
657    
# Line 758  env.Alias('install_cppunittest', ['build Line 763  env.Alias('install_cppunittest', ['build
763  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])
764  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'])
765  env.Alias('build_full',['install_all','build_tests','build_py_tests'])  env.Alias('build_full',['install_all','build_tests','build_py_tests'])
766  env.Alias('build_PasoTests','build/$PLATFORM/paso/profiling/PasoTests')  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')
767    
768  ##################### Targets to build the documentation #####################  ##################### Targets to build the documentation #####################
769    
770  env.Alias('api_epydoc','install_all')  env.Alias('api_epydoc','install_all')
771  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'install_pdf', 'cookbook_pdf'])  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'user_pdf', 'install_pdf', 'cookbook_pdf'])
772  env.Alias('release_prep', ['docs', 'install_all'])  env.Alias('release_prep', ['docs', 'install_all'])
773    
774  if not IS_WINDOWS:  if not IS_WINDOWS:
# Line 782  if not IS_WINDOWS: Line 787  if not IS_WINDOWS:
787      # Make sure that the escript wrapper is in place      # Make sure that the escript wrapper is in place
788      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):
789          print("Copying escript wrapper.")          print("Copying escript wrapper.")
790          Execute(Copy(os.path.join(env['bininstall'],'escript'), 'bin/run-escript'))          Execute(Copy(os.path.join(env['bininstall'],'run-escript'), 'bin/run-escript'))
791    

Legend:
Removed from v.3304  
changed lines
  Added in v.3359

  ViewVC Help
Powered by ViewVC 1.1.26