/[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 1686 by ksteube, Sun Aug 3 01:56:22 2008 UTC revision 1687 by ksteube, Mon Aug 4 04:54:47 2008 UTC
# Line 58  opts.AddOptions( Line 58  opts.AddOptions(
58    ('sys_libs', 'System libraries to link with', []),    ('sys_libs', 'System libraries to link with', []),
59    ('ar_flags', 'Static library archiver flags to use', ''),    ('ar_flags', 'Static library archiver flags to use', ''),
60    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),    BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),
61      BoolOption('usepedantic', 'Compile with -pedantic if using gcc', 'yes'),
62  # Python  # Python
63    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),
64    ('python_lib_path', 'Path to Python libs', usr_lib),    ('python_lib_path', 'Path to Python libs', usr_lib),
# Line 147  if env["CC"] == "icc": Line 148  if env["CC"] == "icc":
148    omp_optim     = "-openmp -openmp_report0"    omp_optim     = "-openmp -openmp_report0"
149    omp_debug     = "-openmp -openmp_report0"    omp_debug     = "-openmp -openmp_report0"
150    omp_libs      = ['guide']    omp_libs      = ['guide']
151      pedantic      = ""
152  elif env["CC"] == "gcc":  elif env["CC"] == "gcc":
153    # GNU C on any system    # GNU C on any system
154    cc_flags      = "-fPIC -ansi -ffast-math -Wno-unknown-pragmas -pedantic-errors -Wno-long-long -DBLOCKTIMER"    cc_flags      = "-fPIC -ansi -ffast-math -Wno-unknown-pragmas -DBLOCKTIMER"
155    cc_optim      = "-O3"    cc_optim      = "-O3"
156    cc_debug      = "-g -O0 -UDOASSERT -DDOPROF -DBOUNDS_CHECK"    cc_debug      = "-g -O0 -UDOASSERT -DDOPROF -DBOUNDS_CHECK"
157    omp_optim     = ""    omp_optim     = ""
158    omp_debug     = ""    omp_debug     = ""
159    omp_libs      = []    omp_libs      = []
160      pedantic      = "-pedantic-errors -Wno-long-long"
161  elif env["CC"] == "cl":  elif env["CC"] == "cl":
162    # Microsoft Visual C on Windows    # Microsoft Visual C on Windows
163    cc_flags      = "/FD /EHsc /GR /wd4068 -D_USE_MATH_DEFINES -DDLL_NETCDF"    cc_flags      = "/FD /EHsc /GR /wd4068 -D_USE_MATH_DEFINES -DDLL_NETCDF"
# Line 163  elif env["CC"] == "cl": Line 166  elif env["CC"] == "cl":
166    omp_optim     = ""    omp_optim     = ""
167    omp_debug     = ""    omp_debug     = ""
168    omp_libs      = []    omp_libs      = []
169      pedantic      = ""
170    
171  # If not specified in hostname_options.py then set them here  # If not specified in hostname_options.py then set them here
172  if env["cc_flags"]  == "-DEFAULT_1": env['cc_flags'] = cc_flags  if env["cc_flags"]  == "-DEFAULT_1": env['cc_flags'] = cc_flags
# Line 232  env.Append(LIBPATH     = [Dir('lib')]) Line 236  env.Append(LIBPATH     = [Dir('lib')])
236    
237  env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS', 'FINLEY_EXPORTS'])  env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS', 'FINLEY_EXPORTS'])
238    
239    if env['usepedantic']: env.Append(CCFLAGS = pedantic)
240    
241  # MS Windows  # MS Windows
242  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
243    env.PrependENVPath('PATH',    [env['boost_lib_path']])    env.PrependENVPath('PATH',    [env['boost_lib_path']])
# Line 279  conf.env.AppendUnique(LIBPATH      = [env['p Line 285  conf.env.AppendUnique(LIBPATH      = [env['p
285  conf.env.AppendUnique(LIBS      = [env['python_libs']])  conf.env.AppendUnique(LIBS      = [env['python_libs']])
286    
287  if not conf.CheckCHeader('Python.h'):  if not conf.CheckCHeader('Python.h'):
288    print "Cannot find python include files (tried directory %s)" % env['python_path']    print "Cannot find python include files (tried 'Python.h' in directory %s)" % (env['python_path'])
289    sys.exit(1)    sys.exit(1)
290  if not conf.CheckFunc('Py_Main'):  if not conf.CheckFunc('Py_Main'):
291    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'])
# Line 292  conf.env.AppendUnique(LIBPATH      = [env['b Line 298  conf.env.AppendUnique(LIBPATH      = [env['b
298  conf.env.AppendUnique(LIBS      = [env['boost_libs']])  conf.env.AppendUnique(LIBS      = [env['boost_libs']])
299    
300  if not conf.CheckCXXHeader('boost/python.hpp'):  if not conf.CheckCXXHeader('boost/python.hpp'):
301    print "Cannot find boost include files (tried directory %s)" % env['boost_path']    print "Cannot find boost include files (tried boost/python.hpp in directory %s)" % (env['boost_path'])
302    sys.exit(1)    sys.exit(1)
303  if not conf.CheckFunc('PyObject_SetAttr'):  if not conf.CheckFunc('PyObject_SetAttr'):
304    print "Cannot find boost library method PyObject_SetAttr (tried directory %s)" % 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'])
305    sys.exit(1)    sys.exit(1)
306    
307  # Commit changes to environment  # Commit changes to environment

Legend:
Removed from v.1686  
changed lines
  Added in v.1687

  ViewVC Help
Powered by ViewVC 1.1.26