/[escript]/trunk-mpi-branch/SConstruct
ViewVC logotype

Diff of /trunk-mpi-branch/SConstruct

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

revision 1222 by ksteube, Fri Jun 15 03:45:48 2007 UTC revision 1223 by gross, Fri Aug 3 02:40:39 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:  #===============================================================
25  if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib'):  #   check on windows or linux platform
26     umf_path_default='/opt/UMFPACK/Include'  #
27     umf_lib_path_default='/opt/UMFPACK/Lib'  IS_WINDOWS_PLATFORM = (os.name== "nt")
    umf_libs_default=['umfpack']  
 else:  
    umf_path_default=None  
    umf_lib_path_default=None  
    umf_libs_default=[]  
28    
29  if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'):  if IS_WINDOWS_PLATFORM:
30     amd_path_default='/opt/AMD/Include'     tools_prefix="C:\\Program Files\\"
    amd_lib_path_default='/opt/AMD/Lib'  
    amd_libs_default=['amd']  
31  else:  else:
32     amd_path_default=None     tools_prefix="/usr"
    amd_lib_path_default=None  
    amd_libs_default=[]  
33    
34  if os.path.isdir('/opt/UFconfig'):  #==============================================================================================    
35     ufc_path_default='/opt/UFconfig'  #    
36  else:  #    get the iinstallation prefix
37     ufc_path_default=None  #
38    prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)
39    print "Install prefix is: ", prefix
40    
 if os.path.isdir('/usr/local/include') and os.path.isdir('/usr/local/lib'):  
   netCDF_path_default='/usr/local/include'  
   netCDF_lib_path_default='/usr/local/lib'  
   netCDF_libs_cxx_default=[ 'netcdf_c++', 'netcdf']  
 else:  
   netCDF_path_default=None  
   netCDF_lib_path_default=None  
   netCDF_libs_cxx_default=None  
41  # Default options and options help text  # Default options and options help text
42  # 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.
43  # 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
44  # DO NOT CHANGE THEM HERE  # DO NOT CHANGE THEM HERE
   
