/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 5939 by caltinay, Thu Feb 18 10:04:32 2016 UTC revision 6124 by caltinay, Tue Apr 5 03:23:12 2016 UTC
# Line 4  Line 4 
4  # http://www.uq.edu.au  # http://www.uq.edu.au
5  #  #
6  # Primary Business: Queensland, Australia  # Primary Business: Queensland, Australia
7  # Licensed under the Open Software License version 3.0  # Licensed under the Apache License, version 2.0
8  # http://www.opensource.org/licenses/osl-3.0.php  # http://www.apache.org/licenses/LICENSE-2.0
9  #  #
10  # Development until 2012 by Earth Systems Science Computational Center (ESSCC)  # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11  # Development 2012-2013 by School of Earth Sciences  # Development 2012-2013 by School of Earth Sciences
# Line 55  if not os.path.isfile(options_file): Line 55  if not os.path.isfile(options_file):
55  default_prefix='/usr'  default_prefix='/usr'
56  mpi_flavours=('no', 'none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI')  mpi_flavours=('no', 'none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI')
57  lapack_flavours=('none', 'clapack', 'mkl')  lapack_flavours=('none', 'clapack', 'mkl')
58    all_domains = ['dudley','finley','ripley','speckley']
59    
60  #Note that scons construction vars the the following purposes:  #Note that scons construction vars the the following purposes:
61  #  CPPFLAGS -> to the preprocessor  #  CPPFLAGS -> to the preprocessor
# Line 117  vars.AddVariables( Line 118  vars.AddVariables(
118    BoolVariable('silo', 'Enable the Silo file format in weipa', False),    BoolVariable('silo', 'Enable the Silo file format in weipa', False),
119    ('silo_prefix', 'Prefix/Paths to Silo installation', default_prefix),    ('silo_prefix', 'Prefix/Paths to Silo installation', default_prefix),
120    ('silo_libs', 'Silo libraries to link with', ['siloh5', 'hdf5']),    ('silo_libs', 'Silo libraries to link with', ['siloh5', 'hdf5']),
121      BoolVariable('trilinos', 'Enable the Trilinos solvers', False),
122      ('trilinos_prefix', 'Prefix/Paths to Trilinos installation', default_prefix),
123      ('trilinos_libs', 'Trilinos libraries to link with', []),
124    BoolVariable('visit', 'Enable the VisIt simulation interface', False),    BoolVariable('visit', 'Enable the VisIt simulation interface', False),
125    ('visit_prefix', 'Prefix/Paths to VisIt installation', default_prefix),    ('visit_prefix', 'Prefix/Paths to VisIt installation', default_prefix),
126    ('visit_libs', 'VisIt libraries to link with', ['simV2']),    ('visit_libs', 'VisIt libraries to link with', ['simV2']),
127    ListVariable('domains', 'Which domains to build', 'all',\    ListVariable('domains', 'Which domains to build', 'all', all_domains),
128                 ['dudley','finley','ripley','speckley']),    BoolVariable('paso', 'Build Paso solver library', True),
129      BoolVariable('weipa', 'Build Weipa data export library', True),
130  # Advanced settings  # Advanced settings
131    ('launcher', 'Launcher command (e.g. mpirun)', 'default'),    ('launcher', 'Launcher command (e.g. mpirun)', 'default'),
132    ('prelaunch', 'Command to execute before launcher (e.g. mpdboot)', 'default'),    ('prelaunch', 'Command to execute before launcher (e.g. mpdboot)', 'default'),
# Line 135  vars.AddVariables( Line 140  vars.AddVariables(
140    ('env_export', 'Environment variables to be passed to tools',[]),    ('env_export', 'Environment variables to be passed to tools',[]),
141    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')),
142    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')),
143    ('build_shared', 'Build dynamic libraries only', True),    BoolVariable('build_shared', 'Build dynamic libraries only (ignored)', True),
144    ('sys_libs', 'Extra libraries to link with', []),    ('sys_libs', 'Extra libraries to link with', []),
145    ('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)'),
146    ('SVN_VERSION', 'Do not use from options file', -2),    ('SVN_VERSION', 'Do not use from options file', -2),
147    ('pythoncmd', 'which python to compile with','python'),    ('pythoncmd', 'which python to compile with','python'),
148    ('usepython3', 'Is this a python3 build?', False),    BoolVariable('usepython3', 'Is this a python3 build?', False),
149    ('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.)', ''),
150    ('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)',''),
151    ('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 152  vars.AddVariables( Line 157  vars.AddVariables(
157    ('papi_libs', 'PAPI libraries to link with', ['papi']),    ('papi_libs', 'PAPI libraries to link with', ['papi']),
158    BoolVariable('papi_instrument_solver', 'Use PAPI to instrument each iteration of the solver', False),    BoolVariable('papi_instrument_solver', 'Use PAPI to instrument each iteration of the solver', False),
159    BoolVariable('osx_dependency_fix', 'Fix dependencies for libraries to have absolute paths (OSX)',    BoolVariable('osx_dependency_fix', 'Fix dependencies for libraries to have absolute paths (OSX)',
160  False)  False),
161      BoolVariable('broken_cppacos', 'Use boost acos instead of std version', False)
162  )  )
163    
164  ##################### Create environment and help text #######################  ##################### Create environment and help text #######################
# Line 207  if env['cuda']: Line 213  if env['cuda']:
213  if 'dudley' in env['domains']:  if 'dudley' in env['domains']:
214      env['domains'].append('finley')      env['domains'].append('finley')
215    
216    env['domains'] = sorted(set(env['domains']))
217    
218  # create dictionary which will be populated with info for buildvars file  # create dictionary which will be populated with info for buildvars file
219  env['buildvars']={}  env['buildvars'] = {}
220  # create list which will be populated with warnings if there are any  # create list which will be populated with warnings if there are any
221  env['warnings']=[]  env['warnings'] = []
222    
223  #################### Make sure install directories exist #####################  #################### Make sure install directories exist #####################
224    
225  env['BUILD_DIR']=Dir(env['build_dir']).abspath  env['BUILD_DIR'] = Dir(env['build_dir']).abspath
226  prefix=Dir(env['prefix']).abspath  prefix = Dir(env['prefix']).abspath
227  env['buildvars']['prefix']=prefix  env['buildvars']['prefix'] = prefix
228  env['incinstall'] = os.path.join(prefix, 'include')  env['incinstall'] = os.path.join(prefix, 'include')
229  env['bininstall'] = os.path.join(prefix, 'bin')  env['bininstall'] = os.path.join(prefix, 'bin')
230  env['libinstall'] = os.path.join(prefix, 'lib')  env['libinstall'] = os.path.join(prefix, 'lib')
# Line 233  env.Append(LIBPATH = [env['libinstall']] Line 241  env.Append(LIBPATH = [env['libinstall']]
241    
242  ################# Fill in compiler options if not set above ##################  ################# Fill in compiler options if not set above ##################
243    
244  if env['cxx'] != 'default': env['CXX']=env['cxx']  if env['cxx'] != 'default':
245        env['CXX'] = env['cxx']
 # version >=9 of intel C++ compiler requires use of icpc to link in C++  
 # runtimes (icc does not)  
 if not IS_WINDOWS and os.uname()[4]=='ia64' and env['CXX']=='icpc':  
     env['LINK'] = env['CXX']  
