/[escript]/branches/arrayview_from_1695_trunk/SConstruct
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/SConstruct

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

revision 1243 by phornby, Mon Aug 13 06:48:37 2007 UTC revision 1250 by ksteube, Thu Aug 16 02:54:42 2007 UTC
# Line 15  EnsurePythonVersion(2,3) Line 15  EnsurePythonVersion(2,3)
15  #===============================================================  #===============================================================
16  #   import tools:  #   import tools:
17  import glob  import glob
18  import sys, os  import sys, os, re
 import socket  
19  # Add our extensions  # Add our extensions
20  if sys.path.count('scons')==0: sys.path.append('scons')  if sys.path.count('scons')==0: sys.path.append('scons')
21  import scons_extensions  import scons_extensions
# Line 69  print "    Default example system installat Line 68  print "    Default example system installat
68  #      #    
69  #    get the options file if present:  #    get the options file if present:
70  #  #
71  if ARGUMENTS.get('options_file',0):  options_file = ARGUMENTS.get('options_file','')
72     options_file = ARGUMENTS.get('options_file',0)  
73  else:  if not os.path.isfile(options_file) :
74     from string import ascii_letters,digits      options_file = False
75     hostname=""  
76     for s in socket.gethostname().split('.')[0]:  if not options_file :
77        if s in ascii_letters+digits:     import socket
78           hostname+=s     hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])
79        else:     tmp = os.path.join("scons",hostname+"_options.py")
80           hostname+="_"  
81     options_file = os.path.join("scons",hostname+"_options.py")     if os.path.isfile(tmp) :
82            options_file = tmp
83  if os.path.isfile(options_file):  
84     print "option file is ",options_file,"."  IS_WINDOWS_PLATFORM = (os.name== "nt")
85  else:  
86     print "option file is ",options_file, "(not present)."  # If you're not going to tell me then......
87    # FIXME: add one for the altix too.
88    if not options_file :
89       if IS_WINDOWS_PLATFORM :
90          options_file = "scons/windows_mscv71_options.py"
91       else:
92          options_file = "scons/linux_gcc_eg_options.py"
93    
94  # and load it  # and load it
95  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
96  #================================================================  #================================================================
# Line 246  opts.AddOptions( Line 252  opts.AddOptions(
252  #   This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms)  #   This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms)
253  #   FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix  #   FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
254  #  #
 IS_WINDOWS_PLATFORM = (os.name== "nt")  
255    
256  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
257        env = Environment(tools = ['default', 'msvc'], options = opts)        env = Environment(tools = ['default', 'msvc'], options = opts)
# Line 302  except KeyError: Line 307  except KeyError:
307  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)
308  env.Append(BUILDERS = {'PyCompile' : py_builder});  env.Append(BUILDERS = {'PyCompile' : py_builder});
309    
310  # FIXME: use the inbuilt scons suffix variable.  runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed',
311  if IS_WINDOWS_PLATFORM:                                src_suffix=env['PROGSUFFIX'], single_source=True)
312     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)  
 else:  
    runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)  
313  env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});  env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
314    
315  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)
# Line 322  try: Line 325  try:
325     libinstall = env['libinstall']     libinstall = env['libinstall']
326     env.Append(LIBPATH = [libinstall,]) # Adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so     env.Append(LIBPATH = [libinstall,]) # Adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so
327     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
328     if env['PLATFORM'] == "win32":     if IS_WINDOWS_PLATFORM :
329        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
       env.PrependENVPath('PATH', env['boost_lib_path'])  
330  except KeyError:  except KeyError:
331     libinstall = None     libinstall = None
332  try:  try:
# Line 361  try: Line 363  try:
363  except KeyError:  except KeyError:
364     pass     pass
365    
366    
367  if dodebug:  if dodebug:
368    if useMPI:    if useMPI:
369      try:      try:
# Line 541  except KeyError: Line 544  except KeyError:
544     useNetCDF = 'yes'     useNetCDF = 'yes'
545     pass     pass
546    
 if not useNetCDF == 'yes':  
    print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."  
     