45  # Where to install?  # Where to install?
46  prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)  #==============================================================================================    
47    #    
48    #    get the options file if present:
49    #
50  if ARGUMENTS.get('options_file',0):  if ARGUMENTS.get('options_file',0):
51     options_file = ARGUMENTS.get('options_file',0)     options_file = ARGUMENTS.get('options_file',0)
52  else:  else:
# Line 73  else: Line 57  else:
57           hostname+=s           hostname+=s
58        else:        else:
59           hostname+="_"           hostname+="_"
60     options_file = "scons/"+hostname+"_options.py"     options_file = os.path.join("scons",hostname+"_options.py")
61      
62  if os.path.isfile(options_file):  if os.path.isfile(options_file):
63     print "option file is ",options_file,"."     print "option file is ",options_file,"."
64  else:  else:
65     print "option file is ",options_file, "(not present)."     print "option file is ",options_file, "(not present)."
66    # and load it
67  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
68    #================================================================
69    #
70    #   check if UMFPACK is installed on the system:
71    #
72    uf_root=None
73    for i in [ 'UMFPACK', 'umfpack', 'ufsparse', 'UFSPARSE']:
74       if os.path.isdir(os.path.join(tools_prefix,'include',i)):
75           uf_root=i
76           print i," is used form ",tools_prefix
77           break
78    if not uf_root==None:
79       umf_path_default=os.path.join(tools_prefix,'include',uf_root)
80       umf_lib_path_default=os.path.join(tools_prefix,'lib')
81       umf_libs_default=['umfpack']
82       amd_path_default=os.path.join(tools_prefix,'include',uf_root)
83       amd_lib_path_default=os.path.join(tools_prefix,'lib')
84       amd_libs_default=['amd']
85       ufc_path_default=os.path.join(tools_prefix,'include',uf_root)
86    else:
87       umf_path_default=None
88       umf_lib_path_default=None
89       umf_libs_default=None
90       amd_path_default=None
91       amd_lib_path_default=None
92       amd_libs_default=None
93       ufc_path_default=None
94    #
95    #==========================================================================
96    #
97    #    python installation:
98    #
99    if IS_WINDOWS_PLATFORM:
100       python_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"include")
101       python_lib_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1])+"libs")
102       python_libs_default=["python%s%s"%(sys.version_info[0],sys.version_info[1])]
103    else:
104       python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1]))
105       python_lib_path_default=os.path.join(tools_prefix,'lib')
106       python_libs_default=["python%s.%s"%(sys.version_info[0],sys.version_info[1])]
107    
108    #==========================================================================
109    #
110    #    boost installation:
111    #
112    if IS_WINDOWS_PLATFORM:
113       boost_libs_path_default=os.path.join(tools_prefix,'boost','lib')
114       boost_libs_default=None
115       for i in os.listdir(boost_libs_path_default):
116          name=os.path.splitext(i)
117          if name[1] == ".dll" and name[0].startswith("boost_python"):
118              if boost_libs_default == None:
119             boost_libs_default= [ name[0] ]
120          else:
121             if not name[0].find("-gd-"): boost_libs_default=[ name[0] ]
122       boost_path_default=os.path.join(tools_prefix,'boost','include','boost-%s'%(boost_libs_default[0].split("-")[-1],))
123    else:
124       boost_path_default=os.path.join(tools_prefix,'include')
125       boost_libs_path_default=os.path.join(tools_prefix,'lib')
126       boost_libs_default=['boost_python']
127    #==========================================================================
128    #
129    #    check if netCDF is installed on the system:
130    #
131    if IS_WINDOWS_PLATFORM:
132        netcdf_dir=os.path.join(tools_prefix,'netcdf')
133        netCDF_path_default=os.path.join(netcdf_dir,'include')
134        netCDF_lib_path_default=os.path.join(netcdf_dir,'lib')
135    else:
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    if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):
139         useNetCDF_default='yes'
140         netCDF_libs_default=[ 'netcdf_c++', 'netcdf' ]
141    else:
142         useNetCDF_default='no'
143         netCDF_path_default=None
144         netCDF_lib_path_default=None
145         netCDF_libs_default=None
146    
147    if IS_WINDOWS_PLATFORM:
148            useNetCDF_default='no' # be default netcdf is not supported on windows.
149    #==========================================================================
150    #
151    #  MPI:
152    #
153    if IS_WINDOWS_PLATFORM:
154       useMPI_default='no'
155       mpi_path_default=None
156       mpi_lib_path_default=None
157       mpi_libs_default=None
158    else:
159       useMPI_default='no'
160       mpi_root='/usr/local'
161       mpi_path_default=os.path.join(mpi_root,'include')
162       mpi_lib_path_default=os.path.join(mpi_root,'lib')
163       mpi_libs_default=[ 'mpich' , 'pthread', 'rt' ]
164    #
165    #==========================================================================
166    #
167    #    compile:
168    #
169    if IS_WINDOWS_PLATFORM:
170        # cc_flags_default  = '/GR /EHsc /MD /Qc99 /Qopenmp /Qopenmp-report1 /O3 /G7 /Qprec /Qpar-report1 /QxP /QaxP'
171        # cc_flags_debug_default  = '/Od /MDd /RTC1 /GR /EHsc /Qc99 /Qopenmp /Qopenmp-report1 /Qprec'
172        cc_flags_default  = '/nologo /EHsc /GR  /wd4068 /O2 /Op /MT /W3 /Ob0 /Z7'
173        cc_flags_debug_default  ='/nologo /EHsc /GR  /wd4068 /Od /RTC1 /MTd /ZI /Ob0 /Z7'
174        
175        cc_flags_default  = '/nologo /EHsc /GR  /O2 /MT /W3 /Ob0 /Z7 /wd4068'
176        cc_flags_debug_default  ='/nologo /EHsc /GR /Od /RTC1 /MTd /W3 /Ob0 /Z7/wd4068'
177        cxx_flags_default = ''
178        cxx_flags_debug_default = ''
179        cc_common_flags = '/FD /EHsc /GR /wd4068 '
180        pedantic_flag_default=None
181    else:
182       cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi'
183       cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi'
184       cxx_flags_default='--no-warn -ansi'
185       cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'
186       pedantic_flag_default="-pedantic-errors"
187    #==============================================================================================    
188    # Default options and options help text
189    # These are defaults and can be overridden using command line arguments or an options file.
190    # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
191    # DO NOT CHANGE THEM HERE
192  opts.AddOptions(  opts.AddOptions(
193  # Where to install esys stuff  # Where to install esys stuff
194    ('incinstall', 'where the esys headers will be installed', prefix+'/include'),    ('incinstall', 'where the esys headers will be installed', prefix+'/include'),
# Line 96  opts.AddOptions( Line 205  opts.AddOptions(
205    ('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"),    ('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"),
206  # Compilation options  # Compilation options
207    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
208    ('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),
209    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
210    ('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),    ('cc_flags','C compiler flags to use (Release build)', cc_flags_default),
211    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),    ('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default),
212    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),
213    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF -DHAVE_MPI_OFFSET'),    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', cxx_flags_debug_default),
214    ('omp_flags', 'OpenMP compiler flags to use (Release build)', ''),    ('omp_flags', 'OpenMP compiler flags to use (Release build)', ''),
215    ('omp_flags_debug', 'OpenMP compiler flags to use (Debug build)', ''),    ('omp_flags_debug', 'OpenMP compiler flags to use (Debug build)', ''),
216      ('pedantic_flag', 'flag to switch on pedantic compilation', pedantic_flag_default),
217    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
218    ('sys_libs', 'System libraries to link with', [ 'pthread' , 'rt' ] ),    ('sys_libs', 'System libraries to link with', None),
219    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
220  # MKL  # MKL
221    PathOption('mkl_path', 'Path to MKL includes', None),    PathOption('mkl_path', 'Path to MKL includes', None),
222    PathOption('mkl_lib_path', 'Path to MKL libs', None),    PathOption('mkl_lib_path', 'Path to MKL libs', None),
223    ('mkl_libs', 'MKL libraries to link with', None),    ('mkl_libs', 'MKL libraries to link with', None),
 # TRILINOS  
   PathOption('trilinos_path', 'Path to TRILINOS includes', None),  
   PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None),  
   ('trilinos_libs', 'TRILINOS libraries to link with', None),  
224  # SCSL  # SCSL
225    PathOption('scsl_path', 'Path to SCSL includes', None),    PathOption('scsl_path', 'Path to SCSL includes', None),
226    PathOption('scsl_lib_path', 'Path to SCSL libs', None),    PathOption('scsl_lib_path', 'Path to SCSL libs', None),
227    ('scsl_libs', 'SCSL libraries to link with', None),    ('scsl_libs', 'SCSL libraries to link with', None),
228      ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
229  # UMFPACK  # UMFPACK
230    PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default),    PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default),
231    PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default),    PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default),
# Line 128  opts.AddOptions( Line 235  opts.AddOptions(
235    PathOption('amd_path', 'Path to AMD includes', amd_path_default),    PathOption('amd_path', 'Path to AMD includes', amd_path_default),
236    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
237    ('amd_libs', 'AMD libraries to link with', amd_libs_default),    ('amd_libs', 'AMD libraries to link with', amd_libs_default),
238    # TRILINOS
239      PathOption('trilinos_path', 'Path to TRILINOS includes', None),
240      PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None),
241      ('trilinos_libs', 'TRILINOS libraries to link with', None),
242  # BLAS  # BLAS
243    PathOption('blas_path', 'Path to BLAS includes', None),    PathOption('blas_path', 'Path to BLAS includes', None),
244    PathOption('blas_lib_path', 'Path to BLAS libs', None),    PathOption('blas_lib_path', 'Path to BLAS libs', None),
245    ('blas_libs', 'BLAS libraries to link with', None),    ('blas_libs', 'BLAS libraries to link with', None),
246  # netCDF  # netCDF
247    ('useNetCDF', 'switch on/off the usage of netCDF', 'yes'),    ('useNetCDF', 'switch on/off the usage of netCDF', useNetCDF_default),
248    PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),    PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
249    PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),    PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
250    ('netCDF_libs_cxx', 'netCDF C++ libraries to link with', netCDF_libs_cxx_default),    ('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default),
251  # Python  # Python
252  # locations of include files for python  # locations of include files for python
253    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', python_path_default),
254    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),    PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default),
255    ('python_libs', 'Python libraries to link with', ["python%s.%s"%(sys.version_info[0],sys.version_info[1]),]),    ('python_libs', 'Python libraries to link with', python_libs_default),
256  # Boost  # Boost
257    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),    PathOption('boost_path', 'Path to Boost includes', boost_path_default),
258    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_libs_path', 'Path to Boost libs', boost_libs_path_default),
259    ('boost_libs', 'Boost libraries to link with', ['boost_python',]),    ('boost_libs', 'Boost libraries to link with', boost_libs_default),
260    
261  # Doc building  # Doc building
262  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
263  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),
# Line 155  opts.AddOptions( Line 267  opts.AddOptions(
267    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
268    ('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', None),    ('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', None),
269  # MPI  # MPI
270    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),    BoolOption('useMPI', 'Compile parallel version using MPI', useMPI_default),
271    ('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'),    ('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'),
272    PathOption('mpi_path', 'Path to MPI includes', '/usr/local/include'),    PathOption('mpi_path', 'Path to MPI includes', mpi_path_default),
273    PathOption('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)','/usr/local/lib'),    PathOption('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)',mpi_lib_path_default),
274    ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', [ 'mpich' , 'pthread', 'rt' ]),    ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', mpi_libs_default)
275  )  )
276  # Note: On the Altix the intel compilers are not automatically  #=================================================================================================
277  # detected by scons intelc.py script. The Altix has a different directory  #
278  # path and in some locations the "modules" facility is used to support  #   Note: On the Altix the intel compilers are not automatically
279  # multiple compiler versions. This forces the need to import the users PATH  #   detected by scons intelc.py script. The Altix has a different directory
280  # environment which isn't the "scons way"  #   path and in some locations the "modules" facility is used to support
281  # 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)  #   multiple compiler versions. This forces the need to import the users PATH
282  # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix  #   environment which isn't the "scons way"
283    #   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)
284  if os.name != "nt" and os.uname()[4]=='ia64':  #   FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
285     env = Environment(tools = ['default', 'intelc'], options = opts)  #
286     if env['CXX'] == 'icpc':  if IS_WINDOWS_PLATFORM:
287        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 = Environment(tools = ['default', 'msvc'], options = opts)
288  elif os.name == "nt":  else:
289     env = Environment(tools = ['default', 'msvc'], options = opts)     if os.uname()[4]=='ia64':
290     #env = Environment(tools = ['default', 'intelc'], options = opts)        env = Environment(tools = ['default', 'intelc'], options = opts)
291  else:        if env['CXX'] == 'icpc':
292     env = Environment(tools = ['default'], options = opts)           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
293  # Initialise Scons Build Environment     else:
294  # check for user environment variables we are interested in        env = Environment(tools = ['default'], options = opts)
295    Help(opts.GenerateHelpText(env))
296    #=================================================================================================
297    #
298    #     Initialise Scons Build Environment
299    #     check for user environment variables we are interested in
300  try:  try:
301     python_path = os.environ['PYTHONPATH']     python_path = os.environ['PYTHONPATH']
302     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = python_path
# Line 187  except KeyError: Line 304  except KeyError:
304     python_path = ''     python_path = ''
305    
306  try:  try:
307       omp_num_threads = os.environ['OMP_NUM_THREADS']
308    except KeyError:
309       omp_num_threads = 1
310    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
311    
312    try:
313     path = os.environ['PATH']     path = os.environ['PATH']
314     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
315  except KeyError:  except KeyError:
316     path = ''     path = ''
317    
318  try:  try:
319     ld_library_path = os.environ['LD_LIBRARY_PATH']     ld_library_path = os.environ['LD_LIBRARY_PATH']
320     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
321  except KeyError:  except KeyError:
322     ld_library_path = ''     ld_library_path = ''
323    #==========================================================================
324    #
325  # Setup help for options  #    Add some customer builders
326  Help(opts.GenerateHelpText(env))  #
   
 # Add some customer builders  
