/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 1729 by ksteube, Tue Aug 26 06:48:40 2008 UTC revision 1771 by ksteube, Mon Sep 8 22:47:55 2008 UTC
# Line 42  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 57  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 222  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 239  env.Append(LIBPATH     = [Dir(env['libinsta Line 243  env.Append(LIBPATH     = [Dir(env['libinsta
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 501  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 512  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 526  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 533  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 572  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 584  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.1729  
changed lines
  Added in v.1771

  ViewVC Help
Powered by ViewVC 1.1.26