/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3896 by caltinay, Fri May 11 01:31:29 2012 UTC revision 3961 by jfenwick, Tue Sep 11 07:21:41 2012 UTC
# Line 1  Line 1 
1  ########################################################  ########################################################
2  #  #
3  # Copyright (c) 2003-2010 by University of Queensland  # Copyright (c) 2003-2012 by University of Queensland
4  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
5  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
6  #  #
# Line 110  vars.AddVariables( Line 110  vars.AddVariables(
110    BoolVariable('visit', 'Enable the VisIt simulation interface', False),    BoolVariable('visit', 'Enable the VisIt simulation interface', False),
111    ('visit_prefix', 'Prefix/Paths to VisIt installation', default_prefix),    ('visit_prefix', 'Prefix/Paths to VisIt installation', default_prefix),
112    ('visit_libs', 'VisIt libraries to link with', ['simV2']),    ('visit_libs', 'VisIt libraries to link with', ['simV2']),
   BoolVariable('pyvisi', 'Enable pyvisi (deprecated, requires VTK module)', False),  
113    BoolVariable('vsl_random', 'Use VSL from intel for random data', False),    BoolVariable('vsl_random', 'Use VSL from intel for random data', False),
114  # Advanced settings  # Advanced settings
115    #dudley_assemble_flags = -funroll-loops      to actually do something    #dudley_assemble_flags = -funroll-loops      to actually do something
# Line 131  vars.AddVariables( Line 130  vars.AddVariables(
130    ('pythoncmd', 'which python to compile with','python'),    ('pythoncmd', 'which python to compile with','python'),
131    ('usepython3', 'Is this a python3 build? (experimental)', False),    ('usepython3', 'Is this a python3 build? (experimental)', False),
132    ('pythonlibname', 'Name of the python library to link. (This is found automatically for python2.X.)', ''),    ('pythonlibname', 'Name of the python library to link. (This is found automatically for python2.X.)', ''),
133      ('pythonlibpath', 'Path to the python library. (You should not need to set this unless your python has moved)',''),
134      ('pythonincpath','Path to python include files. (You should not need to set this unless your python has moved',''),
135      BoolVariable('BADPYTHONMACROS','Extra \#include to get around a python bug.', True),
136  )  )
137    
138  ##################### Create environment and help text #######################  ##################### Create environment and help text #######################
# Line 249  if env['cc_extra']  != '': env.Append(CF Line 251  if env['cc_extra']  != '': env.Append(CF
251  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])
252  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])
253    
254    if env['BADPYTHONMACROS']: env.Append(CXXFLAGS = ' -DBADPYTHONMACROS')
255    
256  if env['usepython3']:  if env['usepython3']:
257      env.Append(CPPDEFINES=['ESPYTHON3'])      env.Append(CPPDEFINES=['ESPYTHON3'])
258    
# Line 402  if conf.CheckFunc('gethostname'): Line 406  if conf.CheckFunc('gethostname'):
406    
407  ######## Python headers & library (required)  ######## Python headers & library (required)
408    
409    #First we check to see if the config file has specified
410    ##Where to find the filae. Ideally, this should be automatic
411    #But we need to deal with the case where python is not in its INSTALL
412    #Directory
413  # Use the python scons is running  # Use the python scons is running
414  if env['pythoncmd']=='python':  if env['pythoncmd']=='python':
415      python_inc_path=sysconfig.get_python_inc()      python_inc_path=sysconfig.get_python_inc()
# Line 457  else: Line 465  else:
465      p.wait()      p.wait()
466      python_lib_path=python_lib_path.strip()      python_lib_path=python_lib_path.strip()
467    
468    #Check for an override from the config file.
469    #Ideally, this should be automatic
470    #But we need to deal with the case where python is not in its INSTALL
471    #Directory
472    if env['pythonlibpath']!='':
473        python_lib_path=env['pythonlibpath']
474    
475    if env['pythonincpath']!='':
476        python_inc_path=env['pythonincpath']
477    
478    
479  if sysheaderopt == '':  if sysheaderopt == '':
480      conf.env.AppendUnique(CPPPATH = [python_inc_path])      conf.env.AppendUnique(CPPPATH = [python_inc_path])
481  else:  else:
# Line 530  try: Line 549  try:
549  except:  except:
550      env['cppunit']=False      env['cppunit']=False
551    
 ######## VTK (optional)  
   
 if env['pyvisi']:  
     try:  
         import vtk  
         env['pyvisi'] = True  
     except ImportError:  
         print("Cannot import vtk, disabling pyvisi.")  
         env['pyvisi'] = False  
   
