/[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 1771 by ksteube, Mon Sep 8 22:47:55 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 56  opts.AddOptions( Line 58  opts.AddOptions(
58    ('omp_debug', 'OpenMP compiler flags to use (Debug build)', '-DEFAULT_5'),    ('omp_debug', 'OpenMP compiler flags to use (Debug build)', '-DEFAULT_5'),
59    ('omp_libs', 'OpenMP compiler libraries to link with', '-DEFAULT_6'),    ('omp_libs', 'OpenMP compiler libraries to link with', '-DEFAULT_6'),
60    ('cc_extra', 'Extra C/C++ flags', ''),    ('cc_extra', 'Extra C/C++ flags', ''),
61      ('ld_extra', 'Extra linker flags', ''),
62    ('sys_libs', 'System libraries to link with', []),    ('sys_libs', 'System libraries to link with', []),
63    ('ar_flags', 'Static library archiver flags to use', ''),    ('ar_flags', 'Static library archiver flags to use', ''),
64    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),
# Line 99  opts.AddOptions( Line 102  opts.AddOptions(
102    ('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'),
103    ('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']),
104  # UMFPACK  # UMFPACK
105    BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'yes'),    BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'no'),
106    ('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'),    ('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'),
107    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),
108    ('umf_lib_path', 'Path to UMFPACK libs', usr_lib),    ('umf_lib_path', 'Path to UMFPACK libs', usr_lib),
# Line 221  except KeyError: pass Line 224  except KeyError: pass
224  env.PrependENVPath('PYTHONPATH', prefix)  env.PrependENVPath('PYTHONPATH', prefix)
225  env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])  env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])
226    
227    env['ENV']['ESCRIPT_ROOT'] = prefix
228    
229  ############ Set up paths for Configure() ######################  ############ Set up paths for Configure() ######################
230    
231  # Make a copy of an environment  # Make a copy of an environment
# Line 233  def clone_env(env): Line 238  def clone_env(env):
238  env.Append(CPPPATH      = [Dir('include')])  env.Append(CPPPATH      = [Dir('include')])
239    
240  # Add cc option -L<Escript>/trunk/lib  # Add cc option -L<Escript>/trunk/lib
241  env.Append(LIBPATH      = [Dir('lib')])  env.Append(LIBPATH      = [Dir(env['libinstall'])])
242    
243  env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS', 'FINLEY_EXPORTS'])  env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS', 'FINLEY_EXPORTS'])
244    
245  if env['cc_extra'] != '': env.Append(CCFLAGS = env['cc_extra'])  if env['cc_extra'] != '': env.Append(CCFLAGS = env['cc_extra'])
246    if env['ld_extra'] != '': env.Append(LINKFLAGS = env['ld_extra'])
247    
248  if env['usepedantic']: env.Append(CCFLAGS = pedantic)  if env['usepedantic']: env.Append(CCFLAGS = pedantic)
249    
# Line 500  else: print "  Not compiling for debug" Line 506  else: print "  Not compiling for debug"
506  print " Installing in", prefix  print " Installing in", prefix
507  print ""  print ""
508    
509    ############ Delete option-dependent files #####################
510    
511    Execute(Delete(env['libinstall'] + "/Compiled.with.debug"))
512    Execute(Delete(env['libinstall'] + "/Compiled.with.mpi"))
513    Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))
514    if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))
515    
516  ############ Add some custom builders ##########################  ############ Add some custom builders ##########################
517    
518  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 524  env.Append(BUILDERS = {'RunUnitTest' : r
524  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)
525  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
526    
527  ############ Build the desired subdirectories ##################  ############ Build the subdirectories ##########################
528    
529  Export(["env", "env_mpi", "clone_env"])  Export(["env", "env_mpi", "clone_env"])
530    
# Line 525  env.SConscript(dirs = ['doc'], build_dir Line 538  env.SConscript(dirs = ['doc'], build_dir
538  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)
539  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)
540  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
541    env.SConscript(dirs = ['scripts'], build_dir='build/$PLATFORM/scripts', duplicate=0)
542    
543  ############ Remember what optimizations we used ###############  ############ Remember what optimizations we used ###############
544    
# Line 532  remember_list = [] Line 546  remember_list = []
546    
547  if env['usedebug']:  if env['usedebug']:
548    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'))  
549    
550  if env['usempi']:  if env['usempi']:
551    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'))  
552    
553  if env['omp_optim'] != '':  if env['omp_optim'] != '':
554    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'))  
555    
556  env.Alias('remember_options', remember_list)  env.Alias('remember_options', remember_list)
557    
# Line 571  build_all_list += ['build_esysUtils'] Line 579  build_all_list += ['build_esysUtils']
579  build_all_list += ['build_paso']  build_all_list += ['build_paso']
580  build_all_list += ['build_escript']  build_all_list += ['build_escript']
581  build_all_list += ['build_finley']  build_all_list += ['build_finley']
582  if env['usempi']: build_all_list += ['target_pythonMPI_exe']  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']
583    if not IS_WINDOWS_PLATFORM: build_all_list += ['target_finley_wrapper']
584  env.Alias('build_all', build_all_list)  env.Alias('build_all', build_all_list)
585    
586  install_all_list = []  install_all_list = []
# Line 583  install_all_list += ['install_finley'] Line 592  install_all_list += ['install_finley']
592  install_all_list += ['target_install_pyvisi_py']  install_all_list += ['target_install_pyvisi_py']
593  install_all_list += ['target_install_modellib_py']  install_all_list += ['target_install_modellib_py']
594  install_all_list += ['target_install_pycad_py']  install_all_list += ['target_install_pycad_py']
595  if env['usempi']: install_all_list += ['target_install_pythonMPI_exe']  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']
596    if not IS_WINDOWS_PLATFORM: install_all_list += ['target_install_finley_wrapper']
597  install_all_list += ['remember_options']  install_all_list += ['remember_options']
598  env.Alias('install_all', install_all_list)  env.Alias('install_all', install_all_list)
599    

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

  ViewVC Help
Powered by ViewVC 1.1.26