/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 6184 by caltinay, Wed Apr 27 01:30:57 2016 UTC revision 6241 by caltinay, Wed Jun 1 06:00:06 2016 UTC
# Line 23  from site_init import * Line 23  from site_init import *
23    
24  # Version number to check for in options file. Increment when new features are  # Version number to check for in options file. Increment when new features are
25  # added or existing options changed.  # added or existing options changed.
26  REQUIRED_OPTS_VERSION=202  REQUIRED_OPTS_VERSION=203
27    
28  # MS Windows support, many thanks to PH  # MS Windows support, many thanks to PH
29  IS_WINDOWS = (os.name == 'nt')  IS_WINDOWS = (os.name == 'nt')
# Line 75  vars.AddVariables( Line 75  vars.AddVariables(
75    ('cc_optim', 'Additional (C and C++) flags for a non-debug build', 'default'),    ('cc_optim', 'Additional (C and C++) flags for a non-debug build', 'default'),
76    ('cc_debug', 'Additional (C and C++) flags for a debug build', 'default'),    ('cc_debug', 'Additional (C and C++) flags for a debug build', 'default'),
77    ('cxx_extra', 'Extra C++ compiler flags', ''),    ('cxx_extra', 'Extra C++ compiler flags', ''),
   ('cpp_flags', 'C Pre-processor flags', ''),  
   ('cpp_extra', 'Extra C Pre-processor flags', ''),  
78    ('ld_extra', 'Extra linker flags', ''),    ('ld_extra', 'Extra linker flags', ''),
79    ('nvcc', 'Path to CUDA compiler', 'default'),    ('nvcc', 'Path to CUDA compiler', 'default'),
80    ('nvccflags', 'Base CUDA compiler flags', 'default'),    ('nvccflags', 'Base CUDA compiler flags', 'default'),
# Line 140  vars.AddVariables( Line 138  vars.AddVariables(
138    ('env_export', 'Environment variables to be passed to tools',[]),    ('env_export', 'Environment variables to be passed to tools',[]),
139    EnumVariable('forcelazy', 'For testing use only - set the default value for autolazy', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')),    EnumVariable('forcelazy', 'For testing use only - set the default value for autolazy', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')),
140    EnumVariable('forcecollres', 'For testing use only - set the default value for force resolving collective ops', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')),    EnumVariable('forcecollres', 'For testing use only - set the default value for force resolving collective ops', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')),
141    BoolVariable('build_shared', 'Build dynamic libraries only (ignored)', True),    BoolVariable('build_shared', '(deprecated option, ignored)', True),
142    ('sys_libs', 'Extra libraries to link with', []),    ('sys_libs', 'Extra libraries to link with', []),
143    ('escript_opts_version', 'Version of options file (do not specify on command line)'),    ('escript_opts_version', 'Version of options file (do not specify on command line)'),
144    ('SVN_VERSION', 'Do not use from options file', -2),    ('SVN_VERSION', 'Do not use from options file', -2),
145    ('pythoncmd', 'which python to compile with','python'),    ('pythoncmd', 'which python to compile with', sys.executable),
   BoolVariable('usepython3', 'Is this a python3 build?', False),  
146    ('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.)', ''),
147    ('pythonlibpath', 'Path to the python library. (You should not need to set this unless your python has moved)',''),    ('pythonlibpath', 'Path to the python library. (You should not need to set this unless your python has moved)',''),
148    ('pythonincpath','Path to python include files. (You should not need to set this unless your python has moved',''),    ('pythonincpath','Path to python include files. (You should not need to set this unless your python has moved',''),
# Line 190  if options_file: Line 187  if options_file:
187          print("Using options in %s." % options_file)          print("Using options in %s." % options_file)
188      else:      else:
189          print("\nOptions file %s" % options_file)          print("\nOptions file %s" % options_file)
190          print("is outdated! Please update the file by examining one of the TEMPLATE")          print("is outdated! Please update the file after reading scons/templates/README_FIRST")
191          print("files in the scons/ subdirectory and setting escript_opts_version to %d.\n"%REQUIRED_OPTS_VERSION)          print("and setting escript_opts_version to %d.\n"%REQUIRED_OPTS_VERSION)
192          Exit(1)          Exit(1)
193    
194  # Generate help text (scons -h)  # Generate help text (scons -h)
# Line 301  if env['omp_flags']   == 'default': env[ Line 298  if env['omp_flags']   == 'default': env[
298  if env['omp_ldflags'] == 'default': env['omp_ldflags'] = omp_ldflags  if env['omp_ldflags'] == 'default': env['omp_ldflags'] = omp_ldflags
299  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])  if env['cxx_extra'] != '': env.Append(CXXFLAGS = env['cxx_extra'])
300  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])  if env['ld_extra']  != '': env.Append(LINKFLAGS = env['ld_extra'])
 if env['cpp_flags'] != '': env.Append(CPPFLAGS = env['cpp_flags'])  
 if env['cpp_extra'] != '': env.Append(CPPFLAGS = " "+env['cpp_extra'])  
301    
302  if env['nvccflags'] != 'default':  if env['nvccflags'] != 'default':
303      env['NVCCFLAGS'] = env['nvccflags']      env['NVCCFLAGS'] = env['nvccflags']
# Line 311  if env['nvccflags'] != 'default': Line 306  if env['nvccflags'] != 'default':
306  if env['longindices']:  if env['longindices']:
307      env.Append(CPPDEFINES = ['ESYS_INDEXTYPE_LONG'])      env.Append(CPPDEFINES = ['ESYS_INDEXTYPE_LONG'])
308    
 if env['usepython3']:  
     env.Append(CPPDEFINES=['ESPYTHON3'])  
   
309  # set up the autolazy values  # set up the autolazy values
310  if env['forcelazy'] == 'on':  if env['forcelazy'] == 'on':
311      env.Append(CPPDEFINES=['FAUTOLAZYON'])      env.Append(CPPDEFINES=['FAUTOLAZYON'])
# Line 458  if IS_OSX: Line 450  if IS_OSX:
450    except KeyError:    except KeyError:
451      pass      pass
452    
   
 # these shouldn't be needed  
 #for key in 'C_INCLUDE_PATH','CPLUS_INCLUDE_PATH','LIBRARY_PATH':  
 #    try:  
 #        env['ENV'][key] = os.environ[key]  
 #    except KeyError:  
 #        pass  
   
453  try:  try:
454      env['ENV']['PYTHONPATH'] = os.environ['PYTHONPATH']      env['ENV']['PYTHONPATH'] = os.environ['PYTHONPATH']
455  except KeyError:  except KeyError:

Legend:
Removed from v.6184  
changed lines
  Added in v.6241

  ViewVC Help
Powered by ViewVC 1.1.26