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

Diff of /branches/escript3047_with_pastix2995/SConstruct

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

revision 965 by gross, Tue Feb 13 05:38:45 2007 UTC revision 1244 by phornby, Mon Aug 13 07:13:17 2007 UTC
# Line 4  Line 4 
4  #       Primary Business: Queensland, Australia  #       Primary Business: Queensland, Australia
5  #  Licensed under the Open Software License version 3.0  #  Licensed under the Open Software License version 3.0
6  #     http://www.opensource.org/licenses/osl-3.0.php  #     http://www.opensource.org/licenses/osl-3.0.php
 #  
 #  
 #  
7    
8  # top-level Scons configuration file for all esys13 modules  # top-level Scons configuration file for all esys13 modules
9  # Begin initialisation Section  # Begin initialisation Section
# Line 15  Line 12 
12  EnsureSConsVersion(0,96,91)  EnsureSConsVersion(0,96,91)
13  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
14    
15  # import tools:  #===============================================================
16    #   import tools:
17  import glob  import glob
18  import sys, os  import sys, os
19  import socket  import socket
# Line 23  import socket Line 21  import socket
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  # check if UMFPACK is installed on the system:  #===============================================================
 if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib'):  
    umf_path_default='/opt/UMFPACK/Include'  
    umf_lib_path_default='/opt/UMFPACK/Lib'  
    umf_libs_default=['umfpack']  
 else:  
    umf_path_default=None  
    umf_lib_path_default=None  
    umf_libs_default=None  
25    
26  if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'):  tools_prefix="/usr"
27     amd_path_default='/opt/AMD/Include'  
28     amd_lib_path_default='/opt/AMD/Lib'  #==============================================================================================    
29     amd_libs_default=['amd']  #    
30  else:  #    get the installation prefix
31     amd_path_default=None  #
32     amd_lib_path_default=None  prefix = ARGUMENTS.get('prefix', '/usr')
    amd_libs_default=None  