246    
247  # default compiler/linker options  # default compiler/linker options
248  cc_flags = ''  cc_flags = ''
# Line 254  cc_name=os.path.basename(env['CXX']) Line 258  cc_name=os.path.basename(env['CXX'])
258    
259  if cc_name == 'icpc':  if cc_name == 'icpc':
260      # Intel compiler      # Intel compiler
261        # #1478: class "std::auto_ptr<...>" was declared deprecated
262      # #1875: offsetof applied to non-POD types is nonstandard (in boost)      # #1875: offsetof applied to non-POD types is nonstandard (in boost)
263      # removed -std=c99 because icpc doesn't like it and we aren't using c anymore      # removed -std=c99 because icpc doesn't like it and we aren't using c anymore
264      cc_flags    = "-std=c++11 -fPIC -w2 -wd1875 -Wno-unknown-pragmas"      cc_flags    = "-std=c++11 -fPIC -w2 -wd1875 -wd1478 -Wno-unknown-pragmas"
265      cc_optim    = "-O3 -ftz -fno-alias -inline-level=2 -ipo -xHost"      cc_optim    = "-O3 -ftz -fno-alias -inline-level=2 -ipo -xHost"
266      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK -DSLOWSHARECHECK"
267      omp_flags   = "-openmp"      omp_flags   = "-openmp"
268      omp_ldflags = "-openmp -openmp_report=1"      omp_ldflags = "-openmp -openmp_report=1"
269      fatalwarning = "-Werror"      fatalwarning = "-Werror"
# Line 269  elif cc_name[:3] == 'g++': Line 274  elif cc_name[:3] == 'g++':
274      cc_flags     = "-std=c++11 -pedantic -Wall -fPIC -Wno-unknown-pragmas -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing -finline-functions"      cc_flags     = "-std=c++11 -pedantic -Wall -fPIC -Wno-unknown-pragmas -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing -finline-functions"
275      cc_optim     = "-O3"      cc_optim     = "-O3"
276      #max-vartrack-size: avoid vartrack limit being exceeded with escriptcpp.cpp      #max-vartrack-size: avoid vartrack limit being exceeded with escriptcpp.cpp
277      cc_debug     = "-g3 -O0 -D_GLIBCXX_DEBUG -DDOASSERT -DDOPROF -DBOUNDS_CHECK --param=max-vartrack-size=100000000"      cc_debug     = "-g3 -O0 -D_GLIBCXX_DEBUG -DDOASSERT -DDOPROF -DBOUNDS_CHECK -DSLOWSHARECHECK --param=max-vartrack-size=100000000"
278      omp_flags    = "-fopenmp"      omp_flags    = "-fopenmp"
279      omp_ldflags  = "-fopenmp"      omp_ldflags  = "-fopenmp"
280      fatalwarning = "-Werror"      fatalwarning = "-Werror"
# Line 317  if env['forcelazy'] == 'on': Line 322  if env['forcelazy'] == 'on':
322  elif env['forcelazy'] == 'off':  elif env['forcelazy'] == 'off':
323      env.Append(CPPDEFINES=['FAUTOLAZYOFF'])      env.Append(CPPDEFINES=['FAUTOLAZYOFF'])
324    
325    if env['broken_cppacos']:
326        env.Append(CPPDEFINES=['BROKENACOS'])
327    
328  # set up the collective resolve values  # set up the collective resolve values
329  if env['forcecollres'] == 'on':  if env['forcecollres'] == 'on':
330      env.Append(CPPDEFINES=['FRESCOLLECTON'])      env.Append(CPPDEFINES=['FRESCOLLECTON'])
# Line 372  if env['launcher'] == 'default': Line 380  if env['launcher'] == 'default':
380      if env['mpi'] == 'INTELMPI':      if env['mpi'] == 'INTELMPI':
381          env['launcher'] = "mpirun -hostfile %f -n %N -ppn %p %b"          env['launcher'] = "mpirun -hostfile %f -n %N -ppn %p %b"
382      elif env['mpi'] == 'OPENMPI':      elif env['mpi'] == 'OPENMPI':
383          env['launcher'] = "mpirun ${AGENTOVERRIDE} --gmca mpi_warn_on_fork 0 ${EE} --host %h -bynode -bind-to-core --cpus-per-rank %t -np %N %b"          env['launcher'] = "mpirun ${AGENTOVERRIDE} --gmca mpi_warn_on_fork 0 ${EE} --host %h --cpus-per-rank %t -np %N %b"
384            #newer OpenMPI version:
385            #env['launcher'] = "mpirun ${AGENTOVERRIDE} --gmca mpi_warn_on_fork 0 ${EE} --host %h --map-by node:pe=%t -bind-to core -np %N %b"
386      elif env['mpi'] == 'MPT':      elif env['mpi'] == 'MPT':
387          env['launcher'] = "mpirun %h -np %p %b"          env['launcher'] = "mpirun %h -np %p %b"
388      elif env['mpi'] == 'MPICH':      elif env['mpi'] == 'MPICH':
# Line 407  env['svn_revision']=global_revision Line 417  env['svn_revision']=global_revision
417  env['buildvars']['svn_revision']=global_revision  env['buildvars']['svn_revision']=global_revision
418  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])
419    
 if IS_WINDOWS:  
     if not env['build_shared']:  
         env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB'])  
         env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])  
   
