/[escript]/trunk/site_scons/dependencies.py
ViewVC logotype

Diff of /trunk/site_scons/dependencies.py

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

revision 4519 by caltinay, Mon May 20 05:03:35 2013 UTC revision 4520 by caltinay, Thu Aug 22 06:42:57 2013 UTC
# Line 28  from site_init import findLibWithHeader, Line 28  from site_init import findLibWithHeader,
28    
29  def checkCompiler(env):  def checkCompiler(env):
30      conf = Configure(env.Clone())      conf = Configure(env.Clone())
31      if 'CheckCC' in dir(conf): # exists since scons 1.1.0      if 'CheckCXX' in dir(conf): # exists since scons 1.1.0
         if not conf.CheckCC():  
             print("Cannot run C compiler '%s' (check config.log)" % (env['CC']))  
             env.Exit(1)  
32          if not conf.CheckCXX():          if not conf.CheckCXX():
33              print("Cannot run C++ compiler '%s' (check config.log)" % (env['CXX']))              print("Cannot run C++ compiler '%s' (check config.log)" % (env['CXX']))
34              env.Exit(1)              env.Exit(1)
35      else:      else:
         if not conf.CheckFunc('printf', language='c'):  
             print("Cannot run C compiler '%s' (check config.log)" % (env['CC']))  
             env.Exit(1)  
36          if not conf.CheckFunc('printf', language='c++'):          if not conf.CheckFunc('printf', language='c++'):
37              print("Cannot run C++ compiler '%s' (check config.log)" % (env['CXX']))              print("Cannot run C++ compiler '%s' (check config.log)" % (env['CXX']))
38              env.Exit(1)              env.Exit(1)
39    
     conf.env['buildvars']['cc']=conf.env['CC']  