33    
34  if os.path.isdir('/opt/UFconfig'):  # We may also need to know where python's site-packages subdirectory lives
35     ufc_path_default='/opt/UFconfig'  python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])
36    
37    # Install as a standard python package in /usr/lib64 if available, else in /usr/lib
38    if os.path.isdir(  prefix+"/lib64/"+python_version+"/site-packages"):
39       sys_dir_packages =  prefix+"/lib64/"+python_version+"/site-packages/esys"
40       sys_dir_libraries = prefix+"/lib64"
41  else:  else:
42     ufc_path_default=None     sys_dir_packages =  prefix+"/lib/"+python_version+"/site-packages/esys"
43       sys_dir_libraries = prefix+"/lib"
44    
45    sys_dir_examples = prefix+"/share/doc/esys"
46    
47    source_root = Dir('#.').abspath
48    
49    dir_packages = os.path.join(source_root,"esys")
50    dir_examples = os.path.join(source_root,"examples")
51    dir_libraries = os.path.join(source_root,"lib")
52    
53    print " Default packages local installation:    ", dir_packages
54    print " Default library local installation  ", dir_libraries
55    print " Default example local  installation:    ", dir_examples
56    print "Install prefix is: ", prefix
57    print " Default packages system installation:   ", sys_dir_packages
58    print " Default library system installation     ", sys_dir_libraries
59    print " Default example system installation:    ", sys_dir_examples
60    
61    #==============================================================================================    
62    
63  # Default options and options help text  # Default options and options help text
64  # 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.
65  # 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
66  # DO NOT CHANGE THEM HERE  # DO NOT CHANGE THEM HERE
67    # Where to install?
68    #==============================================================================================    
69    #    
70    #    get the options file if present:
71    #
72  if ARGUMENTS.get('options_file',0):  if ARGUMENTS.get('options_file',0):
73     options_file = ARGUMENTS.get('options_file',0)     options_file = ARGUMENTS.get('options_file',0)
74  else:  else:
# Line 61  else: Line 79  else:
79           hostname+=s           hostname+=s
80        else:        else:
81           hostname+="_"           hostname+="_"
82     options_file = "scons/"+hostname+"_options.py"     options_file = os.path.join("scons",hostname+"_options.py")
83      
84    if os.path.isfile(options_file):
85       print "option file is ",options_file,"."
86    else:
87       print "option file is ",options_file, "(not present)."
88    # and load it
89  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
90    #================================================================
91    #
92    #   check if UMFPACK is installed on the system:
93    #
94    uf_root=None
95    for i in [ 'UMFPACK', 'umfpack', 'ufsparse', 'UFSPARSE']:
96       if os.path.isdir(os.path.join(tools_prefix,'include',i)):
97           uf_root=i
98           print i," is used form ",tools_prefix
99           break
100    if not uf_root==None:
101       umf_path_default=os.path.join(tools_prefix,'include',uf_root)
102       umf_lib_path_default=os.path.join(tools_prefix,'lib')
103       umf_libs_default=['umfpack']
104       amd_path_default=os.path.join(tools_prefix,'include',uf_root)
105       amd_lib_path_default=os.path.join(tools_prefix,'lib')
106       amd_libs_default=['amd']
107       ufc_path_default=os.path.join(tools_prefix,'include',uf_root)
108    else:
109       umf_path_default=None
110       umf_lib_path_default=None
111       umf_libs_default=None
112       amd_path_default=None
113       amd_lib_path_default=None
114       amd_libs_default=None
115       ufc_path_default=None
116    #
117    #==========================================================================
118    #
119    #    python installation:
120    #
121    python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1]))
122    python_lib_path_default=os.path.join(tools_prefix,'lib')
123    python_lib_default="python%s.%s"%(sys.version_info[0],sys.version_info[1])
124    
125    #==========================================================================
126    #
127    #    boost installation:
128    #
129    boost_path_default=os.path.join(tools_prefix,'include')
130    boost_lib_path_default=os.path.join(tools_prefix,'lib')
131    boost_lib_default=['boost_python']
132    #==========================================================================
133    #
134    #    check if netCDF is installed on the system:
135    #
136    netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')
137    netCDF_lib_path_default=os.path.join(tools_prefix,'lib','netcdf-3')
138    
139    if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):
140         useNetCDF_default='yes'
141         netCDF_libs_default=[ 'netcdf_c++', 'netcdf' ]
142    else:
143         useNetCDF_default='no'
144         netCDF_path_default=None
145         netCDF_lib_path_default=None
146         netCDF_libs_default=None
147    
148    #==========================================================================
149    #
150    #    compile:
151    #
152    cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'
153    cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'
154    cxx_flags_default='--no-warn -ansi'
155    cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'
156    #==============================================================================================    
157    # Default options and options help text
158    # These are defaults and can be overridden using command line arguments or an options file.
159    # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
160    # DO NOT CHANGE THEM HERE
161  opts.AddOptions(  opts.AddOptions(
162  # Where to install esys stuff  # Where to install esys stuff
163    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),    ('incinstall', 'where the esys headers will be installed',             Dir('#.').abspath+'/include'),
164    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),    ('libinstall', 'where the esys libraries will be installed',           dir_libraries),
165    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),    ('pyinstall', 'where the esys python modules will be installed',       dir_packages),
166    ('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"),    ('exinstall', 'where the esys examples will be installed',             dir_examples),
167    ('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"),    ('sys_libinstall', 'where the system esys libraries will be installed',       sys_dir_libraries),
168    ('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"),    ('sys_pyinstall', 'where the system esys python modules will be installed',   sys_dir_packages),
169    ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),    ('sys_exinstall', 'where the system esys examples will be installed',         sys_dir_examples),
170    ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),    ('src_zipfile', 'the source zip file will be installed.',              Dir('#.').abspath+"/release/escript_src.zip"),
171    ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),    ('test_zipfile', 'the test zip file will be installed.',               Dir('#.').abspath+"/release/escript_tests.zip"),
172    ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),    ('src_tarfile', 'the source tar file will be installed.',              Dir('#.').abspath+"/release/escript_src.tar.gz"),
173    ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),    ('test_tarfile', 'the test tar file will be installed.',               Dir('#.').abspath+"/release/escript_tests.tar.gz"),
174    ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),    ('examples_tarfile', 'the examples tar file will be installed.',       Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),
175      ('examples_zipfile', 'the examples zip file will be installed.',       Dir('#.').abspath+"/release/doc/escript_examples.zip"),
176      ('guide_pdf', 'name of the user guide in pdf format',                  Dir('#.').abspath+"/release/doc/user/guide.pdf"),
177      ('api_epydoc', 'name of the epydoc api docs directory',                Dir('#.').abspath+"/release/doc/epydoc"),
178      ('guide_html', 'name of the directory for user guide in html format',  Dir('#.').abspath+"/release/doc/user/html"),
179      ('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"),
180  # Compilation options  # Compilation options
181    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
182    ('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),
183    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
184    ('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)', cc_flags_default),
185    ('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)', cc_flags_debug_default),
186    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),
187    ('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)', cxx_flags_debug_default),
   ('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_debug_MPI', 'C compiler flags to use (Debug MPI build)', '-g -O0 -c99 -w1 -fpic -wd161'),  
   ('cxx_flags_MPI', 'C++ compiler flags to use (Release MPI build)', '-ansi -wd1563 -wd161'),  
   ('cxx_flags_debug_MPI', 'C++ compiler flags to use (Debug MPI build)', '-ansi -DDOASSERT -DDOPROF -wd1563 -wd161'),  
188    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
189    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
190    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
# Line 116  opts.AddOptions( Line 211  opts.AddOptions(
211    PathOption('blas_lib_path', 'Path to BLAS libs', None),    PathOption('blas_lib_path', 'Path to BLAS libs', None),
212    ('blas_libs', 'BLAS libraries to link with', None),    ('blas_libs', 'BLAS libraries to link with', None),
213  # netCDF  # netCDF
214    PathOption('netCDF_path', 'Path to netCDF includes', '/usr/local/include'),    ('useNetCDF', 'switch on/off the usage of netCDF', useNetCDF_default),
215    PathOption('netCDF_lib_path', 'Path to netCDF libs', '/usr/local/lib'),    PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
216    ('netCDF_libs_cxx', 'netCDF C++ libraries to link with', [ 'netcdf_c++', 'netcdf'] ),    PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
217      ('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default),
218  # Python  # Python
219  # locations of include files for python  # locations of include files for python
220    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),  # FIXME: python_path should be python_inc_path and the same for boost etc.
221    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),    PathOption('python_path', 'Path to Python includes', python_path_default),
222    ('python_lib', 'Python libraries to link with', ["python%s.%s"%(sys.version_info[0],sys.version_info[1]),]),    PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default),
223      ('python_lib', 'Python libraries to link with', python_lib_default),
224      ('python_cmd', 'Python command', 'python'),
225  # Boost  # Boost
226    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),    PathOption('boost_path', 'Path to Boost includes', boost_path_default),
227    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_lib_path', 'Path to Boost libs', boost_lib_path_default),
228    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),    ('boost_lib', 'Boost libraries to link with', boost_lib_default),
229  # Doc building  # Doc building
230  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
231  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),
# Line 138  opts.AddOptions( Line 236  opts.AddOptions(
236  # MPI  # MPI
237    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
238  )  )
239    #=================================================================================================
240    #
241    #   Note: On the Altix the intel compilers are not automatically
242    #   detected by scons intelc.py script. The Altix has a different directory
243    #   path and in some locations the "modules" facility is used to support
244    #   multiple compiler versions. This forces the need to import the users PATH
245    #   environment which isn't the "scons way"
246    #   This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms)
247    #   FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
248    #
249    IS_WINDOWS_PLATFORM = (os.name== "nt")
250    
251    if IS_WINDOWS_PLATFORM:
252          env = Environment(tools = ['default', 'msvc'], options = opts)
253    else:
254       if os.uname()[4]=='ia64':
255          env = Environment(tools = ['default', 'intelc'], options = opts)
256          if env['CXX'] == 'icpc':
257             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
258       else:
259          env = Environment(tools = ['default'], options = opts)
260    Help(opts.GenerateHelpText(env))
261    
262    #=================================================================================================
263    #
264    #     Initialise Scons Build Environment
265    #     check for user environment variables we are interested in
266    try:
267       tmp = os.environ['PYTHONPATH']
268       env['ENV']['PYTHONPATH'] = tmp
269    except KeyError:
270       pass
271    
272    env.PrependENVPath('PYTHONPATH', source_root)
273    
 # Initialise Scons Build Environment  
 # check for user environment variables we are interested in  
