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

Diff of /branches/refine/SConstruct

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

revision 1250 by ksteube, Thu Aug 16 02:54:42 2007 UTC revision 1663 by artak, Tue Jul 22 02:56:21 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 49  dir_packages = os.path.join(source_root, Line 51  dir_packages = os.path.join(source_root,
51  dir_examples = os.path.join(source_root,"examples")  dir_examples = os.path.join(source_root,"examples")
52  dir_libraries = os.path.join(source_root,"lib")  dir_libraries = os.path.join(source_root,"lib")
53    
54    print "Source root is : ",source_root
55  print " Default packages local installation:    ", dir_packages  print " Default packages local installation:    ", dir_packages
56  print " Default library local installation  ", dir_libraries  print " Default library local installation  ", dir_libraries
57  print " Default example local  installation:    ", dir_examples  print " Default example local  installation:    ", dir_examples
# Line 135  python_lib_default="python%s.%s"%(sys.ve Line 138  python_lib_default="python%s.%s"%(sys.ve
138  boost_path_default=os.path.join(tools_prefix,'include')  boost_path_default=os.path.join(tools_prefix,'include')
139  boost_lib_path_default=os.path.join(tools_prefix,'lib')  boost_lib_path_default=os.path.join(tools_prefix,'lib')
140  boost_lib_default=['boost_python']  boost_lib_default=['boost_python']
141    
142  #==========================================================================  #==========================================================================
143  #  #
144  #    check if netCDF is installed on the system:  #    check if netCDF is installed on the system:
145  #  #
146  netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')  netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')
147  netCDF_lib_path_default=os.path.join(tools_prefix,'lib','netcdf-3')  netCDF_lib_path_default=os.path.join(tools_prefix,'lib')
148    
149  if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):  if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):
150       useNetCDF_default='yes'       useNetCDF_default='yes'
# Line 153  else: Line 157  else:
157    
158  #==========================================================================  #==========================================================================
159  #  #
160    #  MPI:
161    #
162    if IS_WINDOWS_PLATFORM:
163       useMPI_default='no'
164       mpi_path_default=None
165       mpi_lib_path_default=None
166       mpi_libs_default=[]
167       mpi_run_default=None
168    else:
169       useMPI_default='no'
170       mpi_root='/usr/local'
171       mpi_path_default=os.path.join(mpi_root,'include')
172       mpi_lib_path_default=os.path.join(mpi_root,'lib')
173       mpi_libs_default=[ 'mpich' , 'pthread', 'rt' ]
174       mpi_run_default='mpiexec -np 1'
175    #
176    #==========================================================================
177    #
178  #    compile:  #    compile:
179  #  #
180  cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'  cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi'
181  cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'  cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi'
182  cxx_flags_default='--no-warn -ansi'  cxx_flags_default='--no-warn -ansi'
183  cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'  cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'
184    
185  #==============================================================================================      #==============================================================================================    
186  # Default options and options help text  # Default options and options help text
187  # These are defaults and can be overridden using command line arguments or an options file.  # These are defaults and can be overridden using command line arguments or an options file.
# Line 185  opts.AddOptions( Line 208  opts.AddOptions(
208    ('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"),    ('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"),
209  # Compilation options  # Compilation options
210    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
211      BoolOption('bounds_check', 'Do you want extra array bounds checking?', 'no'),
212    ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/<hostname>_options.py)", options_file),    ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/<hostname>_options.py)", options_file),
213    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
214    ('cc_flags','C compiler flags to use (Release build)', cc_flags_default),    ('cc_flags','C compiler flags to use (Release build)', cc_flags_default),
215    ('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default),    ('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default),
216    ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),    ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),
217    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', cxx_flags_debug_default),    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', cxx_flags_debug_default),
218      ('link_flags', 'Linker flags to use (Release build)', None),
219      ('link_flags_debug', 'Linker flags to use (Debug build)', None),
220    
221      ('omp_flags', 'OpenMP compiler flags to use (Release build)', ''),
222      ('omp_flags_debug', 'OpenMP compiler flags to use (Debug build)', ''),
223    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
224    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
225    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
# Line 212  opts.AddOptions( Line 241  opts.AddOptions(
241    PathOption('amd_path', 'Path to AMD includes', amd_path_default),    PathOption('amd_path', 'Path to AMD includes', amd_path_default),
242    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
243    ('amd_libs', 'AMD libraries to link with', amd_libs_default),    ('amd_libs', 'AMD libraries to link with', amd_libs_default),
244    # ParMETIS
245      ('parmetis_path', 'Path to ParMETIS includes', ''),
246      ('parmetis_lib_path', 'Path to ParMETIS library', ''),
247      ('parmetis_lib', 'ParMETIS library to link with', []),
248    # TRILINOS
249      PathOption('trilinos_path', 'Path to TRILINOS includes', None),
250      PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None),
251      ('trilinos_libs', 'TRILINOS libraries to link with', None),
252  # BLAS  # BLAS
253    PathOption('blas_path', 'Path to BLAS includes', None),    PathOption('blas_path', 'Path to BLAS includes', None),
254    PathOption('blas_lib_path', 'Path to BLAS libs', None),    PathOption('blas_lib_path', 'Path to BLAS libs', None),
# Line 239  opts.AddOptions( Line 276  opts.AddOptions(
276    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
277    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
278    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
279      ('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', None),
280  # MPI  # MPI
281    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),    BoolOption('useMPI', 'Compile parallel version using MPI', useMPI_default),
282      ('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'),
283      PathOption('mpi_path', 'Path to MPI includes', mpi_path_default),
284      ('mpi_run', 'mpirun name' , mpi_run_default),
285      PathOption('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)',mpi_lib_path_default),
286      ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', mpi_libs_default)
287  )  )
288  #=================================================================================================  #=================================================================================================
289  #  #
# Line 255  opts.AddOptions( Line 298  opts.AddOptions(
298    
299  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
300        env = Environment(tools = ['default', 'msvc'], options = opts)        env = Environment(tools = ['default', 'msvc'], options = opts)
301          #env = Environment(tools = ['default', 'intelc'], options = opts)
302  else:  else:
303     if os.uname()[4]=='ia64':     if socket.gethostname().split('.')[0] == 'service0':
304          env = Environment(tools = ['default', 'intelc'], options = opts)
305       elif os.uname()[4]=='ia64':
306        env = Environment(tools = ['default', 'intelc'], options = opts)        env = Environment(tools = ['default', 'intelc'], options = opts)
307        if env['CXX'] == 'icpc':        if env['CXX'] == 'icpc':
308           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 264  else: Line 310  else:
310        env = Environment(tools = ['default'], options = opts)        env = Environment(tools = ['default'], options = opts)
311  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
312    
313    if env['bounds_check']:
314       env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ])
315       env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ])
316       bounds_check = env['bounds_check']
317    else:
318       bounds_check = 0
319    
320  #=================================================================================================  #=================================================================================================
321  #  #
322  #     Initialise Scons Build Environment  #     Initialise Scons Build Environment
# Line 280  try: Line 333  try:
333     omp_num_threads = os.environ['OMP_NUM_THREADS']     omp_num_threads = os.environ['OMP_NUM_THREADS']
334  except KeyError:  except KeyError:
335     omp_num_threads = 1     omp_num_threads = 1
336    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
337    
338    try:
339       path = os.environ['PATH']
340       env['ENV']['PATH'] = path
341    except KeyError:
342       omp_num_threads = 1
343    
344  env['ENV']['OMP_NUM_THREADS'] = omp_num_threads  env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
345    
346    
347    # Copy some variables from the system environment to the build environment
348  try:  try:
349     env['ENV']['DISPLAY'] = os.environ['DISPLAY']     env['ENV']['DISPLAY'] = os.environ['DISPLAY']
350     env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']     env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']
351       home_temp = os.environ['HOME']   # MPICH2's mpd needs $HOME to find $HOME/.mpd.conf
352       env['ENV']['HOME'] = home_temp
353  except KeyError:  except KeyError:
354     pass     pass
355    
# Line 327  try: Line 391  try:
391     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
392     if IS_WINDOWS_PLATFORM :     if IS_WINDOWS_PLATFORM :
393        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
394          env.PrependENVPath('PATH', env['boost_lib_path'])
395  except KeyError:  except KeyError:
396     libinstall = None     libinstall = None
397  try:  try:
398     pyinstall = env['pyinstall'] # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc     pyinstall = env['pyinstall'] # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc
399  except KeyError:  except KeyError:
400     pyinstall = None     pyinstall = None
401    
402    try:
403       cc_defines = env['cc_defines']
404       env.Append(CPPDEFINES = cc_defines)
405    except KeyError:
406       pass
407    try:
408       flags = env['ar_flags']
409       env.Append(ARFLAGS = flags)
410    except KeyError:
411       ar_flags = None
412    try:
413       sys_libs = env['sys_libs']
414    except KeyError:
415       sys_libs = []
416    
417    try:
418       tar_flags = env['tar_flags']
419       env.Replace(TARFLAGS = tar_flags)
420    except KeyError:
421       pass
422    
423  try:  try:
424     exinstall = env['exinstall']     exinstall = env['exinstall']
425  except KeyError:  except KeyError:
# Line 349  try: Line 436  try:
436     sys_exinstall = env['sys_exinstall']     sys_exinstall = env['sys_exinstall']
437  except KeyError:  except KeyError:
438     sys_exinstall = None     sys_exinstall = None
439    
440    # ====================== debugging ===================================
441  try:  try:
442     dodebug = env['dodebug']     dodebug = env['dodebug']
443  except KeyError:  except KeyError:
444     dodebug = None     dodebug = None
445    
446    # === switch on omp ===================================================
447  try:  try:
448     useMPI = env['useMPI']    omp_flags = env['omp_flags']
449  except KeyError:  except KeyError:
450     useMPI = None    omp_flags = ''
451    
452  try:  try:
453     cc_defines = env['cc_defines']    omp_flags_debug = env['omp_flags_debug']
    env.Append(CPPDEFINES = cc_defines)  
