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

Diff of /branches/refine/SConstruct

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

revision 1343 by ksteube, Wed Nov 14 02:48:02 2007 UTC revision 1560 by ksteube, Wed May 21 05:55:30 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 socket.gethostname().split('.')[0] == 'service0':
301          env = Environment(tools = ['default', 'intelc'], options = opts)
302       elif os.uname()[4]=='ia64':
303        env = Environment(tools = ['default', 'intelc'], options = opts)        env = Environment(tools = ['default', 'intelc'], options = opts)
304        if env['CXX'] == 'icpc':        if env['CXX'] == 'icpc':
305           env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py           env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py
# Line 301  Help(opts.GenerateHelpText(env)) Line 310  Help(opts.GenerateHelpText(env))
310  if env['bounds_check']:  if env['bounds_check']:
311     env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ])     env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ])
312     env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ])     env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ])
313       bounds_check = env['bounds_check']
314    else:
315       bounds_check = 0
316    
317  #=================================================================================================  #=================================================================================================
318  #  #
# Line 475  try: Line 487  try:
487  except:  except:
488       pass       pass
489    
490    # ============= Remember what options were used in the compile =====================================
491    if not IS_WINDOWS_PLATFORM:
492      env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*")
493      if dodebug:       env.Execute("touch " + libinstall + "/Compiled.with.debug")
494      if useMPI:        env.Execute("touch " + libinstall + "/Compiled.with.mpi")
495      if omp_flags != '':   env.Execute("touch " + libinstall + "/Compiled.with.OpenMP")
496      if bounds_check:  env.Execute("touch " + libinstall + "/Compiled.with.bounds_check")
497    
498  # ============= set mkl (but only of no MPI) =====================================  # ============= set mkl (but only of no MPI) =====================================
499  if not useMPI:  if not useMPI:
500     try:     try:
# Line 486  if not useMPI: Line 506  if not useMPI:
506     try:     try:
507        lib_path = env['mkl_lib_path']        lib_path = env['mkl_lib_path']
508        env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
509          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
510     except KeyError:     except KeyError:
511        pass        pass
512    
# Line 507  if not useMPI: Line 528  if not useMPI:
528     try:     try:
529        lib_path = env['scsl_lib_path']        lib_path = env['scsl_lib_path']
530        env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
531          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
532     except KeyError:     except KeyError:
533        pass        pass
534        
# Line 648  if useNetCDF == 'yes': Line 670  if useNetCDF == 'yes':
670     try:     try:
671        lib_path = env['netCDF_lib_path']        lib_path = env['netCDF_lib_path']
672        env.Append(LIBPATH = [ lib_path, ])        env.Append(LIBPATH = [ lib_path, ])
673          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
674        if IS_WINDOWS_PLATFORM :        if IS_WINDOWS_PLATFORM :
675           env.PrependENVPath('PATH', lib_path)           env.PrependENVPath('PATH', lib_path)
676     except KeyError:     except KeyError:
# Line 665  except KeyError: Line 688  except KeyError:
688  try:  try:
689     lib_path = env['boost_lib_path']     lib_path = env['boost_lib_path']
690     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
691       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
692     if IS_WINDOWS_PLATFORM :     if IS_WINDOWS_PLATFORM :
693        env.PrependENVPath('PATH', lib_path)        env.PrependENVPath('PATH', lib_path)
694  except KeyError:  except KeyError:
# Line 681  except KeyError: Line 705  except KeyError:
705     pass     pass
706  try:  try:
707     lib_path = env['python_lib_path']     lib_path = env['python_lib_path']
708       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
709     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
710  except KeyError:  except KeyError:
711     pass     pass
# Line 697  try: Line 722  try:
722     epydoc_path = env['epydoc_path']     epydoc_path = env['epydoc_path']
723  except KeyError:  except KeyError:
724     epydoc_path = None     epydoc_path = None
725    # =============== ParMETIS =======================================
726    try:
727       parmetis_path = env['parmetis_path']
728       parmetis_lib_path = env['parmetis_lib_path']
729       parmetis_lib = env['parmetis_lib']
730    except KeyError:
731       parmetis_path = ''
732       parmetis_lib_path = ''
733       parmetis_lib = ''
734    
735    if useMPI and os.path.isdir(parmetis_lib_path):
736       env.Append(CPPDEFINES = [ 'PARMETIS' ])
737       env.Append(CXXDEFINES = [ 'PARMETIS' ])
738       env.Append(CPPPATH = [parmetis_path])
739       env.Append(LIBPATH = [parmetis_lib_path])
740       env.Append(LIBS = parmetis_lib)
741  # =============== PAPI =======================================  # =============== PAPI =======================================
742  try:  try:
743     includes = env['papi_path']     includes = env['papi_path']
# Line 714  except KeyError: Line 755  except KeyError:
755     papi_libs = None     papi_libs = None
756  # ============= set mpi =====================================  # ============= set mpi =====================================
757  if useMPI:  if useMPI:
758     env.Append(CPPDEFINES=['PASO_MPI',])     env.Append(CPPDEFINES=['PASO_MPI', 'MPI_NO_CPPBIND'])
759     try:     try:
760        includes = env['mpi_path']        includes = env['mpi_path']
761        env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
# Line 827  try: Line 868  try:
868     global_revision = re.sub(":.*", "", global_revision[0])     global_revision = re.sub(":.*", "", global_revision[0])
869     global_revision = re.sub("[^0-9]", "", global_revision)     global_revision = re.sub("[^0-9]", "", global_revision)
870  except:  except:
871     global_revision = "0"     global_revision="-1"
872       print "Warning: unable to recover global revsion number."
873    if global_revision == "": global_revision="0"
874    print "Revision number is %s."%global_revision
875  env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)  env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)
876    
877  # Python install - esys __init__.py  # Python install - esys __init__.py

Legend:
Removed from v.1343  
changed lines
  Added in v.1560

  ViewVC Help
Powered by ViewVC 1.1.26