274  try:  try:
275     python_path = os.environ['PYTHONPATH']     omp_num_threads = os.environ['OMP_NUM_THREADS']
276  except KeyError:  except KeyError:
277     python_path = ''     omp_num_threads = 1
278    
279    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
280    
281  try:  try:
282     path = os.environ['PATH']     env['ENV']['DISPLAY'] = os.environ['DISPLAY']
283       env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']
284  except KeyError:  except KeyError:
285     path = ''     pass
 try:  
    ld_library_path = os.environ['LD_LIBRARY_PATH']  
 except KeyError:  
    ld_library_path = ''  
   
 # Note: On the Altix the intel compilers are not automatically  
 # detected by scons intelc.py script. The Altix has a different directory  
 # path and in some locations the "modules" facility is used to support  
 # multiple compiler versions. This forces the need to import the users PATH  
 # environment which isn't the "scons way"  
 # This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms)  
 # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix  
   
 if os.name != "nt" and os.uname()[4]=='ia64':  
    env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts)  
    env['ENV']['PATH'] = path  
    env['ENV']['LD_LIBRARY_PATH'] = ld_library_path  
    env['ENV']['PYTHONPATH'] = python_path  
    if env['CXX'] == 'icpc':  
       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  
 elif os.name == "nt":  
    env = Environment(tools = ['default', 'intelc'], options = opts)  
    env['ENV']['PYTHONPATH'] = python_path  
 else:  
    env = Environment(tools = ['default'], options = opts)  
    env['ENV']['PATH'] = path  
    env['ENV']['LD_LIBRARY_PATH'] = ld_library_path  
    env['ENV']['PYTHONPATH'] = python_path  