40      conf.env['buildvars']['cxx']=conf.env['CXX']      conf.env['buildvars']['cxx']=conf.env['CXX']
41    
42      if conf.CheckFunc('gethostname'):      if conf.CheckFunc('gethostname', language='c++'):
43          conf.env.Append(CPPDEFINES = ['HAVE_GETHOSTNAME'])          conf.env.Append(CPPDEFINES = ['HAVE_GETHOSTNAME'])
44    
45      if conf.CheckCHeader('byteswap.h'):      if conf.CheckCXXHeader('byteswap.h'):
46          conf.env.Append(CPPDEFINES = ['HAVE_BYTESWAP_H'])          conf.env.Append(CPPDEFINES = ['HAVE_BYTESWAP_H'])
47      if conf.CheckCHeader('sys/endian.h'):      if conf.CheckCXXHeader('sys/endian.h'):
48          conf.env.Append(CPPDEFINES = ['HAVE_SYS_ENDIAN_H'])          conf.env.Append(CPPDEFINES = ['HAVE_SYS_ENDIAN_H'])
49      if conf.CheckCHeader('libkern/OSByteOrder.h'):      if conf.CheckCXXHeader('libkern/OSByteOrder.h'):
50          conf.env.Append(CPPDEFINES = ['HAVE_OSBYTEORDER_H'])          conf.env.Append(CPPDEFINES = ['HAVE_OSBYTEORDER_H'])
51    
52      return conf.Finish()      return conf.Finish()
# Line 147  def checkPython(env): Line 140  def checkPython(env):
140      # The wrapper script needs to find the libs      # The wrapper script needs to find the libs
141      conf.env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], python_lib_path)      conf.env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], python_lib_path)
142    
143      if not conf.CheckCHeader('Python.h'):      if not conf.CheckCXXHeader('Python.h'):
144          print("Cannot find python include files (tried 'Python.h' in directory %s)" % (python_inc_path))          print("Cannot find python include files (tried 'Python.h' in directory %s)" % (python_inc_path))
145          env.Exit(1)          env.Exit(1)
146      if not conf.CheckFunc('Py_Exit'):      if not conf.CheckFunc('Py_Exit', language='c++'):
147          print("Cannot find python library method Py_Main (tried %s in directory %s)" % (python_libs, python_lib_path))          print("Cannot find python library method Py_Main (tried %s in directory %s)" % (python_libs, python_lib_path))
148          env.Exit(1)          env.Exit(1)
149    
# Line 256  def checkOptionalLibraries(env): Line 249  def checkOptionalLibraries(env):
249      papi_inc_path=''      papi_inc_path=''
250      papi_lib_path=''      papi_lib_path=''
251      if env['papi']:      if env['papi']:
252          papi_inc_path,papi_lib_path=findLibWithHeader(env, env['papi_libs'], 'papi.h', env['papi_prefix'], lang='c')          papi_inc_path,papi_lib_path=findLibWithHeader(env, env['papi_libs'], 'papi.h', env['papi_prefix'], lang='c++')
253          env.AppendUnique(CPPPATH = [papi_inc_path])          env.AppendUnique(CPPPATH = [papi_inc_path])
254          env.AppendUnique(LIBPATH = [papi_lib_path])          env.AppendUnique(LIBPATH = [papi_lib_path])
255          env.AppendUnique(LIBS = env['papi_libs'])          env.AppendUnique(LIBS = env['papi_libs'])
# Line 270  def checkOptionalLibraries(env): Line 263  def checkOptionalLibraries(env):
263      mkl_inc_path=''      mkl_inc_path=''
264      mkl_lib_path=''      mkl_lib_path=''
265      if env['mkl']:      if env['mkl']:
266          mkl_inc_path,mkl_lib_path=findLibWithHeader(env, env['mkl_libs'], 'mkl_solver.h', env['mkl_prefix'], lang='c')          mkl_inc_path,mkl_lib_path=findLibWithHeader(env, env['mkl_libs'], 'mkl_solver.h', env['mkl_prefix'], lang='c++')
267          env.AppendUnique(CPPPATH = [mkl_inc_path])          env.AppendUnique(CPPPATH = [mkl_inc_path])
268          env.AppendUnique(LIBPATH = [mkl_lib_path])          env.AppendUnique(LIBPATH = [mkl_lib_path])
269          env.AppendUnique(LIBS = env['mkl_libs'])          env.AppendUnique(LIBS = env['mkl_libs'])
# Line 284  def checkOptionalLibraries(env): Line 277  def checkOptionalLibraries(env):
277      umfpack_inc_path=''      umfpack_inc_path=''
278      umfpack_lib_path=''      umfpack_lib_path=''
279      if env['umfpack']:      if env['umfpack']:
280          umfpack_inc_path,umfpack_lib_path=findLibWithHeader(env, env['umfpack_libs'], 'umfpack.h', env['umfpack_prefix'], lang='c')          umfpack_inc_path,umfpack_lib_path=findLibWithHeader(env, env['umfpack_libs'], 'umfpack.h', env['umfpack_prefix'], lang='c++')
281          env.AppendUnique(CPPPATH = [umfpack_inc_path])          env.AppendUnique(CPPPATH = [umfpack_inc_path])
282          env.AppendUnique(LIBPATH = [umfpack_lib_path])          env.AppendUnique(LIBPATH = [umfpack_lib_path])
283          env.AppendUnique(LIBS = env['umfpack_libs'])          env.AppendUnique(LIBS = env['umfpack_libs'])
# Line 307  def checkOptionalLibraries(env): Line 300  def checkOptionalLibraries(env):
300          if env['lapack']=='mkl':          if env['lapack']=='mkl':
301              env.AppendUnique(CPPDEFINES = ['MKL_LAPACK'])              env.AppendUnique(CPPDEFINES = ['MKL_LAPACK'])
302              header='mkl_lapack.h'              header='mkl_lapack.h'
303          lapack_inc_path,lapack_lib_path=findLibWithHeader(env, env['lapack_libs'], header, env['lapack_prefix'], lang='c')          lapack_inc_path,lapack_lib_path=findLibWithHeader(env, env['lapack_libs'], header, env['lapack_prefix'], lang='c++')
304          env.AppendUnique(CPPPATH = [lapack_inc_path])          env.AppendUnique(CPPPATH = [lapack_inc_path])
305          env.AppendUnique(LIBPATH = [lapack_lib_path])          env.AppendUnique(LIBPATH = [lapack_lib_path])
306          env.AppendUnique(LIBS = env['lapack_libs'])          env.AppendUnique(LIBS = env['lapack_libs'])
# Line 320  def checkOptionalLibraries(env): Line 313  def checkOptionalLibraries(env):
313      silo_inc_path=''      silo_inc_path=''
314      silo_lib_path=''      silo_lib_path=''
315      if env['silo']:      if env['silo']:
316          silo_inc_path,silo_lib_path=findLibWithHeader(env, env['silo_libs'], 'silo.h', env['silo_prefix'], lang='c')          silo_inc_path,silo_lib_path=findLibWithHeader(env, env['silo_libs'], 'silo.h', env['silo_prefix'], lang='c++')
317          env.AppendUnique(CPPPATH = [silo_inc_path])          env.AppendUnique(CPPPATH = [silo_inc_path])
318          env.AppendUnique(LIBPATH = [silo_lib_path])          env.AppendUnique(LIBPATH = [silo_lib_path])
319          # Note that we do not add the libs since they are only needed for the          # Note that we do not add the libs since they are only needed for the
# Line 334  def checkOptionalLibraries(env): Line 327  def checkOptionalLibraries(env):
327      visit_inc_path=''      visit_inc_path=''
328      visit_lib_path=''      visit_lib_path=''
329      if env['visit']:      if env['visit']:
330          visit_inc_path,visit_lib_path=findLibWithHeader(env, env['visit_libs'], 'VisItControlInterface_V2.h', env['visit_prefix'], lang='c')          visit_inc_path,visit_lib_path=findLibWithHeader(env, env['visit_libs'], 'VisItControlInterface_V2.h', env['visit_prefix'], lang='c++')
331          env.AppendUnique(CPPPATH = [visit_inc_path])          env.AppendUnique(CPPPATH = [visit_inc_path])
332          env.AppendUnique(LIBPATH = [visit_lib_path])          env.AppendUnique(LIBPATH = [visit_lib_path])
333          env['buildvars']['visit_inc_path']=visit_inc_path          env['buildvars']['visit_inc_path']=visit_inc_path
# Line 349  def checkOptionalLibraries(env): Line 342  def checkOptionalLibraries(env):
342      mpi_inc_path=''      mpi_inc_path=''
343      mpi_lib_path=''      mpi_lib_path=''
344      if env['usempi']:      if env['usempi']:
345          mpi_inc_path,mpi_lib_path=findLibWithHeader(env, env['mpi_libs'], 'mpi.h', env['mpi_prefix'], lang='c')          mpi_inc_path,mpi_lib_path=findLibWithHeader(env, env['mpi_libs'], 'mpi.h', env['mpi_prefix'], lang='c++')
346          env.AppendUnique(CPPPATH = [mpi_inc_path])          env.AppendUnique(CPPPATH = [mpi_inc_path])
347          env.AppendUnique(LIBPATH = [mpi_lib_path])          env.AppendUnique(LIBPATH = [mpi_lib_path])
348          env.AppendUnique(LIBS = env['mpi_libs'])          env.AppendUnique(LIBS = env['mpi_libs'])
# Line 369  def checkOptionalLibraries(env): Line 362  def checkOptionalLibraries(env):
362      boomeramg_inc_path=''      boomeramg_inc_path=''
363      boomeramg_lib_path=''      boomeramg_lib_path=''
364      if env['boomeramg']:      if env['boomeramg']:
365          boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c')          boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c++')
366          env.AppendUnique(CPPPATH = [boomeramg_inc_path])          env.AppendUnique(CPPPATH = [boomeramg_inc_path])
367          env.AppendUnique(LIBPATH = [boomeramg_lib_path])          env.AppendUnique(LIBPATH = [boomeramg_lib_path])
368          env.AppendUnique(LIBS = env['boomeramg_libs'])          env.AppendUnique(LIBS = env['boomeramg_libs'])
# Line 384  def checkOptionalLibraries(env): Line 377  def checkOptionalLibraries(env):
377      parmetis_inc_path=''      parmetis_inc_path=''
378      parmetis_lib_path=''      parmetis_lib_path=''
379      if env['parmetis']:      if env['parmetis']:
380          parmetis_inc_path,parmetis_lib_path=findLibWithHeader(env, env['parmetis_libs'], 'parmetis.h', env['parmetis_prefix'], lang='c')          parmetis_inc_path,parmetis_lib_path=findLibWithHeader(env, env['parmetis_libs'], 'parmetis.h', env['parmetis_prefix'], lang='c++')
381          env.AppendUnique(CPPPATH = [parmetis_inc_path])          env.AppendUnique(CPPPATH = [parmetis_inc_path])
382          env.AppendUnique(LIBPATH = [parmetis_lib_path])          env.AppendUnique(LIBPATH = [parmetis_lib_path])
383          env.AppendUnique(LIBS = env['parmetis_libs'])          env.AppendUnique(LIBS = env['parmetis_libs'])

Legend:
Removed from v.4519  
changed lines
  Added in v.4520

  ViewVC Help
Powered by ViewVC 1.1.26