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

Diff of /branches/dirac/SConstruct

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

revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 1416 by ksteube, Mon Feb 25 03:56:17 2008 UTC
# Line 12  Line 12 
12  EnsureSConsVersion(0,96,91)  EnsureSConsVersion(0,96,91)
13  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
14    
15    
16  #===============================================================  #===============================================================
17  #   import tools:  #   import tools:
18  import glob  import glob
# Line 20  import sys, os, re Line 21  import sys, os, re
21  if sys.path.count('scons')==0: sys.path.append('scons')  if sys.path.count('scons')==0: sys.path.append('scons')
22  import scons_extensions  import scons_extensions
23    
24    # We may also need to know where python's site-packages subdirectory lives
25    python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])
26    
27  #===============================================================  #===============================================================
28    
29  tools_prefix="/usr"  tools_prefix="/usr"
# Line 28  tools_prefix="/usr" Line 32  tools_prefix="/usr"
32  #      #    
33  #    get the installation prefix  #    get the installation prefix
34  #  #
35  prefix = ARGUMENTS.get('prefix', '/usr')  prefix = ARGUMENTS.get('prefix', sys.prefix )
36    
37  # We may also need to know where python's site-packages subdirectory lives  # We may also need to know where python's site-packages subdirectory lives
38  python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])  python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])
   
39  # Install as a standard python package in /usr/lib64 if available, else in /usr/lib  # Install as a standard python package in /usr/lib64 if available, else in /usr/lib
40  if os.path.isdir(  prefix+"/lib64/"+python_version+"/site-packages"):  if os.path.isdir(  prefix+"/lib64/"+python_version+"/site-packages"):
41     sys_dir_packages =  prefix+"/lib64/"+python_version+"/site-packages/esys"     sys_dir_packages =  prefix+"/lib64/"+python_version+"/site-packages/esys"
# Line 301  Help(opts.GenerateHelpText(env)) Line 304  Help(opts.GenerateHelpText(env))
304  if env['bounds_check']:  if env['bounds_check']:
305     env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ])     env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ])
306     env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ])     env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ])
307       bounds_check = env['bounds_check']
308    else:
309       bounds_check = 0
310    
311  #=================================================================================================  #=================================================================================================
312  #  #
# Line 346  except KeyError: Line 352  except KeyError:
352    
353  try:  try:
354     tmp = os.environ['LD_LIBRARY_PATH']     tmp = os.environ['LD_LIBRARY_PATH']
355       print tmp
356     env['ENV']['LD_LIBRARY_PATH'] = tmp     env['ENV']['LD_LIBRARY_PATH'] = tmp
357  except KeyError:  except KeyError:
358     pass     pass
# Line 475  try: Line 482  try:
482  except:  except:
483       pass       pass
484    
485    # ============= Remember what options were used in the compile =====================================
486    if not IS_WINDOWS_PLATFORM:
487      env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*")
488      if dodebug:       env.Execute("touch " + libinstall + "/Compiled.with.debug")
489      if useMPI:        env.Execute("touch " + libinstall + "/Compiled.with.mpi")
490      if omp_flags != '':   env.Execute("touch " + libinstall + "/Compiled.with.OpenMP")
491      if bounds_check:  env.Execute("touch " + libinstall + "/Compiled.with.bounds_check")
492    
493  # ============= set mkl (but only of no MPI) =====================================  # ============= set mkl (but only of no MPI) =====================================
494  if not useMPI:  if not useMPI:
495     try:     try:
# Line 486  if not useMPI: Line 501  if not useMPI:
501     try:     try:
502        lib_path = env['mkl_lib_path']        lib_path = env['mkl_lib_path']
503        env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
504          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
505     except KeyError:     except KeyError:
506        pass        pass
507    
# Line 507  if not useMPI: Line 523  if not useMPI:
523     try:     try:
524        lib_path = env['scsl_lib_path']        lib_path = env['scsl_lib_path']
525        env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
526          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
527     except KeyError:     except KeyError:
528        pass        pass
529        
# Line 624  try: Line 641  try:
641  except KeyError:  except KeyError:
642     blas_libs = [ ]     blas_libs = [ ]
643    
644  # ========== netcdf (currently not supported with mpi) ====================================  # ========== netcdf ====================================
645  if useMPI:  try:
646     useNetCDF = 'no'     useNetCDF = env['useNetCDF']
647  else:  except KeyError:
648     try:     useNetCDF = 'yes'
649        useNetCDF = env['useNetCDF']     pass
    except KeyError:  
       useNetCDF = 'yes'  
       pass  
650            
651  if useNetCDF == 'yes':  if useNetCDF == 'yes':
652     try:     try:
# Line 651  if useNetCDF == 'yes': Line 665  if useNetCDF == 'yes':
665     try:     try:
666        lib_path = env['netCDF_lib_path']        lib_path = env['netCDF_lib_path']
667        env.Append(LIBPATH = [ lib_path, ])        env.Append(LIBPATH = [ lib_path, ])
668          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
669        if IS_WINDOWS_PLATFORM :        if IS_WINDOWS_PLATFORM :
670           env.PrependENVPath('PATH', lib_path)           env.PrependENVPath('PATH', lib_path)
671     except KeyError:     except KeyError:
# Line 668  except KeyError: Line 683  except KeyError:
683  try:  try:
684     lib_path = env['boost_lib_path']     lib_path = env['boost_lib_path']
685     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
686       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
687     if IS_WINDOWS_PLATFORM :     if IS_WINDOWS_PLATFORM :
688        env.PrependENVPath('PATH', lib_path)        env.PrependENVPath('PATH', lib_path)
689  except KeyError:  except KeyError:
# Line 684  except KeyError: Line 700  except KeyError:
700     pass     pass
701  try:  try:
702     lib_path = env['python_lib_path']     lib_path = env['python_lib_path']
703       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
704     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
705  except KeyError:  except KeyError:
706     pass     pass
# Line 827  try: Line 844  try:
844     svn_pipe = os.popen("svnversion -n .")     svn_pipe = os.popen("svnversion -n .")
845     global_revision = svn_pipe.readlines()     global_revision = svn_pipe.readlines()
846     svn_pipe.close()     svn_pipe.close()
847     global_revision = re.sub("[^0-9]", "", global_revision[0])     global_revision = re.sub(":.*", "", global_revision[0])
848       global_revision = re.sub("[^0-9]", "", global_revision)
849  except:  except:
850     global_revision = "0"     global_revision="-1"
851       print "Warning: unable to recover global revsion number."
852    if global_revision == "": global_revision="0"
853    print "Revision number is %s."%global_revision
854  env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)  env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)
855    
856  # Python install - esys __init__.py  # Python install - esys __init__.py
# Line 870  Export(["IS_WINDOWS_PLATFORM", "env", "i Line 891  Export(["IS_WINDOWS_PLATFORM", "env", "i
891  # End initialisation section  # End initialisation section
892  # Begin configuration section  # Begin configuration section
893  # adds this file and the scons option directore to the source tar  # adds this file and the scons option directore to the source tar
894  release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]  release_srcfiles=[env.File('SConstruct'),env.Dir('lib'),env.Dir('include'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
895  release_testfiles=[env.File('README_TESTS'),]  release_testfiles=[env.File('README_TESTS'),]
896  env.Zip(src_zipfile, release_srcfiles)  env.Zip(src_zipfile, release_srcfiles)
897  env.Zip(test_zipfile, release_testfiles)  env.Zip(test_zipfile, release_testfiles)

Legend:
Removed from v.1312  
changed lines
  Added in v.1416

  ViewVC Help
Powered by ViewVC 1.1.26