547  if useNetCDF == 'yes':  if useNetCDF == 'yes':
548     try:     try:
549          netCDF_libs = env['netCDF_libs']
550       except KeyError:
551          pass
552    
553       env.Append(LIBS = netCDF_libs)
554       env.Append(CPPDEFINES = [ 'USE_NETCDF' ])
555       try:
556        includes = env['netCDF_path']        includes = env['netCDF_path']
557        env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
558     except KeyError:     except KeyError:
# Line 553  if useNetCDF == 'yes': Line 560  if useNetCDF == 'yes':
560    
561     try:     try:
562        lib_path = env['netCDF_lib_path']        lib_path = env['netCDF_lib_path']
       if IS_WINDOWS_PLATFORM: env['ENV']['PATH']+=";"+lib_path  
563        env.Append(LIBPATH = [ lib_path, ])        env.Append(LIBPATH = [ lib_path, ])
564          if IS_WINDOWS_PLATFORM :
565             env.PrependENVPath('PATH', lib_path)
566     except KeyError:     except KeyError:
567        pass        pass
   
    try:  
       netCDF_libs = env['netCDF_libs']  
    except KeyError:  
       netCDF_libs = [ ]  
568  else:  else:
569       print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
570     netCDF_libs=[ ]     netCDF_libs=[ ]
571    
572  try:  try:
# Line 573  except KeyError: Line 577  except KeyError:
577  try:  try:
578     lib_path = env['boost_lib_path']     lib_path = env['boost_lib_path']
579     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
580       if IS_WINDOWS_PLATFORM :
581          env.PrependENVPath('PATH', lib_path)
582  except KeyError:  except KeyError:
583     pass     pass
584  try:  try:
# Line 663  try: Line 669  try:
669  except KeyError:  except KeyError:
670     api_doxygen = None     api_doxygen = None
671    
672    try:
673       svn_pipe = os.popen("svnversion -n")
674       global_revision = svn_pipe.readlines()
675       svn_pipe.close()
676       global_revision = re.sub("[^0-9]", "", global_revision)
677    except:
678       global_revision = "0"
679    env.Append(CPPDEFINES = "SVN_VERSION="+global_revision[0])
680    
681    # Python install - esys __init__.py
682    init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))
683    
684  # FIXME: exinstall and friends related to examples are not working.  # FIXME: exinstall and friends related to examples are not working.
685  build_target = env.Alias('build',[libinstall,incinstall,pyinstall])  build_target = env.Alias('build',[libinstall,incinstall,pyinstall,init_target])
686    
687  env.Default(build_target)  env.Default(build_target)
688    
# Line 682  env.Alias('guide_pdf', guide_pdf) Line 699  env.Alias('guide_pdf', guide_pdf)
699  env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen, guide_html_index])  env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen, guide_html_index])
700  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
701    
702  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests',build_target)    # target to build all C++ tests
703  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests',build_target) # target to build all python tests
704  env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests  env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
705  env.Alias('run_tests', 'build_tests')   # target to run all C++ test  env.Alias('run_tests', 'build_tests')   # target to run all C++ test
706  env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests  env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
707  env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests  env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests
708    
 # Python install - esys __init__.py  
 init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))  
 env.Alias(init_target)  
709    
710  # Allow sconscripts to see the env  # Allow sconscripts to see the env
711  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "exinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",  Export(["env", "incinstall", "libinstall", "pyinstall", "exinstall", "dodebug",
712            "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs",
713            "netCDF_libs",
714      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
715          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile",
716          "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ])          "src_tarfile", "examples_tarfile", "examples_zipfile",
717            "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI"
718            ])
719    
720  # End initialisation section  # End initialisation section
721  # Begin configuration section  # Begin configuration section

Legend:
Removed from v.1243  
changed lines
  Added in v.1250

  ViewVC Help
Powered by ViewVC 1.1.26