454  except KeyError:  except KeyError:
455     pass    omp_flags_debug = ''
456    
457    # ========= use mpi? =====================================================
458    try:
459       useMPI = env['useMPI']
460    except KeyError:
461       useMPI = None
462    # ========= set compiler flags ===========================================
463    
464  if dodebug:  if dodebug:
   if useMPI:  
465      try:      try:
466        flags = env['cc_flags_debug_MPI']        flags = env['cc_flags_debug'] + ' ' + omp_flags_debug
       env.Append(CCFLAGS = flags)  
     except KeyError:  
       pass  
   else:  
     try:  
       flags = env['cc_flags_debug']  
467        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
468      except KeyError:      except KeyError:
469        pass        pass
470  else:  else:
   if useMPI:  
471     try:     try:
472       flags = env['cc_flags_MPI']        flags = env['cc_flags'] + ' ' + omp_flags
      env.Append(CCFLAGS = flags)  
    except KeyError:  
       pass  
   else:  
    try:  
       flags = env['cc_flags']  
473        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
474     except KeyError:     except KeyError:
475        pass        pass
476  if dodebug:  if dodebug:
    if useMPI:  
477       try:       try:
478          flags = env['cxx_flags_debug_MPI']          flags = env['cxx_flags_debug']
479          env.Append(CXXFLAGS = flags)          env.Append(CXXFLAGS = flags)
480       except KeyError:       except KeyError:
481          pass          pass
482     else:  else:
483       try:       try:
484          flags = env['cxx_flags_debug']          flags = env['cxx_flags']
485          env.Append(CXXFLAGS = flags)          env.Append(CXXFLAGS = flags)
486       except KeyError:       except KeyError:
487          pass          pass
488  else:  
489     if useMPI:  # Impassioned plea - please do this sort of thing in the options files.
490    try:
491         #if env['CC'] == 'gcc': env.Append(CCFLAGS = "-pedantic-errors -Wno-long-long")
492         pass
493    except:
494         pass
495    
496    if dodebug:
497       try:       try:
498          flags = env['cxx_flags_MPI']          flags = env['link_flags_debug']
499          env.Append(CXXFLAGS = flags)          env.Append(LINKFLAGS = flags)
500       except KeyError:       except KeyError:
501          pass          pass
502     else:  else:
503       try:       try:
504          flags = env['cxx_flags']          flags = env['link_flags']
505          env.Append(CXXFLAGS = flags)          env.Append(LINKFLAGS = flags)
506       except KeyError:       except KeyError:
507          pass          pass
 try:  
    flags = env['ar_flags']  
    env.Append(ARFLAGS = flags)  
 except KeyError:  
    ar_flags = None  
 try:  
    sys_libs = env['sys_libs']  
 except KeyError:  
    sys_libs = []  