327  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)
328  env.Append(BUILDERS = {'PyCompile' : py_builder});  env.Append(BUILDERS = {'PyCompile' : py_builder});
329    
330  if env['PLATFORM'] == "win32":  if IS_WINDOWS_PLATFORM:
331     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)
332  else:  else:
333     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)
# Line 226  try: Line 348  try:
348     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
349     if env['PLATFORM'] == "win32":     if env['PLATFORM'] == "win32":
350        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
351        env.PrependENVPath('PATH', env['boost_lib_path'])        env.PrependENVPath('PATH', env['boost_libs_path'])
352  except KeyError:  except KeyError:
353     libinstall = None     libinstall = None
354  try:  try:
# Line 235  try: Line 357  try:
357  except KeyError:  except KeyError:
358     pyinstall = None     pyinstall = None
359  try:  try:
360     dodebug = env['dodebug']     cc_defines = env['cc_defines']
361       env.Append(CPPDEFINES = cc_defines)
362  except KeyError:  except KeyError:
363     dodebug = None     pass
364  try:  try:
365     useMPI = env['useMPI']     flags = env['ar_flags']
366       env.Append(ARFLAGS = flags)
367  except KeyError:  except KeyError:
368     useMPI = None     ar_flags = None
369  try:  try:
370     cc_defines = env['cc_defines']     sys_libs = env['sys_libs']
371     env.Append(CPPDEFINES = cc_defines)  except KeyError:
372       sys_libs = []
373    
374    try:
375       tar_flags = env['tar_flags']
376       env.Replace(TARFLAGS = tar_flags)
377  except KeyError:  except KeyError:
378     pass     pass
379    
380  # mpi?  # ====================== debugging ===================================
381  if useMPI:  try:
382     env.Append(CPPDEFINES=['PASO_MPI',])     dodebug = env['dodebug']
383     env.Append(CDEFINES=['PASO_MPI',])  except KeyError:
384       dodebug = None
385    
386    # === switch on omp ===================================================
387  try:  try:
388    omp_flags = env['omp_flags']    omp_flags = env['omp_flags']
   omp_flags_debug = env['omp_flags_debug']  
