/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2603 by jfenwick, Wed Aug 12 00:44:35 2009 UTC revision 2729 by jfenwick, Thu Oct 22 01:45:28 2009 UTC
# Line 16  EnsureSConsVersion(0,96,91) Line 16  EnsureSConsVersion(0,96,91)
16  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
17    
18  import sys, os, re, socket, platform, stat  import sys, os, re, socket, platform, stat
19    # For copy()
20    import shutil
21    
22  # Add our extensions  # Add our extensions
23  if os.path.isdir('scons'): sys.path.append('scons')  if os.path.isdir('scons'): sys.path.append('scons')
# Line 100  adder( Line 102  adder(
102    BoolVariable('usepedantic', 'Compile with -pedantic if using gcc', 'no'),    BoolVariable('usepedantic', 'Compile with -pedantic if using gcc', 'no'),
103    BoolVariable('usewarnings','Compile with warnings as errors if using gcc','yes'),    BoolVariable('usewarnings','Compile with warnings as errors if using gcc','yes'),
104    ('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'),
105      ('forcecollres','for testing use only - set the default value for force resolving collective ops','leave_alone'),
106  # Python  # Python
107    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),
108    ('python_lib_path', 'Path to Python libs', usr_lib),    ('python_lib_path', 'Path to Python libs', usr_lib),
# Line 121  adder( Line 124  adder(
124    ('mpi_path', 'Path to MPI includes', '/usr/include'),    ('mpi_path', 'Path to MPI includes', '/usr/include'),
125    ('mpi_run', 'mpirun name' , 'mpiexec -np 1'),    ('mpi_run', 'mpirun name' , 'mpiexec -np 1'),
126    ('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)', usr_lib),    ('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)', usr_lib),
127    ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', ['mpich' , 'pthread', 'rt']),    ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', []),
128    ('mpi_flavour','Type of MPI execution environment','none'),    ('mpi_flavour','Type of MPI execution environment','none'),
129  # ParMETIS  # ParMETIS
130    BoolVariable('useparmetis', 'Compile parallel version using ParMETIS', 'yes'),    BoolVariable('useparmetis', 'Compile parallel version using ParMETIS', 'yes'),
# Line 167  adder( Line 170  adder(
170    ('env_export','Environment variables to be passed to children',[])    ('env_export','Environment variables to be passed to children',[])
171  )  )
172    
173    
174    
175  ############ Specify which compilers to use ####################  ############ Specify which compilers to use ####################
176    
177  # intelc uses regular expressions improperly and emits a warning about  # intelc uses regular expressions improperly and emits a warning about
# Line 187  else: Line 192  else:
192        env = Environment(tools = ['default'], options = opts)        env = Environment(tools = ['default'], options = opts)
193  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
194    
195    
196    ############ Make sure target directories exist ################
197    
198    if not os.path.isdir(env['bininstall']):
199        os.makedirs(env['bininstall'])
200    if not os.path.isdir(env['libinstall']):
201        os.makedirs(env['libinstall'])
202    if not os.path.isdir(env['pyinstall']):
203        os.makedirs(env['pyinstall'])
204    
205  ########## Copy required environment vars ######################  ########## Copy required environment vars ######################
206    
207  for i in env['env_export']:  for i in env['env_export']:
# Line 222  elif env["CC"] == "gcc": Line 237  elif env["CC"] == "gcc":
237    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
238    omp_optim     = "-fopenmp"    omp_optim     = "-fopenmp"
239    omp_debug     = "-fopenmp"    omp_debug     = "-fopenmp"
240    omp_libs      = ['gomp']    omp_libs      = []
241    pedantic      = "-pedantic-errors -Wno-long-long"    pedantic      = "-pedantic-errors -Wno-long-long"
242    fatalwarning      = "-Werror"    fatalwarning      = "-Werror"
243    sysheaderopt      = "-isystem "    sysheaderopt      = "-isystem "
# Line 255  if env["omp_libs"] == "-DEFAULT_6": env[ Line 270  if env["omp_libs"] == "-DEFAULT_6": env[
270  #set up the autolazy values  #set up the autolazy values
271  if env['forcelazy']    != "leave_alone":  if env['forcelazy']    != "leave_alone":
272    if env['forcelazy'] == 'on':    if env['forcelazy'] == 'on':
273      env.Append(CPPDEFINES='FAUTOLAZYON')      env.Append(CPPDEFINES=['FAUTOLAZYON'])
274    else:    else:
275       if env['forcelazy'] == 'off':       if env['forcelazy'] == 'off':
276      env.Append(CPPDEFINES='FAUTOLAZYOFF')      env.Append(CPPDEFINES=['FAUTOLAZYOFF'])
277    
278    #set up the colective resolve values
279    if env['forcecollres']    != "leave_alone":
280      print env['forcecollres']
281      if env['forcecollres'] == 'on':
282        env.Append(CPPDEFINES=['FRESCOLLECTON'])
283      else:
284         if env['forcecollres'] == 'off':
285        env.Append(CPPDEFINES=['FRESCOLLECTOFF'])
286    
287    
288  # OpenMP is disabled if useopenmp=no or both variables omp_optim and omp_debug are empty  # OpenMP is disabled if useopenmp=no or both variables omp_optim and omp_debug are empty
289  if not env["useopenmp"]:  if not env["useopenmp"]:
# Line 885  if not IS_WINDOWS_PLATFORM: Line 910  if not IS_WINDOWS_PLATFORM:
910      print "Error attempting to write unittests file."      print "Error attempting to write unittests file."
911      sys.exit(1)      sys.exit(1)
912    
913       #Make sure that the escript wrapper is in place
914       if not os.path.isfile(os.path.join(env['bininstall'],'escript')):
915           print "Copying escript wrapper"
916           shutil.copy("bin/escript",os.path.join(env['bininstall'],'escript'))

Legend:
Removed from v.2603  
changed lines
  Added in v.2729

  ViewVC Help
Powered by ViewVC 1.1.26