/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2276 by jfenwick, Tue Feb 17 06:21:31 2009 UTC revision 2295 by jfenwick, Wed Mar 4 05:18:28 2009 UTC
# Line 72  opts.AddOptions( Line 72  opts.AddOptions(
72    ('ld_extra', 'Extra linker flags', ''),    ('ld_extra', 'Extra linker flags', ''),
73    ('sys_libs', 'System libraries to link with', []),    ('sys_libs', 'System libraries to link with', []),
74    ('ar_flags', 'Static library archiver flags to use', ''),    ('ar_flags', 'Static library archiver flags to use', ''),
75    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'no'),
76    BoolOption('usepedantic', 'Compile with -pedantic if using gcc', 'no'),    BoolOption('usepedantic', 'Compile with -pedantic if using gcc', 'no'),
77    BoolOption('usewarnings','Compile with warnings as errors if using gcc','yes'),    BoolOption('usewarnings','Compile with warnings as errors if using gcc','yes'),
78    ('forcelazy','for testing use only - set the default value for autolazy','leave_alone'),    ('forcelazy','for testing use only - set the default value for autolazy','leave_alone'),
# Line 333  conf = Configure(clone_env(env)) Line 333  conf = Configure(clone_env(env))
333    
334  # Test that the compiler is working  # Test that the compiler is working
335  if not conf.CheckFunc('printf'):  if not conf.CheckFunc('printf'):
336    print "Cannot run C compiler '%s' (or libc is missing)" % (env['CC'])     print "Cannot run C compiler '%s' (or libc is missing)" % (env['CC'])
337    sys.exit(1)     sys.exit(1)
338    
339  if conf.CheckFunc('gethostname'):  if conf.CheckFunc('gethostname'):
340    conf.env.Append(CPPDEFINES = ['HAVE_GETHOSTNAME'])    conf.env.Append(CPPDEFINES = ['HAVE_GETHOSTNAME'])
# Line 355  conf.env.PrependENVPath('LD_LIBRARY_PATH Line 355  conf.env.PrependENVPath('LD_LIBRARY_PATH
355  if not conf.CheckCHeader('Python.h'):  if not conf.CheckCHeader('Python.h'):
356    print "Cannot find python include files (tried 'Python.h' in directory %s)" % (env['python_path'])    print "Cannot find python include files (tried 'Python.h' in directory %s)" % (env['python_path'])
357    sys.exit(1)    sys.exit(1)
358  if not conf.CheckFunc('Py_Main'):  if not conf.CheckFunc('Py_Exit'):
359    print "Cannot find python library method Py_Main (tried lib %s in directory %s)" % (env['python_libs'], env['python_lib_path'])    print "Cannot find python library method Py_Main (tried lib %s in directory %s)" % (env['python_libs'], env['python_lib_path'])
360    sys.exit(1)    sys.exit(1)
361    
362  ############ boost (required) ##################################  ############ boost (required) ##################################
363    
364  if not sysheaderopt =="":  if not sysheaderopt =="":
365    conf.env.Append(CCFLAGS=sysheaderopt+env['boost_path']+'boost')  # This is required because we can't -isystem /usr/system because it breaks std includes
366      if os.path.normpath(env['boost_path']) =="/usr/include":
367        conf.env.Append(CCFLAGS=sysheaderopt+os.path.join(env['boost_path'],'boost'))
368      else:
369        conf.env.Append(CCFLAGS=sysheaderopt+env['boost_path'])
370  else:  else:
371    conf.env.AppendUnique(CPPPATH     = [env['boost_path']])    conf.env.AppendUnique(CPPPATH     = [env['boost_path']])
372    
# Line 374  conf.env.PrependENVPath('LD_LIBRARY_PATH Line 378  conf.env.PrependENVPath('LD_LIBRARY_PATH
378  if not conf.CheckCXXHeader('boost/python.hpp'):  if not conf.CheckCXXHeader('boost/python.hpp'):
379    print "Cannot find boost include files (tried boost/python.hpp in directory %s)" % (env['boost_path'])    print "Cannot find boost include files (tried boost/python.hpp in directory %s)" % (env['boost_path'])
380    sys.exit(1)    sys.exit(1)
381    
382  if not conf.CheckFunc('PyObject_SetAttr'):  if not conf.CheckFunc('PyObject_SetAttr'):
383    print "Cannot find boost library method PyObject_SetAttr (tried method PyObject_SetAttr in library %s in directory %s)" % (env['boost_libs'], env['boost_lib_path'])    print "Cannot find boost library method PyObject_SetAttr (tried method PyObject_SetAttr in library %s in directory %s)" % (env['boost_libs'], env['boost_lib_path'])
384    sys.exit(1)    sys.exit(1)
# Line 476  if env['useumfpack']: Line 481  if env['useumfpack']:
481    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['amd_lib_path'])   # The wrapper script needs to find these libs    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['amd_lib_path'])   # The wrapper script needs to find these libs
482    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['blas_lib_path'])  # The wrapper script needs to find these libs    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['blas_lib_path'])  # The wrapper script needs to find these libs
483    
 if env['useumfpack'] and not conf.CheckCHeader('umfpack.h'): env['useumfpack'] = 0  