552  ######## netCDF (optional)  ######## netCDF (optional)
553    
554  netcdf_inc_path=''  netcdf_inc_path=''
# Line 799  env.SConscript(dirs = ['pasowrap/src'], Line 808  env.SConscript(dirs = ['pasowrap/src'],
808  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)
809  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)
810  env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)  env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)
811    env.SConscript(dirs = ['downunder/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/downunder', duplicate=0)
812  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)
 env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)  
 env.SConscript(dirs = ['pyvisi/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pyvisi', duplicate=0)  
813  env.SConscript(dirs = ['pycad/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pycad', duplicate=0)  env.SConscript(dirs = ['pycad/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pycad', duplicate=0)
814  env.SConscript(dirs = ['pythonMPI/src'], variant_dir='$BUILD_DIR/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], variant_dir='$BUILD_DIR/$PLATFORM/pythonMPI', duplicate=0)
815    env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)
816  env.SConscript(dirs = ['paso/profiling'], variant_dir='$BUILD_DIR/$PLATFORM/paso/profiling', duplicate=0)  env.SConscript(dirs = ['paso/profiling'], variant_dir='$BUILD_DIR/$PLATFORM/paso/profiling', duplicate=0)
817    
818    
# Line 850  buildvars.write("mpi=%s\n"%env['mpi']) Line 859  buildvars.write("mpi=%s\n"%env['mpi'])
859  buildvars.write("mpi_inc_path=%s\n"%mpi_inc_path)  buildvars.write("mpi_inc_path=%s\n"%mpi_inc_path)
860  buildvars.write("mpi_lib_path=%s\n"%mpi_lib_path)  buildvars.write("mpi_lib_path=%s\n"%mpi_lib_path)
861  buildvars.write("lapack=%s\n"%env['lapack'])  buildvars.write("lapack=%s\n"%env['lapack'])
 buildvars.write("pyvisi=%d\n"%env['pyvisi'])  
862  buildvars.write("vsl_random=%d\n"%int(env['vsl_random']))  buildvars.write("vsl_random=%d\n"%int(env['vsl_random']))
863  for i in 'netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit':  for i in 'netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit':
864      buildvars.write("%s=%d\n"%(i, int(env[i])))      buildvars.write("%s=%d\n"%(i, int(env[i])))
# Line 921  install_all_list += ['install_finley'] Line 929  install_all_list += ['install_finley']
929  install_all_list += ['install_ripley']  install_all_list += ['install_ripley']
930  install_all_list += ['install_weipa']  install_all_list += ['install_weipa']
931  if not IS_WINDOWS: install_all_list += ['install_escriptreader']  if not IS_WINDOWS: install_all_list += ['install_escriptreader']
932  #install_all_list += ['install_pyvisi_py']  install_all_list += ['install_downunder_py']
933  install_all_list += ['install_modellib_py']  install_all_list += ['install_modellib_py']
934  install_all_list += ['install_pycad_py']  install_all_list += ['install_pycad_py']
935  if env['usempi']:   install_all_list += ['install_pythonMPI']  if env['usempi']:   install_all_list += ['install_pythonMPI']
# Line 933  env.Default('install_all') Line 941  env.Default('install_all')
941    
942  ################## Targets to build and run the test suite ###################  ################## Targets to build and run the test suite ###################
943    
 test_msg = env.Command('.dummy.', None, '@echo "Cannot run C/C++ unit tests, CppUnit not found!";exit 1')  
944  if not env['cppunit']:  if not env['cppunit']:
945        test_msg = env.Command('.dummy.', None, '@echo "Cannot run C/C++ unit tests, CppUnit not found!";exit 1')
946      env.Alias('run_tests', test_msg)      env.Alias('run_tests', test_msg)
947  env.Alias('run_tests', ['install_all'])  env.Alias('run_tests', ['install_all'])
948  env.Alias('all_tests', ['install_all', 'run_tests', 'py_tests'])  env.Alias('all_tests', ['install_all', 'run_tests', 'py_tests'])

Legend:
Removed from v.3896  
changed lines
  Added in v.3961

  ViewVC Help
Powered by ViewVC 1.1.26