389  except KeyError:  except KeyError:
   print "omp_flags = ''"  
   print "omp_flags_debug = ''"  
   
 # OpenMP and MPI conflict on the Altix, maybe can fix this for mixed mode programming  
 # This disables both OpenMP and MPI on all systems but is an OK fix for now  
 if useMPI:  
390    omp_flags = ''    omp_flags = ''
391    
392    try:
393      omp_flags_debug = env['omp_flags_debug']
394    except KeyError:
395    omp_flags_debug = ''    omp_flags_debug = ''
396    
397    # ========= use mpi? =====================================================
398    try:
399       useMPI = env['useMPI']
400    except KeyError:
401       useMPI = None
402    # ========= set compiler flags ===========================================
403  if dodebug:  if dodebug:
404      try:      try:
405        flags = env['cc_flags_debug'] + ' ' + omp_flags_debug        flags = env['cc_flags_debug'] + ' ' + omp_flags_debug
# Line 291  else: Line 425  else:
425       except KeyError:       except KeyError:
426          pass          pass
427  try:  try:
428     flags = env['ar_flags']        pedantic_flag = env['pedantic_flag']
    env.Append(ARFLAGS = flags)  
 except KeyError:  
    ar_flags = None  
 try:  
    sys_libs = env['sys_libs']  
 except KeyError:  
    sys_libs = []  
   
 try:  
    tar_flags = env['tar_flags']  
    env.Replace(TARFLAGS = tar_flags)  
