/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 1705 by ksteube, Thu Aug 14 05:56:40 2008 UTC revision 1756 by ksteube, Mon Sep 8 01:45:46 2008 UTC
# Line 31  hostname = re.sub("[^0-9a-zA-Z]", "_", s Line 31  hostname = re.sub("[^0-9a-zA-Z]", "_", s
31  tmp = os.path.join("scons",hostname+"_options.py")  tmp = os.path.join("scons",hostname+"_options.py")
32  options_file = ARGUMENTS.get('options_file', tmp)  options_file = ARGUMENTS.get('options_file', tmp)
33  if not os.path.isfile(options_file): options_file = False  if not os.path.isfile(options_file): options_file = False
34    else: print "Options file is", options_file
35    
36  # Load options file and command-line arguments  # Load options file and command-line arguments
37  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
# Line 41  opts.AddOptions( Line 42  opts.AddOptions(
42  # Where to install esys stuff  # Where to install esys stuff
43    ('prefix', 'where everything will be installed',                       Dir('#.').abspath),    ('prefix', 'where everything will be installed',                       Dir('#.').abspath),
44    ('incinstall', 'where the esys headers will be installed',             os.path.join(Dir('#.').abspath,'include')),    ('incinstall', 'where the esys headers will be installed',             os.path.join(Dir('#.').abspath,'include')),
45      ('bininstall', 'where the esys binaries will be installed',            os.path.join(prefix,'bin')),
46    ('libinstall', 'where the esys libraries will be installed',           os.path.join(prefix,'lib')),    ('libinstall', 'where the esys libraries will be installed',           os.path.join(prefix,'lib')),
47    ('pyinstall', 'where the esys python modules will be installed',       os.path.join(prefix,'esys')),    ('pyinstall', 'where the esys python modules will be installed',       os.path.join(prefix,'esys')),
48  # Compilation options  # Compilation options
# Line 99  opts.AddOptions( Line 101  opts.AddOptions(
101    ('mkl_lib_path', 'Path to MKL libs', '/sw/sdev/cmkl/10.0.2.18/lib/em64t'),    ('mkl_lib_path', 'Path to MKL libs', '/sw/sdev/cmkl/10.0.2.18/lib/em64t'),
102    ('mkl_libs', 'MKL libraries to link with', ['mkl_solver', 'mkl_em64t', 'guide', 'pthread']),    ('mkl_libs', 'MKL libraries to link with', ['mkl_solver', 'mkl_em64t', 'guide', 'pthread']),
103  # UMFPACK  # UMFPACK
104    BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'yes'),    BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'no'),
105    ('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'),    ('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'),
106    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),
107    ('umf_lib_path', 'Path to UMFPACK libs', usr_lib),    ('umf_lib_path', 'Path to UMFPACK libs', usr_lib),
# Line 221  except KeyError: pass Line 223  except KeyError: pass
223  env.PrependENVPath('PYTHONPATH', prefix)  env.PrependENVPath('PYTHONPATH', prefix)
224  env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])  env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])
225    
226    env['ENV']['ESCRIPT_ROOT'] = prefix
227    
228  ############ Set up paths for Configure() ######################  ############ Set up paths for Configure() ######################
229    
230  # Make a copy of an environment  # Make a copy of an environment
# Line 233  def clone_env(env): Line 237  def clone_env(env):
237  env.Append(CPPPATH      = [Dir('include')])  env.Append(CPPPATH      = [Dir('include')])
238    
239  # Add cc option -L<Escript>/trunk/lib  # Add cc option -L<Escript>/trunk/lib
240  env.Append(LIBPATH      = [Dir('lib')])  env.Append(LIBPATH      = [Dir(env['libinstall'])])
241    
242  env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS', 'FINLEY_EXPORTS'])  env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS', 'FINLEY_EXPORTS'])
243    
# Line 500  else: print "  Not compiling for debug" Line 504  else: print "  Not compiling for debug"
504  print " Installing in", prefix  print " Installing in", prefix
505  print ""  print ""
506    
507    ############ Delete option-dependent files #####################
508    
509    Execute(Delete(env['libinstall'] + "/Compiled.with.debug"))
510    Execute(Delete(env['libinstall'] + "/Compiled.with.mpi"))
511    Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))
512    if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))
513    
514  ############ Add some custom builders ##########################  ############ Add some custom builders ##########################
515    
516  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
# Line 511  env.Append(BUILDERS = {'RunUnitTest' : r Line 522  env.Append(BUILDERS = {'RunUnitTest' : r
522  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
523  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
524    
525  ############ Build the desired subdirectories ##################  ############ Build the subdirectories ##########################
526    
527  Export(["env", "env_mpi", "clone_env"])  Export(["env", "env_mpi", "clone_env"])
528    
# Line 525  env.SConscript(dirs = ['doc'], build_dir Line 536  env.SConscript(dirs = ['doc'], build_dir
536  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
537  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
538  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
539    env.SConscript(dirs = ['scripts'], build_dir='build/$PLATFORM/scripts', duplicate=0)
540    
541  ############ Remember what optimizations we used ###############  ############ Remember what optimizations we used ###############
542    
# Line 532  remember_list = [] Line 544  remember_list = []
544    
545  if env['usedebug']:  if env['usedebug']:
546    remember_list += env.Command(env['libinstall'] + "/Compiled.with.debug", None, Touch('$TARGET'))    remember_list += env.Command(env['libinstall'] + "/Compiled.with.debug", None, Touch('$TARGET'))
 else:  
   remember_list += env.Command(env['libinstall'] + "/Compiled.with.debug", None, Delete('$TARGET'))  
547    
548  if env['usempi']:  if env['usempi']:
549    remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Touch('$TARGET'))    remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Touch('$TARGET'))
 else:  
   remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Delete('$TARGET'))  
550    
551  if env['omp_optim'] != '':  if env['omp_optim'] != '':
552    remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Touch('$TARGET'))    remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Touch('$TARGET'))
 else:  
   remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Delete('$TARGET'))  
553    
554  env.Alias('remember_options', remember_list)  env.Alias('remember_options', remember_list)
555    
# Line 571  build_all_list += ['build_esysUtils'] Line 577  build_all_list += ['build_esysUtils']
577  build_all_list += ['build_paso']  build_all_list += ['build_paso']
578  build_all_list += ['build_escript']  build_all_list += ['build_escript']
579  build_all_list += ['build_finley']  build_all_list += ['build_finley']
580  if env['usempi']: build_all_list += ['target_pythonMPI_exe']  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']
581    if not IS_WINDOWS_PLATFORM: build_all_list += ['target_finley_wrapper']
582  env.Alias('build_all', build_all_list)  env.Alias('build_all', build_all_list)
583    
584  install_all_list = []  install_all_list = []
# Line 583  install_all_list += ['install_finley'] Line 590  install_all_list += ['install_finley']
590  install_all_list += ['target_install_pyvisi_py']  install_all_list += ['target_install_pyvisi_py']
591  install_all_list += ['target_install_modellib_py']  install_all_list += ['target_install_modellib_py']
592  install_all_list += ['target_install_pycad_py']  install_all_list += ['target_install_pycad_py']
593  if env['usempi']: install_all_list += ['target_install_pythonMPI_exe']  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']
594    if not IS_WINDOWS_PLATFORM: install_all_list += ['target_install_finley_wrapper']
595  install_all_list += ['remember_options']  install_all_list += ['remember_options']
596  env.Alias('install_all', install_all_list)  env.Alias('install_all', install_all_list)
597    

Legend:
Removed from v.1705  
changed lines
  Added in v.1756

  ViewVC Help
Powered by ViewVC 1.1.26