/[escript]/branches/scons-dev/SConstruct
ViewVC logotype

Diff of /branches/scons-dev/SConstruct

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

revision 1670 by ksteube, Wed Jul 23 20:36:21 2008 UTC revision 1671 by ksteube, Thu Jul 24 04:33:41 2008 UTC
# Line 46  opts.AddOptions( Line 46  opts.AddOptions(
46    BoolOption('usedebug', 'Do you want a debug build?', 'no'),    BoolOption('usedebug', 'Do you want a debug build?', 'no'),
47    BoolOption('usevtk', 'Do you want to use VTK?', 'yes'),    BoolOption('usevtk', 'Do you want to use VTK?', 'yes'),
48    ('options_file', "File of paths/options. Default: scons/<hostname>_options.py", options_file),    ('options_file', "File of paths/options. Default: scons/<hostname>_options.py", options_file),
   ('cc_defines','C/C++ defines to use', None),  
49    # The strings -DDEFAULT_ get replaced by scons/<hostname>_options.py or by defaults below    # The strings -DDEFAULT_ get replaced by scons/<hostname>_options.py or by defaults below
50    ('cc_flags', 'C compiler flags to use', '-DEFAULT_1'),    ('cc_flags', 'C compiler flags to use', '-DEFAULT_1'),
51    ('cc_optim', 'C compiler optimization flags to use', '-DEFAULT_2'),    ('cc_optim', 'C compiler optimization flags to use', '-DEFAULT_2'),
# Line 84  opts.AddOptions( Line 83  opts.AddOptions(
83    ('parmetis_lib_path', 'Path to ParMETIS library', '/usr/lib'),    ('parmetis_lib_path', 'Path to ParMETIS library', '/usr/lib'),
84    ('parmetis_libs', 'ParMETIS library to link with', []),    ('parmetis_libs', 'ParMETIS library to link with', []),
85  # PAPI  # PAPI
86    ('papi_path', 'Path to PAPI includes', None),    BoolOption('usepapi', 'switch on/off the usage of PAPI', 'no'),
87    ('papi_lib_path', 'Path to PAPI libs', None),    ('papi_path', 'Path to PAPI includes', '/usr/include'),
88    ('papi_libs', 'PAPI libraries to link with', []),    ('papi_lib_path', 'Path to PAPI libs', '/usr/lib'),
89      ('papi_libs', 'PAPI libraries to link with', ['papi']),
90    BoolOption('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', False),    BoolOption('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', False),
91  # MKL  # MKL
92    ('mkl_path', 'Path to MKL includes', None),    BoolOption('usemkl', 'switch on/off the usage of MKL', 'yes'),
93    ('mkl_lib_path', 'Path to MKL libs', None),    ('mkl_path', 'Path to MKL includes', '/opt/intel/mkl80.019/include'),
94    ('mkl_libs', 'MKL libraries to link with', []),    ('mkl_lib_path', 'Path to MKL libs', '/opt/intel/mkl80.019/lib/64'),
95      ('mkl_libs', 'MKL libraries to link with', ['mkl_solver', 'mkl_lapack', 'mkl_em64t']),
96  # UMFPACK  # UMFPACK
97    BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'no'),    BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'yes'),
98    ('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'),    ('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'),
99    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),    ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),
100    ('umf_lib_path', 'Path to UMFPACK libs', '/usr/lib'),    ('umf_lib_path', 'Path to UMFPACK libs', '/usr/lib'),
# Line 215  env.Append(CPPPATH     = [Dir('include')]) Line 216  env.Append(CPPPATH     = [Dir('include')])
216  # Add cc option -L<Escript>/trunk/lib  # Add cc option -L<Escript>/trunk/lib
217  env.Append(LIBPATH      = [Dir('lib')])  env.Append(LIBPATH      = [Dir('lib')])
218    
219    env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS', 'FINLEY_EXPORTS'])
220    
221  # Get the global Subversion revision number for getVersion() method  # Get the global Subversion revision number for getVersion() method
222  try:  try:
223     global_revision = os.popen("svnversion -n .").read()     global_revision = os.popen("svnversion -n .").read()
# Line 265  env.Append(LIBS = [env['boost_libs']]) Line 268  env.Append(LIBS = [env['boost_libs']])
268    
269  ############ VTK (optional) ####################################  ############ VTK (optional) ####################################
270    
271    # You must set up your PYTHONPATH before calling scons
272    
273  if env['usevtk']:  if env['usevtk']:
274    try:    try:
275      import vtk      import vtk
# Line 278  if env['usevtk']: Line 283  if env['usevtk']:
283    
284  ############ NetCDF (optional) #################################  ############ NetCDF (optional) #################################
285    
286    # Start a new configure environment that reflects what we've already found
287    conf.Finish()
288    conf = Configure(clone_env(env))
289    
290  if env['usenetcdf']:  if env['usenetcdf']:
291    conf.env.Append(CPPPATH   = [env['netCDF_path']])    conf.env.Append(CPPPATH   = [env['netCDF_path']])
292    conf.env.Append(LIBPATH   = [env['netCDF_lib_path']])    conf.env.Append(LIBPATH   = [env['netCDF_lib_path']])
# Line 293  if env['usenetcdf']: Line 302  if env['usenetcdf']:
302    env.Append(LIBS = [env['netCDF_libs']])    env.Append(LIBS = [env['netCDF_libs']])
303    env.Append(CPPDEFINES = ['USE_NETCDF'])    env.Append(CPPDEFINES = ['USE_NETCDF'])
304    
305    ############ PAPI (optional) ###################################
306    
307    # Start a new configure environment that reflects what we've already found
308    conf.Finish()
309    conf = Configure(clone_env(env))
310    
311    if env['usepapi']:
312      conf.env.Append(CPPPATH   = [env['papi_path']])
313      conf.env.Append(LIBPATH   = [env['papi_lib_path']])
314      conf.env.Append(LIBS      = [env['papi_libs']])
315    
316    if env['usepapi'] and not conf.CheckCHeader('papi.h'): env['usepapi'] = 0
317    if env['usepapi'] and not conf.CheckFunc('PAPI_start_counters'): env['usepapi'] = 0
318    
319    # Add PAPI to environment env
320    if env['usepapi']:
321      env.AppendUnique(CPPPATH = [env['papi_path']])
322      env.AppendUnique(LIBPATH = [env['papi_lib_path']])
323      env.Append(LIBS = [env['papi_libs']])
324      env.Append(CPPDEFINES = ['BLOCKPAPI'])
325    
326    ############ MKL (optional) ####################################
327    
328    # Start a new configure environment that reflects what we've already found
329    conf.Finish()
330    conf = Configure(clone_env(env))
331    
332    if env['usemkl']:
333      conf.env.Append(CPPPATH   = [env['mkl_path']])
334      conf.env.Append(LIBPATH   = [env['mkl_lib_path']])
335      conf.env.Append(LIBS      = [env['mkl_libs']])
336    
337    if env['usemkl'] and not conf.CheckCHeader('mkl_solver.h'): env['usemkl'] = 0
338    if env['usemkl'] and not conf.CheckFunc('PARDISO'): env['usemkl'] = 0
339    
340    # Add MKL to environment env
341    if env['usemkl']:
342      print "ksteube using MKL"
343      env.AppendUnique(CPPPATH = [env['mkl_path']])
344      env.AppendUnique(LIBPATH = [env['mkl_lib_path']])
345      env.Append(LIBS = [env['mkl_libs']])
346      env.Append(CPPDEFINES = ['MKL'])
347    
348  ############ UMFPACK (optional) ################################  ############ UMFPACK (optional) ################################
349    
350  # Start a new configure environment that reflects what we've already found  # Start a new configure environment that reflects what we've already found
# Line 410  print "    Using numarray" Line 462  print "    Using numarray"
462  print " Using boost"  print " Using boost"
463  if env['usenetcdf']: print "    Using NetCDF"  if env['usenetcdf']: print "    Using NetCDF"
464  else: print "   Not using NetCDF"  else: print "   Not using NetCDF"
 if env['useumfpack']: print "   Using UMFPACK"  
 else: print "   Not using UMFPACK"  