286    
287  # Setup help for options  try:
288  Help(opts.GenerateHelpText(env))     tmp = os.environ['PATH']
289       env['ENV']['PATH'] = tmp
290    except KeyError:
291       pass
292    
293  # Add some customer builders  try:
294       tmp = os.environ['LD_LIBRARY_PATH']
295       env['ENV']['LD_LIBRARY_PATH'] = tmp
296    except KeyError:
297       pass
298    #==========================================================================
299    #
300    #    Add some customer builders
301    #
302  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
303  env.Append(BUILDERS = {'PyCompile' : py_builder});  env.Append(BUILDERS = {'PyCompile' : py_builder});
304    
305  if env['PLATFORM'] == "win32":  runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed',
306     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)                                src_suffix=env['PROGSUFFIX'], single_source=True)
307  else:  
    runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)  
308  env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});  env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
309    
310  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
# Line 202  except KeyError: Line 318  except KeyError:
318     incinstall = None     incinstall = None
319  try:  try:
320     libinstall = env['libinstall']     libinstall = env['libinstall']
321     env.Append(LIBPATH = [libinstall,])     env.Append(LIBPATH = [libinstall,]) # Adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so
322     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
323     if env['PLATFORM'] == "win32":     if env['PLATFORM'] == "win32":
324        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
# Line 210  try: Line 326  try:
326  except KeyError:  except KeyError:
327     libinstall = None     libinstall = None
328  try:  try:
329     pyinstall = env['pyinstall']+'/esys' # 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
    env.PrependENVPath('PYTHONPATH', env['pyinstall'])  