420  env['IS_WINDOWS']=IS_WINDOWS  env['IS_WINDOWS']=IS_WINDOWS
421  env['IS_OSX']=IS_OSX  env['IS_OSX']=IS_OSX
422    
# Line 473  except KeyError: Line 478  except KeyError:
478    
479  ######################## Add some custom builders ############################  ######################## Add some custom builders ############################
480    
481    # Takes care of prefix and suffix for Python modules:
482    def build_python_module(env, target, source):
483        return env.SharedLibrary(target, source, SHLIBPREFIX='', SHLIBSUFFIX='.so')
484    env.AddMethod(build_python_module, "PythonModule")
485    
486  if env['pythoncmd']=='python':  if env['pythoncmd']=='python':
487      py_builder = Builder(action = build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)      py_builder = Builder(action = build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
488  else:  else:
# Line 502  env=checkPython(env) Line 512  env=checkPython(env)
512  ######## boost & boost-python (required)  ######## boost & boost-python (required)
513  env=checkBoost(env)  env=checkBoost(env)
514    
 ######## NVCC version (optional)  
 if env['cuda']:  
     env=checkCudaVersion(env)  
     env=checkCUDA(env)  
   
515  ######## numpy (required) and numpy headers (optional)  ######## numpy (required) and numpy headers (optional)
516  env=checkNumpy(env)  env=checkNumpy(env)
517    
518  ######## CppUnit (required for tests)  ######## CppUnit (required for tests)
519  env=checkCppUnit(env)  env=checkCppUnit(env)
520    
521    ######## NVCC version (optional)
522    if env['cuda'] and 'ripley' in env['domains']:
523        env=checkCudaVersion(env)
524        env=checkCUDA(env)
525    
526  ######## optional python modules (sympy, pyproj)  ######## optional python modules (sympy, pyproj)
527  env=checkOptionalModules(env)  env=checkOptionalModules(env)
528    
529  ######## optional dependencies (netCDF, PAPI, MKL, UMFPACK, Lapack, Silo, ...)  ######## optional dependencies (netCDF, PAPI, MKL, UMFPACK, Lapack, Silo, ...)
530  env=checkOptionalLibraries(env)  env=checkOptionalLibraries(env)
531    
 #use gmsh info to set some defines  
 if env['gmsh'] == 's':  
     env.Append(CPPDEFINES=['GMSH'])  
 elif env['gmsh'] == 'm':  
     env.Append(CPPDEFINES=['GMSH','GMSH_MPI'])  
   
532  ######## PDFLaTeX (for documentation)  ######## PDFLaTeX (for documentation)
533  env=checkPDFLatex(env)  env=checkPDFLatex(env)
534    
535    # dependency sanity checks
536    
537    if len(env['domains']) == 0:
538       env['warnings'].append("No domains have been built, escript will not be very useful!")
539    
540  # keep some of our install paths first in the list for the unit tests  # keep some of our install paths first in the list for the unit tests
541  env.PrependENVPath(LD_LIBRARY_PATH_KEY, env['libinstall'])  env.PrependENVPath(LD_LIBRARY_PATH_KEY, env['libinstall'])
542  env.PrependENVPath('PYTHONPATH', prefix)  env.PrependENVPath('PYTHONPATH', prefix)
# Line 545  if not env['verbose']: Line 554  if not env['verbose']:
554      env['PDFLATEXCOMSTR'] = "Building $TARGET from LaTeX input $SOURCES"      env['PDFLATEXCOMSTR'] = "Building $TARGET from LaTeX input $SOURCES"
555      #Progress(['Checking -\r', 'Checking \\\r', 'Checking |\r', 'Checking /\r'], interval=17)      #Progress(['Checking -\r', 'Checking \\\r', 'Checking |\r', 'Checking /\r'], interval=17)
556    
557  ####################### Configure the subdirectories #########################  ########################### Configure the targets ############################
558    
559  # remove obsolete files  from grouptest import GroupTest
 if not env['usempi']:  
     Execute(Delete(os.path.join(env['libinstall'], 'pythonMPI')))  
     Execute(Delete(os.path.join(env['bininstall'], 'escript-overlord')))  
     Execute(Delete(os.path.join(env['libinstall'], 'pythonMPIredirect')))  
   
 from grouptest import *  
560  TestGroups=[]  TestGroups=[]
561    
562  # keep an environment without warnings-as-errors  # keep an environment without warnings-as-errors
# Line 572  Export( Line 575  Export(
575    ]    ]
576  )  )
577    
 #do not auto build  
 env.SConscript(dirs = ['tools/escriptconvert'], variant_dir='$BUILD_DIR/$PLATFORM/tools/escriptconvert', duplicate=0)  
 env.SConscript(dirs = ['tools/overlord'], variant_dir='$BUILD_DIR/$PLATFORM/tools/overlord', duplicate=0)  
 env.SConscript(dirs = ['paso/src'], variant_dir='$BUILD_DIR/$PLATFORM/paso', duplicate=0)  
 env.SConscript(dirs = ['weipa/src'], variant_dir='$BUILD_DIR/$PLATFORM/weipa', duplicate=0)  
 env.SConscript(dirs = ['escript/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)  
   
 env.SConscript(dirs = ['cusplibrary'])  
   
 #This will pull in the escriptcore/py_src and escriptcore/test  
 env.SConscript(dirs = ['escriptcore/src'], variant_dir='$BUILD_DIR/$PLATFORM/escriptcore', duplicate=0)  
 env.SConscript(dirs = ['esysUtils/src'], variant_dir='$BUILD_DIR/$PLATFORM/esysUtils', duplicate=0)  
 if 'dudley' in env['domains']:  
     env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)  
 if 'finley' in env['domains']:  
     env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)  
 if 'ripley' in env['domains']:  
     env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)  
 if 'speckley' in env['domains']:  
     env.SConscript(dirs = ['speckley/src'], variant_dir='$BUILD_DIR/$PLATFORM/speckley', duplicate=0)  
 env.SConscript(dirs = ['downunder/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/downunder', duplicate=0)  
 env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)  
 env.SConscript(dirs = ['pycad/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pycad', duplicate=0)  
 env.SConscript(dirs = ['pythonMPI/src'], variant_dir='$BUILD_DIR/$PLATFORM/pythonMPI', duplicate=0)  
 env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)  
 env.SConscript(dirs = ['paso/profiling'], variant_dir='$BUILD_DIR/$PLATFORM/paso/profiling', duplicate=0)  
   
   
 ######################## Populate the buildvars file #########################  
   
 write_buildvars(env)  
   
 write_launcher(env)  
   
 ################### Targets to build and install libraries ###################  
   