484  if env['useumfpack'] and not conf.CheckFunc('umfpack_di_symbolic'): env['useumfpack'] = 0  if env['useumfpack'] and not conf.CheckFunc('umfpack_di_symbolic'): env['useumfpack'] = 0
485  if env['useumfpack'] and not conf.CheckFunc('daxpy'): env['useumfpack'] = 0 # this does not work on shake73?  if env['useumfpack'] and not conf.CheckCHeader('umfpack.h'): env['useumfpack'] = 0
486    # if env['useumfpack'] and not conf.CheckFunc('daxpy'): env['useumfpack'] = 0 # this does not work on shake73?
487    
488  # Add UMFPACK to environment env if it was found  # Add UMFPACK to environment env if it was found
489  if env['useumfpack']:  if env['useumfpack']:
# Line 701  build_all_list += ['build_paso'] Line 706  build_all_list += ['build_paso']
706  build_all_list += ['build_escript']  build_all_list += ['build_escript']
707  build_all_list += ['build_finley']  build_all_list += ['build_finley']
708  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']  if env['usempi']:       build_all_list += ['target_pythonMPI_exe']
709  if not IS_WINDOWS_PLATFORM: build_all_list += ['target_finley_wrapper']  if not IS_WINDOWS_PLATFORM: build_all_list += ['target_escript_wrapper']
710  if env['usesilo']:  build_all_list += ['target_escript2silo']  if env['usesilo']:  build_all_list += ['target_escript2silo']
711  env.Alias('build_all', build_all_list)  env.Alias('build_all', build_all_list)
712    
# Line 715  install_all_list += ['target_install_pyv Line 720  install_all_list += ['target_install_pyv
720  install_all_list += ['target_install_modellib_py']  install_all_list += ['target_install_modellib_py']
721  install_all_list += ['target_install_pycad_py']  install_all_list += ['target_install_pycad_py']
722  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']  if env['usempi']:       install_all_list += ['target_install_pythonMPI_exe']
723  if not IS_WINDOWS_PLATFORM: install_all_list += ['target_install_finley_wrapper']  if not IS_WINDOWS_PLATFORM: install_all_list += ['target_install_escript_wrapper']
724  if env['usesilo']:  install_all_list += ['target_install_escript2silo']  if env['usesilo']:  install_all_list += ['target_install_escript2silo']
725  install_all_list += ['remember_options']  install_all_list += ['remember_options']
726  env.Alias('install_all', install_all_list)  env.Alias('install_all', install_all_list)
# Line 729  env.Alias('build_cppunittest', ['target_ Line 734  env.Alias('build_cppunittest', ['target_
734  env.Alias('install_cppunittest', ['build_cppunittest', 'target_install_cppunittest_a'])  env.Alias('install_cppunittest', ['build_cppunittest', 'target_install_cppunittest_a'])
735  env.Alias('run_tests', ['install_all', 'target_install_cppunittest_a'])  env.Alias('run_tests', ['install_all', 'target_install_cppunittest_a'])
736  env.Alias('all_tests', ['install_all', 'target_install_cppunittest_a', 'run_tests', 'py_tests'])  env.Alias('all_tests', ['install_all', 'target_install_cppunittest_a', 'run_tests', 'py_tests'])
737    env.Alias('build_full',['install_all','build_tests','build_py_tests'])
738    
739  ############ Targets to build the documentation ################  ############ Targets to build the documentation ################
740    

Legend:
Removed from v.2276  
changed lines
  Added in v.2295

  ViewVC Help
Powered by ViewVC 1.1.26