330  except KeyError:  except KeyError:
331     pyinstall = None     pyinstall = None
332  try:  try:
333       exinstall = env['exinstall']
334    except KeyError:
335       exinstall = None
336    try:
337       sys_libinstall = env['sys_libinstall']
338    except KeyError:
339       sys_libinstall = None
340    try:
341       sys_pyinstall = env['sys_pyinstall']
342    except KeyError:
343       sys_pyinstall = None
344    try:
345       sys_exinstall = env['sys_exinstall']
346    except KeyError:
347       sys_exinstall = None
348    try:
349     dodebug = env['dodebug']     dodebug = env['dodebug']
350  except KeyError:  except KeyError:
351     dodebug = None     dodebug = None
# Line 228  try: Line 359  try:
359  except KeyError:  except KeyError:
360     pass     pass
361    
 if 'shake71' == socket.gethostname().split('.')[0]:  
   if useMPI:  
     env['CC'] = 'mpicc'  
     env['CXX'] = 'mpiCC'  
   
362  if dodebug:  if dodebug:
363    if useMPI:    if useMPI:
364      try:      try:
# Line 293  except KeyError: Line 419  except KeyError:
419  try:  try:
420     sys_libs = env['sys_libs']     sys_libs = env['sys_libs']
421  except KeyError:  except KeyError:
422     sys_libs = ''     sys_libs = []
423    
424  try:  try:
425     tar_flags = env['tar_flags']     tar_flags = env['tar_flags']
# Line 314  except KeyError: Line 440  except KeyError:
440     pass     pass
441    
442  if useMPI:  if useMPI:
443     mkl_libs = ''     mkl_libs = []
444  else:  else:
445     try:     try:
446        mkl_libs = env['mkl_libs']        mkl_libs = env['mkl_libs']
447     except KeyError:     except KeyError:
448        mkl_libs = ''        mkl_libs = []
449    
450  try:  try:
451     includes = env['scsl_path']     includes = env['scsl_path']
# Line 337  if useMPI: Line 463  if useMPI:
463    try:    try:
464      scsl_libs = env['scsl_libs_MPI']      scsl_libs = env['scsl_libs_MPI']
465    except KeyError:    except KeyError:
466      scsl_libs = ''      scsl_libs = []
467  else:  else:
468    try:    try:
469      scsl_libs = env['scsl_libs']      scsl_libs = env['scsl_libs']
470    except KeyError:    except KeyError:
471      scsl_libs = ''      scsl_libs = []
472    
473  try:  try:
474     includes = env['umf_path']     includes = env['umf_path']
# Line 357  except KeyError: Line 483  except KeyError:
483     pass     pass
484    
485  if useMPI:  if useMPI:
486      umf_libs = ''      umf_libs = []
487  else:  else:
488     try:     try:
489        umf_libs = env['umf_libs']        umf_libs = env['umf_libs']
490     except KeyError:     except KeyError:
491        umf_libs = ''        umf_libs = []
492    
493  try:  try:
494     includes = env['ufc_path']     includes = env['ufc_path']
# Line 383  except KeyError: Line 509  except KeyError:
509     pass     pass
510    
511  if useMPI:  if useMPI:
512      amd_libs = ''      amd_libs = []
513  else:  else:
514     try:     try:
515        amd_libs = env['amd_libs']        amd_libs = env['amd_libs']
516     except KeyError:     except KeyError:
517        amd_libs = ''        amd_libs = []
518    
519  try:  try:
520     includes = env['blas_path']     includes = env['blas_path']
# Line 405  except KeyError: Line 531  except KeyError:
531  try:  try:
532     blas_libs = env['blas_libs']     blas_libs = env['blas_libs']
533  except KeyError:  except KeyError:
534     blas_libs = ''     blas_libs = []
535    
536  try:  try:
537     includes = env['netCDF_path']     useNetCDF = env['useNetCDF']
    env.Append(CPPPATH = [includes,])  