508    
509  try:  # ============= Remember what options were used in the compile =====================================
510     tar_flags = env['tar_flags']  if not IS_WINDOWS_PLATFORM:
511     env.Replace(TARFLAGS = tar_flags)    env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*")
512  except KeyError:    if dodebug:       env.Execute("touch " + libinstall + "/Compiled.with.debug")
513     pass    if useMPI:        env.Execute("touch " + libinstall + "/Compiled.with.mpi")
514      if omp_flags != '':   env.Execute("touch " + libinstall + "/Compiled.with.OpenMP")
515      if bounds_check:  env.Execute("touch " + libinstall + "/Compiled.with.bounds_check")
516    
517  try:  # ============= set mkl (but only of no MPI) =====================================
518     includes = env['mkl_path']  if not useMPI:
519     env.Append(CPPPATH = [includes,])     try:
520  except KeyError:        includes = env['mkl_path']
521     pass        env.Append(CPPPATH = [includes,])
522       except KeyError:
523          pass
524    
525  try:     try:
526     lib_path = env['mkl_lib_path']        lib_path = env['mkl_lib_path']
527     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
528  except KeyError:        env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
529     pass     except KeyError:
530          pass
531    
 if useMPI:  
    mkl_libs = []  
 else:  
532     try:     try:
533        mkl_libs = env['mkl_libs']        mkl_libs = env['mkl_libs']
534     except KeyError:     except KeyError:
535        mkl_libs = []        mkl_libs = []
536    else:
537         mkl_libs = []
538    
539  try:  # ============= set scsl (but only of no MPI) =====================================
540     includes = env['scsl_path']  if not useMPI:
541     env.Append(CPPPATH = [includes,])     try:
542  except KeyError:        includes = env['scsl_path']
543     pass        env.Append(CPPPATH = [includes,])
544       except KeyError:
545          pass
546    
547  try:     try:
548     lib_path = env['scsl_lib_path']        lib_path = env['scsl_lib_path']
549     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
550  except KeyError:        env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
551     pass     except KeyError:
552          pass
553      
554       try:
555          scsl_libs = env['scsl_libs']
556       except KeyError:
557          scsl_libs = [ ]
558    
559  if useMPI:  else:
560    try:      scsl_libs =  []
     scsl_libs = env['scsl_libs_MPI']  
   except KeyError:  
     scsl_libs = []  
 else:  
   try:  
     scsl_libs = env['scsl_libs']  
   except KeyError:  
     scsl_libs = []  
