/[escript]/branches/inv2jf/SConstruct
ViewVC logotype

Diff of /branches/inv2jf/SConstruct

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

revision 5250 by caltinay, Mon Nov 10 04:05:11 2014 UTC revision 5436 by caltinay, Tue Jan 27 05:16:42 2015 UTC
# Line 87  vars.AddVariables( Line 87  vars.AddVariables(
87    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),
88    ('mpi_libs', 'MPI shared libraries to link with', ['mpi']),    ('mpi_libs', 'MPI shared libraries to link with', ['mpi']),
89    BoolVariable('cuda', 'Enable GPU code with CUDA (requires thrust)', False),    BoolVariable('cuda', 'Enable GPU code with CUDA (requires thrust)', False),
90    ('thrust_prefix', 'Prefix/Paths to NVidia thrust installation', default_prefix),    ('cuda_prefix', 'Prefix/Paths to NVidia CUDA installation', default_prefix),
91    BoolVariable('netcdf', 'Enable netCDF file support', False),    BoolVariable('netcdf', 'Enable netCDF file support', False),
92    ('netcdf_prefix', 'Prefix/Paths of netCDF installation', default_prefix),    ('netcdf_prefix', 'Prefix/Paths of netCDF installation', default_prefix),
93    ('netcdf_libs', 'netCDF libraries to link with', ['netcdf_c++', 'netcdf']),    ('netcdf_libs', 'netCDF libraries to link with', ['netcdf_c++', 'netcdf']),
# Line 115  vars.AddVariables( Line 115  vars.AddVariables(
115    ListVariable('domains', 'Which domains to build', 'all',\    ListVariable('domains', 'Which domains to build', 'all',\
116                 ['dudley','finley','ripley','speckley']),                 ['dudley','finley','ripley','speckley']),
117  # Advanced settings  # Advanced settings
118      ('launcher', 'Launcher command (e.g. mpirun)', 'default'),
119      ('prelaunch', 'Command to execute before launcher (e.g. mpdboot)', 'default'),
120      ('postlaunch', 'Command to execute after launcher (e.g. mpdexit)', 'default'),
121    #dudley_assemble_flags = -funroll-loops      to actually do something    #dudley_assemble_flags = -funroll-loops      to actually do something
122    ('dudley_assemble_flags', 'compiler flags for some dudley optimisations', ''),    ('dudley_assemble_flags', 'compiler flags for some dudley optimisations', ''),
123    # To enable passing function pointers through python    # To enable passing function pointers through python
124    BoolVariable('iknowwhatimdoing', 'Allow non-standard C', False),    BoolVariable('iknowwhatimdoing', 'Allow non-standard C', False),
125    # An option for specifying the compiler tools (see windows branch)    # An option for specifying the compiler tools
126    ('tools_names', 'Compiler tools to use', ['default']),    ('tools_names', 'Compiler tools to use', ['default']),
127    ('env_export', 'Environment variables to be passed to tools',[]),    ('env_export', 'Environment variables to be passed to tools',[]),
128    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')),
# Line 192  if env['cuda']: Line 195  if env['cuda']:
195          env['NVCC'] = env['nvcc']          env['NVCC'] = env['nvcc']
196      env.Tool('nvcc')      env.Tool('nvcc')
197    
198    if 'dudley' in env['domains']:
199        env['domains'].append('finley')
200    
201  # create dictionary which will be populated with info for buildvars file  # create dictionary which will be populated with info for buildvars file
202  env['buildvars']={}  env['buildvars']={}
203  # create list which will be populated with warnings if there are any  # create list which will be populated with warnings if there are any
# Line 340  env.Append(CCFLAGS = env['cc_flags']) Line 346  env.Append(CCFLAGS = env['cc_flags'])
346  # add system libraries  # add system libraries
347  env.AppendUnique(LIBS = env['sys_libs'])  env.AppendUnique(LIBS = env['sys_libs'])
348    
349    # set defaults for launchers if not otherwise specified
350    if env['prelaunch'] == 'default':
351        if env['mpi'] == 'INTELMPI' and env['openmp']:
352            env['prelaunch'] = "export I_MPI_PIN_DOMAIN=omp"
353        elif env['mpi'] == 'OPENMPI':
354            # transform comma-separated list to '-x a -x b -x c ...'
355            env['prelaunch'] = "EE=$(echo -x %e|sed -e 's/,/ -x /g')"
356        elif env['mpi'] == 'MPT':
357            env['prelaunch'] = "export MPI_NUM_MEMORY_REGIONS=0"
358        elif env['mpi'] == 'MPICH2':
359            env['prelaunch'] = "mpdboot -n %n -r ssh -f %f"
360        else:
361            env['prelaunch'] = ""
362    
363    if env['launcher'] == 'default':
364        if env['mpi'] == 'INTELMPI':
365            env['launcher'] = "mpirun -hostfile %f -n %N -ppn %p %b"
366        elif env['mpi'] == 'OPENMPI':
367            env['launcher'] = "mpirun --gmca mpi_warn_on_fork 0 ${EE} --host %h -bynode -bind-to-core --cpus-per-rank %t -np %N %b"
368        elif env['mpi'] == 'MPT':
369            env['launcher'] = "mpirun %h -np %p %b"
370        elif env['mpi'] == 'MPICH':
371            env['launcher'] = "mpirun -machinefile %f -np %N %b"
372        elif env['mpi'] == 'MPICH2':
373            env['launcher'] = "mpiexec -genvlist %e -np %N %b"
374        else:
375            env['launcher'] = "%b"
376    
377    if env['postlaunch'] == 'default':
378        if env['mpi'] == 'MPICH2':
379            env['postlaunch'] = "mpdallexit"
380        else:
381            env['postlaunch'] = ""
382    
383  # determine svn revision  # determine svn revision
384  global_revision=ARGUMENTS.get('SVN_VERSION', None)  global_revision=ARGUMENTS.get('SVN_VERSION', None)
385  if global_revision:  if global_revision:
# Line 365  if IS_WINDOWS: Line 405  if IS_WINDOWS:
405          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])
406    
407  env['IS_WINDOWS']=IS_WINDOWS  env['IS_WINDOWS']=IS_WINDOWS
408    env['IS_OSX']=IS_OSX
409    
410  ###################### Copy required environment vars ########################  ###################### Copy required environment vars ########################
411    
# Line 394  for key in set(env_export): Line 435  for key in set(env_export):
435      except KeyError:      except KeyError:
436          pass          pass
437    
438    for key in os.environ.keys():
439        if key.startswith("SLURM_"):
440            env['ENV'][key] = os.environ[key]
441    
442  try:  try:
443      env.PrependENVPath(LD_LIBRARY_PATH_KEY, os.environ[LD_LIBRARY_PATH_KEY])      env.PrependENVPath(LD_LIBRARY_PATH_KEY, os.environ[LD_LIBRARY_PATH_KEY])
444  except KeyError:  except KeyError:
# Line 452  env=checkBoost(env) Line 497  env=checkBoost(env)
497  ######## NVCC version (optional)  ######## NVCC version (optional)
498  if env['cuda']:  if env['cuda']:
499      env=checkCudaVersion(env)      env=checkCudaVersion(env)
500        env=checkCUDA(env)
501    
502  ######## numpy (required) and numpy headers (optional)  ######## numpy (required) and numpy headers (optional)
503  env=checkNumpy(env)  env=checkNumpy(env)
# Line 465  env=checkOptionalModules(env) Line 511  env=checkOptionalModules(env)
511  ######## optional dependencies (netCDF, PAPI, MKL, UMFPACK, Lapack, Silo, ...)  ######## optional dependencies (netCDF, PAPI, MKL, UMFPACK, Lapack, Silo, ...)
512  env=checkOptionalLibraries(env)  env=checkOptionalLibraries(env)
513    
514    #use gmsh info to set some defines
515    if env['gmsh'] == 's':
516        env.Append(CPPDEFINES=['GMSH'])
517    elif env['gmsh'] == 'm':
518        env.Append(CPPDEFINES=['GMSH','GMSH_MPI'])
519    
520  ######## PDFLaTeX (for documentation)  ######## PDFLaTeX (for documentation)
521  env=checkPDFLatex(env)  env=checkPDFLatex(env)
522    
# Line 543  env.SConscript(dirs = ['paso/profiling'] Line 595  env.SConscript(dirs = ['paso/profiling']
595    
596  write_buildvars(env)  write_buildvars(env)
597    
598    write_launcher(env)
599    
600  ################### Targets to build and install libraries ###################  ################### Targets to build and install libraries ###################
601    
602  target_init = env.Command(os.path.join(env['pyinstall'],'__init__.py'), None, Touch('$TARGET'))  target_init = env.Command(os.path.join(env['pyinstall'],'__init__.py'), None, Touch('$TARGET'))
# Line 688  def print_summary(): Line 742  def print_summary():
742          print("         CppUnit:  YES")          print("         CppUnit:  YES")
743      else:      else:
744          print("         CppUnit:  NO")          print("         CppUnit:  NO")
745        if env['gmshpy']:
746            gmshpy=" + python module"
747        else:
748            gmshpy=""
749      if env['gmsh']=='m':      if env['gmsh']=='m':
750          print("            gmsh:  YES, MPI-ENABLED")          print("            gmsh:  YES, MPI-ENABLED"+gmshpy)
751      elif env['gmsh']=='s':      elif env['gmsh']=='s':
752          print("            gmsh:  YES")          print("            gmsh:  YES"+gmshpy)
753      else:      else:
754          print("            gmsh:  NO")          if env['gmshpy']:
755                print("            gmsh:  python module only")
756            else:
757                print("            gmsh:  NO")
758      print(    "            gzip:  " + ("YES" if env['compressed_files'] else "NO"))      print(    "            gzip:  " + ("YES" if env['compressed_files'] else "NO"))
759    
760      if ((fatalwarning != '') and (env['werror'])):      if ((fatalwarning != '') and (env['werror'])):

Legend:
Removed from v.5250  
changed lines
  Added in v.5436

  ViewVC Help
Powered by ViewVC 1.1.26