429  except KeyError:  except KeyError:
430     pass        pedantic_flag = None
   
431    
432  # ============= set mkl (but only of no MPI) =====================================  # ============= set mkl (but only of no MPI) =====================================
433  if not useMPI:  if not useMPI:
# Line 373  else: Line 495  else:
495    
496    
497  # ============= set umfpack (but only without MPI) =====================================  # ============= set umfpack (but only without MPI) =====================================
498  umfpack_libs=[ ]  umf_libs=[ ]
499  if not useMPI:  if not useMPI:
500     try:     try:
501        includes = env['umf_path']        includes = env['umf_path']
# Line 389  if not useMPI: Line 511  if not useMPI:
511    
512     try:     try:
513        umf_libs = env['umf_libs']        umf_libs = env['umf_libs']
514        umfpack_libs+=umf_libs        umf_libs+=umf_libs
515     except KeyError:     except KeyError:
516        pass        pass
517    
# Line 413  if not useMPI: Line 535  if not useMPI:
535    
536     try:     try:
537        amd_libs = env['amd_libs']        amd_libs = env['amd_libs']
538        umfpack_libs+=amd_libs        umf_libs+=amd_libs
539     except KeyError:     except KeyError:
540        pass        pass
541    
542    # ============= set TRILINOS (but only with MPI) =====================================
543    if useMPI:
544       try:
545          includes = env['trilinos_path']
546          env.Append(CPPPATH = [includes,])
547       except KeyError:
548          pass
549    
550       try:
551          lib_path = env['trilinos_lib_path']
552          env.Append(LIBPATH = [lib_path,])
553       except KeyError:
554          pass
555    
556       try:
557          trilinos_libs = env['trilinos_libs']
558       except KeyError:
559          trilinos_libs = []
560    else:
561         trilinos_libs = []
562    
563  # ============= set blas =====================================  # ============= set blas =====================================
564  try:  try:
565     includes = env['blas_path']     includes = env['blas_path']
# Line 435  try: Line 578  try:
578  except KeyError:  except KeyError:
579     blas_libs = [ ]     blas_libs = [ ]
580    
581  # ============= set netcdf =====================================  # ========== netcdf (currently not supported with mpi) ====================================
582  try:  if useMPI:
583     useNetCDF = env['useNetCDF']     useNetCDF = 'no'
584  except KeyError:  else:
585     useNetCDF = 'yes'     try:
586     pass        useNetCDF = env['useNetCDF']
587       except KeyError:
588          useNetCDF = 'yes'
589          pass
590        
591  if not useNetCDF == 'yes':  if not useNetCDF == 'yes':
592     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."
593        
# Line 454  if useNetCDF == 'yes': Line 600  if useNetCDF == 'yes':
600    
601     try:     try:
602        lib_path = env['netCDF_lib_path']        lib_path = env['netCDF_lib_path']
603        env.Append(LIBPATH = [lib_path,])        if IS_WINDOWS_PLATFORM: env['ENV']['PATH']+=";"+lib_path
604          env.Append(LIBPATH = [ lib_path, ])
605     except KeyError:     except KeyError:
606        pass        pass
607    
608     try:     try:
609        netCDF_libs_cxx = env['netCDF_libs_cxx']        netCDF_libs = env['netCDF_libs']
610     except KeyError:     except KeyError:
611        netCDF_libs_cxx = [ ]        netCDF_libs = [ ]
612  else:  else:
613     netCDF_libs_cxx=[ ]     netCDF_libs=[ ]
614    
615  # ============= set boost =====================================  # ====================== boost ======================================
616  try:  try:
617     includes = env['boost_path']     includes = env['boost_path']
618     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
619  except KeyError:  except KeyError:
620     pass     pass
621  try:  try:
622     lib_path = env['boost_lib_path']     lib_path = env['boost_libs_path']
623     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
624  except KeyError:  except KeyError:
625     pass     pass
626  try:  try:
627     boost_libs = env['boost_libs']     boost_libs = env['boost_libs']
628  except KeyError:  except KeyError:
629     boost_libs = [ ]     boost_libs = None
630  # ============= set python =====================================  # ====================== python ======================================
631  try:  try:
632     includes = env['python_path']     includes = env['python_path']
633     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 493  except KeyError: Line 640  except KeyError:
640     pass     pass
641  try:  try:
642     python_libs = env['python_libs']     python_libs = env['python_libs']
643    # =============== documentation =======================================
644  except KeyError:  except KeyError:
645     python_libs = []     python_libs = None
646    try:
647       doxygen_path = env['doxygen_path']
648    except KeyError:
649       doxygen_path = None
650    try:
651       epydoc_path = env['epydoc_path']
652    except KeyError:
653       epydoc_path = None
654    # =============== PAPI =======================================
655    try:
656       includes = env['papi_path']
657       env.Append(CPPPATH = [includes,])
658    except KeyError:
659       pass
660    try:
661       lib_path = env['papi_lib_path']
662       env.Append(LIBPATH = [lib_path,])
663    except KeyError:
664       pass
665    try:
666       papi_libs = env['papi_libs']
667    except KeyError:
668       papi_libs = None
669  # ============= set mpi =====================================  # ============= set mpi =====================================
670  if useMPI:  if useMPI:
671       env.Append(CPPDEFINES=['PASO_MPI',])
672     try:     try:
673        includes = env['mpi_path']        includes = env['mpi_path']
674        env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
# Line 512  if useMPI: Line 683  if useMPI:
683        mpi_libs = env['mpi_libs']        mpi_libs = env['mpi_libs']
684     except KeyError:     except KeyError:
685        mpi_libs = []        mpi_libs = []
686    
687     try:     try:
688         mpich_ignore_cxx_seek=env['MPICH_IGNORE_CXX_SEEK']         mpich_ignore_cxx_seek=env['MPICH_IGNORE_CXX_SEEK']
689         env.Append(CPPDEFINES = [ mpich_ignore_cxx_seek ] )         env.Append(CPPDEFINES = [ mpich_ignore_cxx_seek ] )
690     except KeyError:     except KeyError:
691        pass        pass
     
