/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 1354 by trankine, Wed Nov 28 02:23:30 2007 UTC revision 1459 by ksteube, Thu Mar 27 01:49:10 2008 UTC
# Line 20  import sys, os, re Line 20  import sys, os, re
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
22    
23    # We may also need to know where python's site-packages subdirectory lives
24    python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])
25    
26  #===============================================================  #===============================================================
27    
28  tools_prefix="/usr"  tools_prefix="/usr"
# Line 28  tools_prefix="/usr" Line 31  tools_prefix="/usr"
31  #      #    
32  #    get the installation prefix  #    get the installation prefix
33  #  #
34  prefix = ARGUMENTS.get('prefix', '/usr')  prefix = ARGUMENTS.get('prefix', sys.prefix )
35    
36  # 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
37  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])
   
38  # 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
39  if os.path.isdir(  prefix+"/lib64/"+python_version+"/site-packages"):  if os.path.isdir(  prefix+"/lib64/"+python_version+"/site-packages"):
40     sys_dir_packages =  prefix+"/lib64/"+python_version+"/site-packages/esys"     sys_dir_packages =  prefix+"/lib64/"+python_version+"/site-packages/esys"
# Line 236  opts.AddOptions( Line 238  opts.AddOptions(
238    PathOption('amd_path', 'Path to AMD includes', amd_path_default),    PathOption('amd_path', 'Path to AMD includes', amd_path_default),
239    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
240    ('amd_libs', 'AMD libraries to link with', amd_libs_default),    ('amd_libs', 'AMD libraries to link with', amd_libs_default),
241    # ParMETIS
242      ('parmetis_path', 'Path to ParMETIS includes', ''),
243      ('parmetis_lib_path', 'Path to ParMETIS library', ''),
244      ('parmetis_lib', 'ParMETIS library to link with', []),
245  # TRILINOS  # TRILINOS
246    PathOption('trilinos_path', 'Path to TRILINOS includes', None),    PathOption('trilinos_path', 'Path to TRILINOS includes', None),
247    PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None),    PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None),
# Line 289  opts.AddOptions( Line 295  opts.AddOptions(
295    
296  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
297        env = Environment(tools = ['default', 'msvc'], options = opts)        env = Environment(tools = ['default', 'msvc'], options = opts)
298          #env = Environment(tools = ['default', 'intelc'], options = opts)
299  else:  else:
300     if os.uname()[4]=='ia64':     if os.uname()[4]=='ia64':
301        env = Environment(tools = ['default', 'intelc'], options = opts)        env = Environment(tools = ['default', 'intelc'], options = opts)
# Line 349  except KeyError: Line 356  except KeyError:
356    
357  try:  try:
358     tmp = os.environ['LD_LIBRARY_PATH']     tmp = os.environ['LD_LIBRARY_PATH']
359       print tmp
360     env['ENV']['LD_LIBRARY_PATH'] = tmp     env['ENV']['LD_LIBRARY_PATH'] = tmp
361  except KeyError:  except KeyError:
362     pass     pass
# Line 449  except KeyError: Line 457  except KeyError:
457     useMPI = None     useMPI = None
458  # ========= set compiler flags ===========================================  # ========= set compiler flags ===========================================
459    
 # Can't use MPI and OpenMP simultaneously at this time  
 if useMPI:  
     omp_flags=''  
     omp_flags_debug=''  
   
460  if dodebug:  if dodebug:
461      try:      try:
462        flags = env['cc_flags_debug'] + ' ' + omp_flags_debug        flags = env['cc_flags_debug'] + ' ' + omp_flags_debug
# Line 484  except: Line 487  except:
487       pass       pass
488    
489  # ============= Remember what options were used in the compile =====================================  # ============= Remember what options were used in the compile =====================================
490  Delete(libinstall + "/Compiled.with.*")  if not IS_WINDOWS_PLATFORM:
491      env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*")
492  if not useMPI:      Delete(libinstall + "/pythonMPI")    if dodebug:       env.Execute("touch " + libinstall + "/Compiled.with.debug")
493      if useMPI:        env.Execute("touch " + libinstall + "/Compiled.with.mpi")
494  if dodebug:     Touch(libinstall + "/Compiled.with.debug")    if omp_flags != '':   env.Execute("touch " + libinstall + "/Compiled.with.OpenMP")
495  if useMPI:      Touch(libinstall + "/Compiled.with.mpi")    if bounds_check:  env.Execute("touch " + libinstall + "/Compiled.with.bounds_check")
 if omp_flags != '': Touch(libinstall + "/Compiled.with.OpenMP")  
 if bounds_check:    Touch(libinstall + "/Compiled.with.bounds_check")  
