/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 863 by matt, Wed Oct 4 01:01:15 2006 UTC revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC
# Line 1  Line 1 
1  #          Copyright 2006 by ACcESS MNRF  #         Copyright 2006 by ACcESS MNRF
2  #  #
3  #              http://www.access.edu.au  #              http://www.access.edu.au
4  #       Primary Business: Queensland, Australia  #       Primary Business: Queensland, Australia
# Line 47  if os.path.isdir('/opt/UFconfig'): Line 47  if os.path.isdir('/opt/UFconfig'):
47  else:  else:
48     ufc_path_default=None     ufc_path_default=None
49    
50    if os.path.isdir('/usr/local/include') and os.path.isdir('/usr/local/lib'):
51      netCDF_path_default='/usr/local/include'
52      netCDF_lib_path_default='/usr/local/lib'
53      netCDF_libs_cxx_default=[ 'netcdf_c++', 'netcdf']
54    else:
55      netCDF_path_default=None
56      netCDF_lib_path_default=None
57      netCDF_libs_cxx_default=None
58  # Default options and options help text  # Default options and options help text
59  # 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.
60  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
# Line 62  else: Line 70  else:
70        else:        else:
71           hostname+="_"           hostname+="_"
72     options_file = "scons/"+hostname+"_options.py"     options_file = "scons/"+hostname+"_options.py"
73    if os.path.isfile(options_file):
74       print "option file is ",options_file,"."
75    else:
76       print "option file is ",options_file, "(not present)."
77    
78  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
79  opts.AddOptions(  opts.AddOptions(
# Line 82  opts.AddOptions( Line 94  opts.AddOptions(
94    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
95    ('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),
96    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
97    ('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas'),    ('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),
98    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas'),    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),
99    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
100    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),
101    ('cc_flags_MPI','C compiler flags to use (Release MPI build)', '-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -fno-alias -c99 -w1 -fpic -wd161'),    ('cc_flags_MPI','C compiler flags to use (Release MPI build)', '-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -fno-alias -c99 -w1 -fpic -wd161'),
# Line 115  opts.AddOptions( Line 127  opts.AddOptions(
127    PathOption('blas_path', 'Path to BLAS includes', None),    PathOption('blas_path', 'Path to BLAS includes', None),
128    PathOption('blas_lib_path', 'Path to BLAS libs', None),    PathOption('blas_lib_path', 'Path to BLAS libs', None),
129    ('blas_libs', 'BLAS libraries to link with', None),    ('blas_libs', 'BLAS libraries to link with', None),
130    # netCDF
131      ('useNetCDF', 'switch on/off the usage of netCDF', 'yes'),
132      PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
133      PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
134      ('netCDF_libs_cxx', 'netCDF C++ libraries to link with', netCDF_libs_cxx_default),
135  # Python  # Python
136  # locations of include files for python  # locations of include files for python
137    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),
# Line 134  opts.AddOptions( Line 151  opts.AddOptions(
151  # MPI  # MPI
152    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
153  )  )
   
 # Initialise Scons Build Environment  
 # check for user environment variables we are interested in  
 try:  
    python_path = os.environ['PYTHONPATH']  
 except KeyError:  
    python_path = ''  
 try:  
    path = os.environ['PATH']  
 except KeyError:  
    path = ''  
 try:  
    ld_library_path = os.environ['LD_LIBRARY_PATH']  
 except KeyError:  
    ld_library_path = ''  
   
154  # Note: On the Altix the intel compilers are not automatically  # Note: On the Altix the intel compilers are not automatically
155  # detected by scons intelc.py script. The Altix has a different directory  # detected by scons intelc.py script. The Altix has a different directory
156  # path and in some locations the "modules" facility is used to support  # path and in some locations the "modules" facility is used to support
# Line 159  except KeyError: Line 160  except KeyError:
160  # 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
161    
162  if os.name != "nt" and os.uname()[4]=='ia64':  if os.name != "nt" and os.uname()[4]=='ia64':
163     env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts)     env = Environment(tools = ['default', 'intelc'], options = opts)
    env['ENV']['PATH'] = path  
    env['ENV']['LD_LIBRARY_PATH'] = ld_library_path  
    env['ENV']['PYTHONPATH'] = python_path  
164     if env['CXX'] == 'icpc':     if env['CXX'] == 'icpc':
165        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
166  elif os.name == "nt":  elif os.name == "nt":
167     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(tools = ['default', 'msvc'], options = opts)
    env['ENV']['PYTHONPATH'] = python_path  
168  else:  else:
169     env = Environment(tools = ['default'], options = opts)     env = Environment(tools = ['default'], options = opts)
170    # Initialise Scons Build Environment
171    # check for user environment variables we are interested in
172    try:
173       python_path = os.environ['PYTHONPATH']
174       env['ENV']['PYTHONPATH'] = python_path
175    except KeyError:
176       python_path = ''
177    
178    try:
179       path = os.environ['PATH']
180     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
181    except KeyError:
182       path = ''
183    try:
184       ld_library_path = os.environ['LD_LIBRARY_PATH']
185     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
186     env['ENV']['PYTHONPATH'] = python_path  except KeyError:
187       ld_library_path = ''
188    
189    
190  # Setup help for options  # Setup help for options
191  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
# Line 404  except KeyError: Line 417  except KeyError:
417     blas_libs = ''     blas_libs = ''
418    
419  try:  try:
420       useNetCDF = env['useNetCDF']
421    except KeyError:
422       useNetCDF = 'yes'
423       pass
424    
425    if not useNetCDF == 'yes':
426       print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
427      
428    if useNetCDF == 'yes':
429       try:
430          includes = env['netCDF_path']
431          env.Append(CPPPATH = [includes,])
432       except KeyError:
433          pass
434    
435       try:
436          lib_path = env['netCDF_lib_path']
437          env.Append(LIBPATH = [lib_path,])
438       except KeyError:
439          pass
440    
441       try:
442          netCDF_libs_cxx = env['netCDF_libs_cxx']
443       except KeyError:
444          netCDF_libs_cxx = [ ]
445    else:
446       netCDF_libs_cxx=[ ]
447    
448    try:
449     includes = env['boost_path']     includes = env['boost_path']
450     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
451  except KeyError:  except KeyError:
# Line 520  init_target = env.Command(pyinstall+'/__ Line 562  init_target = env.Command(pyinstall+'/__
562  env.Alias(init_target)  env.Alias(init_target)
563    
564  # Allow sconscripts to see the env  # Allow sconscripts to see the env
565  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs_cxx", "useNetCDF",
566      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
567          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
568          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])
# Line 542  env.Tar(test_tarfile, release_testfiles) Line 584  env.Tar(test_tarfile, release_testfiles)
584  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)
585  # C/C++ Libraries  # C/C++ Libraries
586  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
587  env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)  # bruce is removed for now as it doesn't really do anything
588    # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
589  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
590  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
591  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
592  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)
593  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
594  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)
595    env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
596    
597  # added by Ben Cumming  # added by Ben Cumming
598  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)

Legend:
Removed from v.863  
changed lines
  Added in v.1028

  ViewVC Help
Powered by ViewVC 1.1.26