465  if env['usevtk']: print "   Using VTK"  if env['usevtk']: print "   Using VTK"
466  else: print "   Not using VTK"  else: print "   Not using VTK"
467    if env['usemkl']: print "   Using MKL"
468    else: print "   Not using MKL"
469    if env['useumfpack']: print "   Using UMFPACK"
470    else: print "   Not using UMFPACK"
471  if env['useopenmp']: print "    Using OpenMP"  if env['useopenmp']: print "    Using OpenMP"
472  else: print "   Not using OpenMP"  else: print "   Not using OpenMP"
473  if env['usempi']: print "   Using MPI"  if env['usempi']: print "   Using MPI"
474  else: print "   Not using MPI"  else: print "   Not using MPI"
475  if env['useparmetis']: print "  Using ParMETIS"  if env['useparmetis']: print "  Using ParMETIS"
476  else: print "   Not using ParMETIS (requires MPI)"  else: print "   Not using ParMETIS (requires MPI)"
477    if env['usepapi']: print "  Using PAPI"
478    else: print "   Not using PAPI"
479  if env['usedebug']: print " Compiling for debug"  if env['usedebug']: print " Compiling for debug"
480  else: print "   Not compiling for debug"  else: print "   Not compiling for debug"
481  print " Installing in", prefix  print " Installing in", prefix
# Line 436  env.Append(BUILDERS = {'RunUnitTest' : r Line 492  env.Append(BUILDERS = {'RunUnitTest' : r
492  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)
493  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
494    
 ############ Remember what options were used in the build ######  
   
 if not IS_WINDOWS_PLATFORM:  
   env.Execute("/bin/rm -f " + env['libinstall'] + "/Compiled.with.*")  
   if env['usedebug']:       env.Execute("touch " + env['libinstall'] + "/Compiled.with.debug")  
   if env['usempi']:     env.Execute("touch " + env['libinstall'] + "/Compiled.with.mpi")  
   if env['omp_optim'] != '':    env.Execute("touch " + env['libinstall'] + "/Compiled.with.OpenMP")  
   
495  ############ Build the desired subdirectories ##################  ############ Build the desired subdirectories ##################
496    
497  Export(["env", "env_mpi"])  Export(["env", "env_mpi"])
# Line 512  env.Alias('all_tests', ['install_all', ' Line 560  env.Alias('all_tests', ['install_all', '
560    
561  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html'])  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html'])
562    
563    ############ Remember what options were used in the build ######
564    
565    if not IS_WINDOWS_PLATFORM:
566      env.Execute("/bin/rm -f " + env['libinstall'] + "/Compiled.with.*")
567      if env['usedebug']:       env.Execute("touch " + env['libinstall'] + "/Compiled.with.debug")
568      if env['usempi']:     env.Execute("touch " + env['libinstall'] + "/Compiled.with.mpi")
569      if env['omp_optim'] != '':    env.Execute("touch " + env['libinstall'] + "/Compiled.with.OpenMP")
570    

Legend:
Removed from v.1670  
changed lines
  Added in v.1671

  ViewVC Help
Powered by ViewVC 1.1.26