578  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'))
579  env.Alias('target_init', [target_init])  env.Alias('target_init', [target_init])
 # delete buildvars upon cleanup  
 env.Clean('target_init', os.path.join(env['libinstall'], 'buildvars'))  
   
 # The headers have to be installed prior to build in order to satisfy  
 # #include <paso/Common.h>  
 env.Alias('build_esysUtils', ['install_esysUtils_headers', 'build_esysUtils_lib'])  
 env.Alias('install_esysUtils', ['build_esysUtils', 'install_esysUtils_lib'])  
580    
581  env.Alias('build_paso', ['install_paso_headers', 'build_paso_lib'])  build_all_list = []
582  env.Alias('install_paso', ['build_paso', 'install_paso_lib'])  install_all_list = ['target_init']
   
 env.Alias('build_escript', ['install_escript_headers', 'build_escript_lib', 'build_escriptcpp_lib'])  
 env.Alias('install_escript', ['build_escript', 'install_escript_lib', 'install_escriptcpp_lib', 'install_escriptcore_py', 'install_escript_py'])  
   
 if 'dudley' in env['domains']:  
     env.Alias('build_dudley', ['install_dudley_headers', 'build_dudley_lib', 'build_dudleycpp_lib'])  
     env.Alias('install_dudley', ['build_dudley', 'install_dudley_lib', 'install_dudleycpp_lib', 'install_dudley_py'])  