496    
497  # ============= set mkl (but only of no MPI) =====================================  # ============= set mkl (but only of no MPI) =====================================
498  if not useMPI:  if not useMPI:
# Line 504  if not useMPI: Line 505  if not useMPI:
505     try:     try:
506        lib_path = env['mkl_lib_path']        lib_path = env['mkl_lib_path']
507        env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
508          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
509     except KeyError:     except KeyError:
510        pass        pass
511    
# Line 525  if not useMPI: Line 527  if not useMPI:
527     try:     try:
528        lib_path = env['scsl_lib_path']        lib_path = env['scsl_lib_path']
529        env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
530          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
531     except KeyError:     except KeyError:
532        pass        pass
533        
# Line 666  if useNetCDF == 'yes': Line 669  if useNetCDF == 'yes':
669     try:     try:
670        lib_path = env['netCDF_lib_path']        lib_path = env['netCDF_lib_path']
671        env.Append(LIBPATH = [ lib_path, ])        env.Append(LIBPATH = [ lib_path, ])
672          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
673        if IS_WINDOWS_PLATFORM :        if IS_WINDOWS_PLATFORM :
674           env.PrependENVPath('PATH', lib_path)           env.PrependENVPath('PATH', lib_path)
675     except KeyError:     except KeyError:
# Line 683  except KeyError: Line 687  except KeyError:
687  try:  try:
688     lib_path = env['boost_lib_path']     lib_path = env['boost_lib_path']
689     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
690       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
691     if IS_WINDOWS_PLATFORM :     if IS_WINDOWS_PLATFORM :
692        env.PrependENVPath('PATH', lib_path)        env.PrependENVPath('PATH', lib_path)
693  except KeyError:  except KeyError:
# Line 699  except KeyError: Line 704  except KeyError:
704     pass     pass
705  try:  try:
706     lib_path = env['python_lib_path']     lib_path = env['python_lib_path']
707       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
708     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
709  except KeyError:  except KeyError:
710     pass     pass
# Line 715  try: Line 721  try:
721     epydoc_path = env['epydoc_path']     epydoc_path = env['epydoc_path']
722  except KeyError:  except KeyError:
723     epydoc_path = None     epydoc_path = None
724    # =============== ParMETIS =======================================
725    try:
726       parmetis_path = env['parmetis_path']
727       parmetis_lib_path = env['parmetis_lib_path']
728       parmetis_lib = env['parmetis_lib']
729    except KeyError:
730       parmetis_path = ''
731       parmetis_lib_path = ''
732       parmetis_lib = ''
733    
734    if useMPI and os.path.isdir(parmetis_lib_path):
735       env.Append(CPPDEFINES = [ 'PARMETIS' ])
736       env.Append(CXXDEFINES = [ 'PARMETIS' ])
737       env.Append(CPPPATH = [parmetis_path])
738       env.Append(LIBPATH = [parmetis_lib_path])
739       env.Append(LIBS = parmetis_lib)
740  # =============== PAPI =======================================  # =============== PAPI =======================================
741  try:  try:
742     includes = env['papi_path']     includes = env['papi_path']
# Line 845  try: Line 867  try:
867     global_revision = re.sub(":.*", "", global_revision[0])     global_revision = re.sub(":.*", "", global_revision[0])
868     global_revision = re.sub("[^0-9]", "", global_revision)     global_revision = re.sub("[^0-9]", "", global_revision)
869  except:  except:
870     global_revision = "0"     global_revision="-1"
871       print "Warning: unable to recover global revsion number."
872    if global_revision == "": global_revision="0"
873    print "Revision number is %s."%global_revision
874  env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)  env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)
875    
876  # Python install - esys __init__.py  # Python install - esys __init__.py

Legend:
Removed from v.1354  
changed lines
  Added in v.1459

  ViewVC Help
Powered by ViewVC 1.1.26