561    
562  try:  # ============= set TRILINOS (but only with MPI) =====================================
563     includes = env['umf_path']  if useMPI:
564     env.Append(CPPPATH = [includes,])     try:
565  except KeyError:        includes = env['trilinos_path']
566     pass        env.Append(CPPPATH = [includes,])
567       except KeyError:
568          pass
569    
570  try:     try:
571     lib_path = env['umf_lib_path']        lib_path = env['trilinos_lib_path']
572     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
573  except KeyError:     except KeyError:
574     pass        pass
575    
576  if useMPI:     try:
577      umf_libs = []        trilinos_libs = env['trilinos_libs']
578       except KeyError:
579          trilinos_libs = []
580  else:  else:
581         trilinos_libs = []
582    
583    
584    # ============= set umfpack (but only without MPI) =====================================
585    umf_libs=[ ]
586    if not useMPI:
587       try:
588          includes = env['umf_path']
589          env.Append(CPPPATH = [includes,])
590       except KeyError:
591          pass
592    
593       try:
594          lib_path = env['umf_lib_path']
595          env.Append(LIBPATH = [lib_path,])
596       except KeyError:
597          pass
598    
599     try:     try:
600        umf_libs = env['umf_libs']        umf_libs = env['umf_libs']
601          umf_libs+=umf_libs
602     except KeyError:     except KeyError:
603        umf_libs = []        pass
604    
605  try:     try:
606     includes = env['ufc_path']        includes = env['ufc_path']
607     env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
608  except KeyError:     except KeyError:
609     pass        pass
610    
611  try:     try:
612     includes = env['amd_path']        includes = env['amd_path']
613     env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
614  except KeyError:     except KeyError:
615     pass        pass
616    
617  try:     try:
618     lib_path = env['amd_lib_path']        lib_path = env['amd_lib_path']
619     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
620  except KeyError:     except KeyError:
621     pass        pass
622    
 if useMPI:  
     amd_libs = []  
 else:  