538  except KeyError:  except KeyError:
539       useNetCDF = 'yes'
540     pass     pass
541    
542  try:  if not useNetCDF == 'yes':
543     lib_path = env['netCDF_lib_path']     print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
544     env.Append(LIBPATH = [lib_path,])    
545  except KeyError:  if useNetCDF == 'yes':
546     pass     try:
547          includes = env['netCDF_path']
548          env.Append(CPPPATH = [includes,])
549       except KeyError:
550          pass
551    
552  try:     try:
553     netCDF_libs_cxx = env['netCDF_libs_cxx']        lib_path = env['netCDF_lib_path']
554  except KeyError:        if IS_WINDOWS_PLATFORM: env['ENV']['PATH']+=";"+lib_path
555     netCDF_lib_cxx = [ ]        env.Append(LIBPATH = [ lib_path, ])
556       except KeyError:
557          pass
558    
559       try:
560          netCDF_libs = env['netCDF_libs']
561       except KeyError:
562          netCDF_libs = [ ]
563    else:
564       netCDF_libs=[ ]
565    
566  try:  try:
567     includes = env['boost_path']     includes = env['boost_path']
# Line 517  try: Line 656  try:
656  except KeyError:  except KeyError:
657     api_epydoc = None     api_epydoc = None
658    
659  # Zipgets  try:
660       api_doxygen = env.Dir(env['api_doxygen'])
661    except KeyError:
662       api_doxygen = None
663    
664  env.Default(libinstall)  
665  env.Default(incinstall)  # FIXME: exinstall and friends related to examples are not working.
666  env.Default(pyinstall)  build_target = env.Alias('build',[libinstall,incinstall,pyinstall])
667    
668    env.Default(build_target)
669    
670    # Zipgets
671  env.Alias('release_src',[ src_zipfile, src_tarfile ])  env.Alias('release_src',[ src_zipfile, src_tarfile ])
672  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
673  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
674    env.Alias('examples_zipfile',examples_zipfile)
675    env.Alias('examples_tarfile',examples_tarfile)
676  env.Alias('api_epydoc',api_epydoc)  env.Alias('api_epydoc',api_epydoc)
677    env.Alias('api_doxygen',api_doxygen)
678    env.Alias('guide_html_index',guide_html_index)
679  env.Alias('guide_pdf', guide_pdf)  env.Alias('guide_pdf', guide_pdf)
680  env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])  env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen, guide_html_index])
681  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
682    
683  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests')    # target to build all C++ tests
684  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests') # target to build all python tests
685  env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests  env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
# Line 541  init_target = env.Command(pyinstall+'/__ Line 692  init_target = env.Command(pyinstall+'/__
692  env.Alias(init_target)  env.Alias(init_target)
693    
694  # Allow sconscripts to see the env  # Allow sconscripts to see the env
695  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs_cxx",  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "exinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",
696      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
697          "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",
698          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])          "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ])
699    
700  # End initialisation section  # End initialisation section
701  # Begin configuration section  # Begin configuration section
# Line 553  release_srcfiles=[env.File('SConstruct') Line 704  release_srcfiles=[env.File('SConstruct')
704  release_testfiles=[env.File('README_TESTS'),]  release_testfiles=[env.File('README_TESTS'),]
705  env.Zip(src_zipfile, release_srcfiles)  env.Zip(src_zipfile, release_srcfiles)
706  env.Zip(test_zipfile, release_testfiles)  env.Zip(test_zipfile, release_testfiles)
707  env.Tar(src_tarfile, release_srcfiles)  try:
708  env.Tar(test_tarfile, release_testfiles)     env.Tar(src_tarfile, release_srcfiles)
709       env.Tar(test_tarfile, release_testfiles)
710    except AttributeError:
711       pass
712  # Insert new components to be build here  # Insert new components to be build here
713  # FIXME: might be nice to replace this verbosity with a list of targets and some  # FIXME: might be nice to replace this verbosity with a list of targets and some
714  # FIXME: nifty python to create the lengthy but very similar env.Sconscript lines  # FIXME: nifty python to create the lengthy but very similar env.Sconscript lines
# Line 576  env.SConscript(dirs = ['pycad/py_src'], Line 729  env.SConscript(dirs = ['pycad/py_src'],
729  # added by Ben Cumming  # added by Ben Cumming
730  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
731  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)
732    
733    
734    syslib_install_target = env.installDirectory(sys_libinstall,libinstall)
735    syspy_install_target = env.installDirectory(sys_pyinstall,pyinstall,recursive=True)
736    
737    install_target = env.Alias("install", env.Flatten([syslib_install_target, syspy_install_target]) )

Legend:
Removed from v.965  
changed lines
  Added in v.1244

  ViewVC Help
Powered by ViewVC 1.1.26