583    
584  if 'finley' in env['domains']:  # The order here is important as certain keys in env need to be defined for
585      env.Alias('build_finley', ['install_finley_headers', 'build_finley_lib', 'build_finleycpp_lib'])  # certain modules.
     env.Alias('install_finley', ['build_finley', 'install_finley_lib', 'install_finleycpp_lib', 'install_finley_py'])  
586    
587  if 'ripley' in env['domains']:  # escript can't be turned off
588      env.Alias('build_ripley', ['install_cusp_headers', 'install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])  env.SConscript('escriptcore/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/escriptcore', duplicate=0)
589      env.Alias('install_ripley', ['build_ripley', 'install_ripley_lib', 'install_ripleycpp_lib', 'install_ripley_py'])  env.SConscript('escript/py_src/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)
590    build_all_list += ['build_escript']
591    install_all_list += ['install_escript']
592    
593  if 'speckley' in env['domains']:  env.SConscript('pythonMPI/src/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/pythonMPI', duplicate=0)
594      env.Alias('build_speckley', ['install_speckley_headers', 'build_speckley_lib', 'build_speckleycpp_lib'])  env.SConscript('tools/overlord/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/tools/overlord', duplicate=0)
595      env.Alias('install_speckley', ['build_speckley', 'install_speckley_lib', 'install_speckleycpp_lib', 'install_speckley_py'])  if env['usempi']:
596        build_all_list += ['build_pythonMPI', 'build_overlord']
597        install_all_list += ['install_pythonMPI', 'install_overlord']
598    
599  env.Alias('build_weipa', ['install_weipa_headers', 'build_weipa_lib', 'build_weipacpp_lib'])  if env['paso']:
600  env.Alias('install_weipa', ['build_weipa', 'install_weipa_lib', 'install_weipacpp_lib', 'install_weipa_py'])      env.SConscript('paso/src/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/paso', duplicate=0)
601        build_all_list += ['build_paso']
602        install_all_list += ['install_paso']
603    
604    if env['trilinos']:
605        env.SConscript('trilinoswrap/src/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/trilinoswrap', duplicate=0)
606        build_all_list += ['build_trilinoswrap']
607        install_all_list += ['install_trilinoswrap']
608    
609    env.SConscript('cusplibrary/SConscript')
610    
611    for domain in env['domains']:
612        env.SConscript('%s/SConscript'%domain, variant_dir='$BUILD_DIR/$PLATFORM/%s'%domain, duplicate=0)
613        build_all_list += ['build_%s'%domain]
614        install_all_list += ['install_%s'%domain]
615    
616    if env['weipa']:
617        env.SConscript('weipa/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/weipa', duplicate=0)
618        build_all_list += ['build_weipa']
619        install_all_list += ['install_weipa']
620        if 'finley' in env['domains']:
621            build_all_list += ['build_escriptreader']
622            install_all_list += ['install_escriptreader']
623    
624  env.Alias('build_escriptreader', ['install_weipa_headers', 'build_escriptreader_lib'])  env.SConscript(dirs = ['downunder/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/downunder', duplicate=0)
625  env.Alias('install_escriptreader', ['build_escriptreader', 'install_escriptreader_lib'])  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)
626    env.SConscript(dirs = ['pycad/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pycad', duplicate=0)
627    env.SConscript('tools/escriptconvert/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/tools/escriptconvert', duplicate=0)
628    env.SConscript('doc/SConscript', variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)
629    
630  # Now gather all the above into some easy targets: build_all and install_all  env.Alias('build', build_all_list)
 build_all_list = []  
 build_all_list += ['build_esysUtils']  
 build_all_list += ['build_paso']  
 build_all_list += ['build_escript']  
 if 'dudley' in env['domains']: build_all_list += ['build_dudley']  
 if 'finley' in env['domains']: build_all_list += ['build_finley']  
 if 'ripley' in env['domains']: build_all_list += ['build_ripley']  
 if 'speckley' in env['domains']: build_all_list += ['build_speckley']  
 build_all_list += ['build_weipa']  
 if not IS_WINDOWS and 'finley' in env['domains']:  
     build_all_list += ['build_escriptreader']  
 if env['usempi']:  
     build_all_list += ['build_pythonMPI', 'build_overlord']  
 env.Alias('build_all', build_all_list)  
631    
 install_all_list = []  
 install_all_list += ['target_init']  
 install_all_list += ['install_esysUtils']  
 install_all_list += ['install_paso']  
 install_all_list += ['install_escript']  
 if 'dudley' in env['domains']: install_all_list += ['install_dudley']  
 if 'finley' in env['domains']: install_all_list += ['install_finley']  
 if 'ripley' in env['domains']: install_all_list += ['install_ripley']  
 if 'speckley' in env['domains']: install_all_list += ['install_speckley']  
 install_all_list += ['install_weipa']  
 if not IS_WINDOWS and 'finley' in env['domains']:  
     install_all_list += ['install_escriptreader']  
632  install_all_list += ['install_downunder_py']  install_all_list += ['install_downunder_py']
633  install_all_list += ['install_modellib_py']  install_all_list += ['install_modellib_py']
634  install_all_list += ['install_pycad_py']  install_all_list += ['install_pycad_py']
635  if env['usempi']:  install_all_list += [env.Install(Dir('scripts',env['build_dir']), os.path.join('scripts', 'release_sanity.py'))]
     install_all_list += ['install_pythonMPI', 'install_overlord']  
 install_all_list += ['install_weipa_py']      
 install_all_list += [env.Install(os.path.join(env['build_dir'],'scripts'), os.path.join('scripts', 'release_sanity.py'))]  
   
636    
637  if env['osx_dependency_fix']:  if env['osx_dependency_fix']:
638      print("Require dependency fix")      print("Require dependency fix")
639      install_all=env.Command('install_all',install_all_list,'scripts/moveall.sh')      install_all=env.Command('install', install_all_list, 'scripts/moveall.sh')
640  else:  else:
641      install_all=env.Alias('install_all', install_all_list)      install_all=env.Alias('install', install_all_list)
   
   
   
   
 # Default target is install  
 #env.Default('install_all')  
   
642    
643  sanity=env.Alias('sanity', env.Command('dummy','',os.path.join(env['prefix'], 'bin', 'run-escript')+' '+os.path.join(env['build_dir'],'scripts', 'release_sanity.py')))  sanity=env.Alias('sanity', env.Command('dummy','',os.path.join(env['prefix'], 'bin', 'run-escript')+' '+os.path.join(env['build_dir'],'scripts', 'release_sanity.py')))
644  env.Depends('dummy', install_all)  env.Depends('dummy', install_all)
645  if env['usempi']:  if env['usempi']:
646     #env.Requires('dummy', ['build_pythonMPI', 'install_pythonMPI'])     #env.Requires('dummy', ['build_pythonMPI', 'install_pythonMPI'])
647     #env.Requires('dummy', env['prefix']+"/lib/pythonMPI")     env.Depends('dummy', ['install_pythonMPI'])
648     env.Depends('dummy', ['build_pythonMPI', 'install_pythonMPI'])  
649     env.Depends('dummy', env['prefix']+"/lib/pythonMPI")    # if all domains are built:
650    if env['domains'] == all_domains:
 if 'install_dudley' in install_all_list and \  
    'install_finley' in install_all_list and \  
    'install_ripley' in install_all_list and \  
    'install_speckley' in install_all_list:  
651         env.AlwaysBuild('sanity')         env.AlwaysBuild('sanity')
652         env.Default('sanity')         env.Default('sanity')
653  else:  else:
654      env.Default('install_all')      env.Default('install')
655    
656  ################## Targets to build and run the test suite ###################  ################## Targets to build and run the test suite ###################
657    
# Line 719  if not env['cppunit']: Line 659  if not env['cppunit']:
659      test_msg = env.Command('.dummy.', None, '@echo "Cannot run C++ unit tests, CppUnit not found!";exit 1')      test_msg = env.Command('.dummy.', None, '@echo "Cannot run C++ unit tests, CppUnit not found!";exit 1')
660      env.Alias('run_tests', test_msg)      env.Alias('run_tests', test_msg)
661      env.Alias('build_tests', '')      env.Alias('build_tests', '')
662  env.Alias('run_tests', ['install_all'])  env.Alias('run_tests', ['install'])
663  env.Alias('all_tests', ['install_all', 'run_tests', 'py_tests'])  env.Alias('all_tests', ['install', 'run_tests', 'py_tests'])
664  env.Alias('build_full',['install_all','build_tests','build_py_tests'])  env.Alias('build_full',['install','build_tests','build_py_tests'])
665  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')  Requires('py_tests', 'install')
 Requires('py_tests', 'install_all')  
666    
667  ##################### Targets to build the documentation #####################  ##################### Targets to build the documentation #####################
668    
669  env.Alias('pdfdocs',['user_pdf', 'install_pdf', 'cookbook_pdf', 'inversion_pdf'])  env.Alias('pdfdocs',['user_pdf', 'install_pdf', 'cookbook_pdf', 'inversion_pdf'])
670  env.Alias('basedocs', ['pdfdocs','examples_tarfile', 'examples_zipfile', 'api_doxygen'])  env.Alias('basedocs', ['pdfdocs','examples_tarfile', 'examples_zipfile', 'api_doxygen'])
671  env.Alias('docs', ['basedocs', 'sphinxdoc'])  env.Alias('docs', ['basedocs', 'sphinxdoc'])
672  env.Alias('release_prep', ['docs', 'install_all'])  env.Alias('release_prep', ['docs', 'install'])
673  env.Alias('release_prep_old', ['basedocs', 'api_epydoc', 'install_all'])  env.Alias('release_prep_old', ['basedocs', 'api_epydoc', 'install'])
674    
675  # The test scripts are always generated, this target allows us to  # The test scripts are always generated, this target allows us to
676  # generate the testscripts without doing a full build  # generate the testscripts without doing a full build
# Line 740  env.Alias('testscripts',[]) Line 679  env.Alias('testscripts',[])
679  if not IS_WINDOWS:  if not IS_WINDOWS:
680      generateTestScripts(env, TestGroups)      generateTestScripts(env, TestGroups)
681    
682    ######################## Populate the buildvars file #########################
683    
684    write_buildvars(env)
685    # delete buildvars upon cleanup - target_init is default so use it
686    env.Clean('target_init', File('buildvars', env['libinstall']))
687    
688    write_launcher(env)
689    
690    # remove obsolete files
691    if not env['usempi']:
692        Execute(Delete(File(['pythonMPI','pythonMPIredirect'], env['libinstall'])))
693        Execute(Delete(File('escript-overlord', env['bininstall'])))
694    
695  ######################## Summarize our environment ###########################  ######################## Summarize our environment ###########################
696  def print_summary():  def print_summary():
697      print("")      print("")
698      print("*** Config Summary (see config.log and <prefix>/lib/buildvars for details) ***")      print("*** Config Summary (see config.log and <prefix>/lib/buildvars for details) ***")
699      print("Escript/Finley revision %s"%global_revision)      print("Escript revision %s"%global_revision)
700      print("  Install prefix:  %s"%env['prefix'])      print("  Install prefix:  %s"%env['prefix'])
701      print("          Python:  %s"%sysconfig.PREFIX)      print("          Python:  %s"%sysconfig.PREFIX)
702      print("           boost:  %s (Version %s)"%(env['boost_prefix'],env['boost_version']))      print("           boost:  %s (Version %s)"%(env['boost_prefix'],env['boost_version']))
# Line 771  def print_summary(): Line 722  def print_summary():
722          print("            CUDA:  NO")          print("            CUDA:  NO")
723      d_list=[]      d_list=[]
724      e_list=[]      e_list=[]
725      for i in 'debug','openmp','boomeramg','cppunit','gdal','mkl','netcdf','papi','pyproj','scipy','silo','sympy','umfpack','visit':      for i in 'debug','openmp','boomeramg','cppunit','gdal','mkl','netcdf','papi','pyproj','scipy','silo','sympy','trilinos','umfpack','visit':
726          if env[i]: e_list.append(i)          if env[i]: e_list.append(i)
727          else: d_list.append(i)          else: d_list.append(i)
728      for i in e_list:      for i in e_list:

Legend:
Removed from v.5939  
changed lines
  Added in v.6124

  ViewVC Help
Powered by ViewVC 1.1.26