/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3319 by caltinay, Thu Oct 28 03:14:27 2010 UTC revision 3466 by caltinay, Tue Feb 8 05:16:21 2011 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 157  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 310  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N Line 312  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N
312          env['ENV'][key] = 1          env['ENV'][key] = 1
313    
314  env_export=env['env_export']  env_export=env['env_export']
315  env_export.extend(['ESCRIPT_NUM_THREADS','ESCRIPT_HOSTFILE','DISPLAY','XAUTHORITY','PATH','HOME'])  env_export.extend(['ESCRIPT_NUM_THREADS','ESCRIPT_HOSTFILE','DISPLAY','XAUTHORITY','PATH','HOME','TMPDIR','TEMP','TMP'])
316    
317  for key in set(env_export):  for key in set(env_export):
318      try:      try:
# Line 379  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 563  if env['parmetis']: Line 567  if env['parmetis']:
567      env.PrependENVPath(LD_LIBRARY_PATH_KEY, parmetis_lib_path)      env.PrependENVPath(LD_LIBRARY_PATH_KEY, parmetis_lib_path)
568      env.Append(CPPDEFINES = ['USE_PARMETIS'])      env.Append(CPPDEFINES = ['USE_PARMETIS'])
569    
570    ######## gmsh (optional, for tests)
571    
572    try:
573        import subprocess
574        p=subprocess.Popen(['gmsh', '-version'], stderr=subprocess.PIPE)
575        p.poll()
576        env['gmsh']=True
577    except OSError:
578        env['gmsh']=False
579    
580  ######################## Summarize our environment ###########################  ######################## Summarize our environment ###########################
581    
582  # keep some of our install paths first in the list for the unit tests  # keep some of our install paths first in the list for the unit tests
# Line 608  for i in e_list: Line 622  for i in e_list:
622      print("%16s:  YES"%i)      print("%16s:  YES"%i)
623  for i in d_list:  for i in d_list:
624      print("%16s:  DISABLED"%i)      print("%16s:  DISABLED"%i)
625    if env['gmsh']:
626        print("            gmsh:  FOUND")
627    else:
628        print("            gmsh:  NOT FOUND")
629  if ((fatalwarning != '') and (env['werror'])):  if ((fatalwarning != '') and (env['werror'])):
630      print("  Treating warnings as errors")      print("  Treating warnings as errors")
631  else:  else:
# Line 636  Export( Line 654  Export(
654    ]    ]
655  )  )
656    
657  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)
658  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)
659  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)
660  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)
661  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)
662  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)
663  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)
664  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)
665  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)
666  env.SConscript(dirs = ['doc'], variant_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)
667  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)
668  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)
669  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)
670  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)
671    
672  ######################## Populate the buildvars file #########################  ######################## Populate the buildvars file #########################
673    
# Line 761  env.Alias('install_cppunittest', ['build Line 779  env.Alias('install_cppunittest', ['build
779  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])
780  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'])
781  env.Alias('build_full',['install_all','build_tests','build_py_tests'])  env.Alias('build_full',['install_all','build_tests','build_py_tests'])
782  env.Alias('build_PasoTests','build/$PLATFORM/paso/profiling/PasoTests')  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')
783    
784  ##################### Targets to build the documentation #####################  ##################### Targets to build the documentation #####################
785    
786  env.Alias('api_epydoc','install_all')  env.Alias('api_epydoc','install_all')
787  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'])
788  env.Alias('release_prep', ['docs', 'install_all'])  env.Alias('release_prep', ['docs', 'install_all'])
789    
790  if not IS_WINDOWS:  if not IS_WINDOWS:
# Line 785  if not IS_WINDOWS: Line 803  if not IS_WINDOWS:
803      # Make sure that the escript wrapper is in place      # Make sure that the escript wrapper is in place
804      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):
805          print("Copying escript wrapper.")          print("Copying escript wrapper.")
806          Execute(Copy(os.path.join(env['bininstall'],'escript'), 'bin/run-escript'))          Execute(Copy(os.path.join(env['bininstall'],'run-escript'), 'bin/run-escript'))
807    

Legend:
Removed from v.3319  
changed lines
  Added in v.3466

  ViewVC Help
Powered by ViewVC 1.1.26