623     try:     try:
624        amd_libs = env['amd_libs']        amd_libs = env['amd_libs']
625          umf_libs+=amd_libs
626       except KeyError:
627          pass
628    
629    # ============= set TRILINOS (but only with MPI) =====================================
630    if useMPI:
631       try:
632          includes = env['trilinos_path']
633          env.Append(CPPPATH = [includes,])
634       except KeyError:
635          pass
636    
637       try:
638          lib_path = env['trilinos_lib_path']
639          env.Append(LIBPATH = [lib_path,])
640     except KeyError:     except KeyError:
641        amd_libs = []        pass
642    
643       try:
644          trilinos_libs = env['trilinos_libs']
645       except KeyError:
646          trilinos_libs = []
647    else:
648         trilinos_libs = []
649    
650    # ============= set blas =====================================
651  try:  try:
652     includes = env['blas_path']     includes = env['blas_path']
653     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 536  except KeyError: Line 663  except KeyError:
663  try:  try:
664     blas_libs = env['blas_libs']     blas_libs = env['blas_libs']
665  except KeyError:  except KeyError:
666     blas_libs = []     blas_libs = [ ]
667    
668    # ========== netcdf ====================================
669  try:  try:
670     useNetCDF = env['useNetCDF']     useNetCDF = env['useNetCDF']
671  except KeyError:  except KeyError:
672     useNetCDF = 'yes'     useNetCDF = 'yes'
673     pass     pass
674        
675  if useNetCDF == 'yes':  if useNetCDF == 'yes':
676     try:     try:
677        netCDF_libs = env['netCDF_libs']        netCDF_libs = env['netCDF_libs']
# Line 561  if useNetCDF == 'yes': Line 689  if useNetCDF == 'yes':
689     try:     try:
690        lib_path = env['netCDF_lib_path']        lib_path = env['netCDF_lib_path']
691        env.Append(LIBPATH = [ lib_path, ])        env.Append(LIBPATH = [ lib_path, ])
692          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
693        if IS_WINDOWS_PLATFORM :        if IS_WINDOWS_PLATFORM :
694           env.PrependENVPath('PATH', lib_path)           env.PrependENVPath('PATH', lib_path)
695     except KeyError:     except KeyError:
# Line 569  else: Line 698  else:
698     print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."     print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
699     netCDF_libs=[ ]     netCDF_libs=[ ]
700    
701    # ====================== boost ======================================
702  try:  try:
703     includes = env['boost_path']     includes = env['boost_path']
704     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 577  except KeyError: Line 707  except KeyError:
707  try:  try:
708     lib_path = env['boost_lib_path']     lib_path = env['boost_lib_path']
709     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
710       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
711     if IS_WINDOWS_PLATFORM :     if IS_WINDOWS_PLATFORM :
712        env.PrependENVPath('PATH', lib_path)        env.PrependENVPath('PATH', lib_path)
713  except KeyError:  except KeyError:
# Line 585  try: Line 716  try:
716     boost_lib = env['boost_lib']     boost_lib = env['boost_lib']
717  except KeyError:  except KeyError:
718     boost_lib = None     boost_lib = None
719    # ====================== python ======================================
720  try:  try:
721     includes = env['python_path']     includes = env['python_path']
722     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 592  except KeyError: Line 724  except KeyError:
724     pass     pass
725  try:  try:
726     lib_path = env['python_lib_path']     lib_path = env['python_lib_path']
727       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
728     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
729  except KeyError:  except KeyError:
730     pass     pass
# Line 599  try: Line 732  try:
732     python_lib = env['python_lib']     python_lib = env['python_lib']
733  except KeyError:  except KeyError:
734     python_lib = None     python_lib = None
735    # =============== documentation =======================================
736  try:  try:
737     doxygen_path = env['doxygen_path']     doxygen_path = env['doxygen_path']
738  except KeyError:  except KeyError:
# Line 607  try: Line 741  try:
741     epydoc_path = env['epydoc_path']     epydoc_path = env['epydoc_path']
742  except KeyError:  except KeyError:
743     epydoc_path = None     epydoc_path = None
744    # =============== ParMETIS =======================================
745    try:
746       parmetis_path = env['parmetis_path']
747       parmetis_lib_path = env['parmetis_lib_path']
748       parmetis_lib = env['parmetis_lib']
749    except KeyError:
750       parmetis_path = ''
751       parmetis_lib_path = ''
752       parmetis_lib = ''
753    
754    if useMPI and os.path.isdir(parmetis_lib_path):
755       env.Append(CPPDEFINES = [ 'PARMETIS' ])
756       env.Append(CXXDEFINES = [ 'PARMETIS' ])
757       env.Append(CPPPATH = [parmetis_path])
758       env.Append(LIBPATH = [parmetis_lib_path])
759       env.Append(LIBS = parmetis_lib)
760    # =============== PAPI =======================================
761    try:
762       includes = env['papi_path']
763       env.Append(CPPPATH = [includes,])
764    except KeyError:
765       pass
766    try:
767       lib_path = env['papi_lib_path']
768       env.Append(LIBPATH = [lib_path,])
769    except KeyError:
770       pass
771    try:
772       papi_libs = env['papi_libs']
773    except KeyError:
774       papi_libs = None
775    # ============= set mpi =====================================
776    if useMPI:
777       env.Append(CPPDEFINES=['PASO_MPI', 'MPI_NO_CPPBIND'])
778       try:
779          includes = env['mpi_path']
780          env.Append(CPPPATH = [includes,])
781       except KeyError:
782          pass
783       try:
784          lib_path = env['mpi_lib_path']
785          env.Append(LIBPATH = [lib_path,])
786          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
787       except KeyError:
788          pass
789       try:
790          mpi_libs = env['mpi_libs']
791       except KeyError:
792          mpi_libs = []
793    
794       try:
795          mpi_run = env['mpi_run']
796       except KeyError:
797          mpi_run = ''
798    
799       try:
800           mpich_ignore_cxx_seek=env['MPICH_IGNORE_CXX_SEEK']
801           env.Append(CPPDEFINES = [ mpich_ignore_cxx_seek ] )
802       except KeyError:
803          pass
804    else:
805      mpi_libs=[]
806      mpi_run = mpi_run_default
807    # =========== zip files ===========================================
808  try:  try:
809     includes = env['papi_path']     includes = env['papi_path']
810     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 621  try: Line 819  try:
819     papi_libs = env['papi_libs']     papi_libs = env['papi_libs']
820  except KeyError:  except KeyError:
821     papi_libs = None     papi_libs = None
822    try:
823       papi_instrument_solver = env['papi_instrument_solver']
824    except KeyError:
825       papi_instrument_solver = None
826    
827    
828    # ============= and some helpers =====================================
829    try:
830       doxygen_path = env['doxygen_path']
831    except KeyError:
832       doxygen_path = None
833    try:
834       epydoc_path = env['epydoc_path']
835    except KeyError:
836       epydoc_path = None
837  try:  try:
838     src_zipfile = env.File(env['src_zipfile'])     src_zipfile = env.File(env['src_zipfile'])
839  except KeyError:  except KeyError:
# Line 670  except KeyError: Line 881  except KeyError:
881     api_doxygen = None     api_doxygen = None
882    
883  try:  try:
884     svn_pipe = os.popen("svnversion -n")     svn_pipe = os.popen("svnversion -n .")
885     global_revision = svn_pipe.readlines()     global_revision = svn_pipe.readlines()
886     svn_pipe.close()     svn_pipe.close()
887       global_revision = re.sub(":.*", "", global_revision[0])
888     global_revision = re.sub("[^0-9]", "", global_revision)     global_revision = re.sub("[^0-9]", "", global_revision)
889  except:  except:
890     global_revision = "0"     global_revision="-1"
891  env.Append(CPPDEFINES = "SVN_VERSION="+global_revision[0])     print "Warning: unable to recover global revsion number."
892    if global_revision == "": global_revision="0"
893    print "Revision number is %s."%global_revision
894    env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)
895    
896  # Python install - esys __init__.py  # Python install - esys __init__.py
897  init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))  init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))
# Line 708  env.Alias('all_tests', ['run_tests', 'py Line 923  env.Alias('all_tests', ['run_tests', 'py
923    
924    
925  # Allow sconscripts to see the env  # Allow sconscripts to see the env
926  Export(["env", "incinstall", "libinstall", "pyinstall", "exinstall", "dodebug",  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "blas_libs", "netCDF_libs", "useNetCDF", "mpi_run",
         "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs",  
         "netCDF_libs",  
927      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
928          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile",          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile", "trilinos_libs", "mpi_libs", "papi_instrument_solver",
929          "src_tarfile", "examples_tarfile", "examples_zipfile",          "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ])
         "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI"  
         ])  
930    
931  # End initialisation section  # End initialisation section
932  # Begin configuration section  # Begin configuration section
933  # adds this file and the scons option directore to the source tar  # adds this file and the scons option directore to the source tar
934  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') ]
935  release_testfiles=[env.File('README_TESTS'),]  release_testfiles=[env.File('README_TESTS'),]
936  env.Zip(src_zipfile, release_srcfiles)  env.Zip(src_zipfile, release_srcfiles)
937  env.Zip(test_zipfile, release_testfiles)  env.Zip(test_zipfile, release_testfiles)
# Line 735  except AttributeError: Line 946  except AttributeError:
946  # Third Party libraries  # Third Party libraries
947  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
948  # C/C++ Libraries  # C/C++ Libraries
949    env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
950    env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
951  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
952  # bruce is removed for now as it doesn't really do anything  # bruce is removed for now as it doesn't really do anything
953  # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)  # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
 env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)  
 env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  
954  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
955  env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0)  env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0)
956  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
957  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
958  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
   
 # added by Ben Cumming  
959  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
960  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)
961    

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

  ViewVC Help
Powered by ViewVC 1.1.26