692  else:  else:
     
693    mpi_libs=[]    mpi_libs=[]
694  # ============= set papi =====================================  # =========== zip files ===========================================
695  try:  try:
696     includes = env['papi_path']     includes = env['papi_path']
697     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 592  try: Line 762  try:
762  except KeyError:  except KeyError:
763     api_epydoc = None     api_epydoc = None
764    
     
   
765  # Zipgets  # Zipgets
   
766  env.Default(libinstall)  env.Default(libinstall)
767  env.Default(incinstall)  env.Default(incinstall)
768  env.Default(pyinstall)  env.Default(pyinstall)
# Line 618  init_target = env.Command(pyinstall+'/__ Line 785  init_target = env.Command(pyinstall+'/__
785  env.Alias(init_target)  env.Alias(init_target)
786    
787  # Allow sconscripts to see the env  # Allow sconscripts to see the env
788  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umfpack_libs",  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "blas_libs", "netCDF_libs", "useNetCDF",
789      "blas_libs", "netCDF_libs_cxx", "trilinos_libs", "useNetCDF", "mpi_libs", "boost_libs", "python_libs",      "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",
790      "doxygen_path", "epydoc_path", "papi_libs", "papi_instrument_solver",          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile", "trilinos_libs", "mpi_libs", "papi_instrument_solver",
791          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI", "pedantic_flag" ])
         "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])  
792    
793  # End initialisation section  # End initialisation section
794  # Begin configuration section  # Begin configuration section
# Line 631  release_srcfiles=[env.File('SConstruct') Line 797  release_srcfiles=[env.File('SConstruct')
797  release_testfiles=[env.File('README_TESTS'),]  release_testfiles=[env.File('README_TESTS'),]
798  env.Zip(src_zipfile, release_srcfiles)  env.Zip(src_zipfile, release_srcfiles)
799  env.Zip(test_zipfile, release_testfiles)  env.Zip(test_zipfile, release_testfiles)
800  env.Tar(src_tarfile, release_srcfiles)  try:
801  env.Tar(test_tarfile, release_testfiles)     env.Tar(src_tarfile, release_srcfiles)
802       env.Tar(test_tarfile, release_testfiles)
803    except AttributeError:
804       pass
805  # Insert new components to be build here  # Insert new components to be build here
806  # 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
807  # 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

Legend:
Removed from v.1222  
changed lines
  Added in v.1223

  ViewVC Help
Powered by ViewVC 1.1.26