/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3560 by gross, Mon Aug 29 01:10:42 2011 UTC revision 3851 by jfenwick, Wed Feb 29 05:23:30 2012 UTC
# Line 16  EnsurePythonVersion(2,5) Line 16  EnsurePythonVersion(2,5)
16  import sys, os, platform, re  import sys, os, platform, re
17  from distutils import sysconfig  from distutils import sysconfig
18  from site_init import *  from site_init import *
19    import subprocess
20    from subprocess import PIPE, Popen
21    
22  # 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
23  # added or existing options changed.  # added or existing options changed.
24  REQUIRED_OPTS_VERSION=200  REQUIRED_OPTS_VERSION=201
25    
26  # MS Windows support, many thanks to PH  # MS Windows support, many thanks to PH
27  IS_WINDOWS = (os.name == 'nt')  IS_WINDOWS = (os.name == 'nt')
# Line 47  if not os.path.isfile(options_file): Line 49  if not os.path.isfile(options_file):
49  ############################### Build options ################################  ############################### Build options ################################
50    
51  default_prefix='/usr'  default_prefix='/usr'
52  mpi_flavours=('none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI')  mpi_flavours=('no', 'none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI')
53  lapack_flavours=('none', 'clapack', 'mkl')  lapack_flavours=('none', 'clapack', 'mkl')
54    
55  vars = Variables(options_file, ARGUMENTS)  vars = Variables(options_file, ARGUMENTS)
# Line 73  vars.AddVariables( Line 75  vars.AddVariables(
75  # Mandatory libraries  # Mandatory libraries
76    ('boost_prefix', 'Prefix/Paths of boost installation', default_prefix),    ('boost_prefix', 'Prefix/Paths of boost installation', default_prefix),
77    ('boost_libs', 'Boost libraries to link with', ['boost_python-mt']),    ('boost_libs', 'Boost libraries to link with', ['boost_python-mt']),
78    # Mandatory for tests
79      ('cppunit_prefix', 'Prefix/Paths of CppUnit installation', default_prefix),
80      ('cppunit_libs', 'CppUnit libraries to link with', ['cppunit']),
81  # Optional libraries and options  # Optional libraries and options
82    EnumVariable('mpi', 'Compile parallel version using MPI flavour', 'none', allowed_values=mpi_flavours),    EnumVariable('mpi', 'Compile parallel version using MPI flavour', 'none', allowed_values=mpi_flavours),
83    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),    ('mpi_prefix', 'Prefix/Paths of MPI installation', default_prefix),
# Line 119  vars.AddVariables( Line 124  vars.AddVariables(
124    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')),
125    # finer control over library building, intel aggressive global optimisation    # finer control over library building, intel aggressive global optimisation
126    # works with dynamic libraries on windows.    # works with dynamic libraries on windows.
127    ('share_esysutils', 'Build a dynamic esysUtils library', False),    ('build_shared', 'Build dynamic libraries only', False),
   ('share_paso', 'Build a dynamic paso library', False),  
128    ('sys_libs', 'Extra libraries to link with', []),    ('sys_libs', 'Extra libraries to link with', []),
129    ('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)'),
130      ('SVN_VERSION', 'Do not use from options file', -2),
131      ('pythoncmd', 'which python to compile with','python'),
132  )  )
133    
134  ##################### Create environment and help text #######################  ##################### Create environment and help text #######################
# Line 206  if cc_name == 'icc': Line 212  if cc_name == 'icc':
212      cc_optim    = "-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -ip"      cc_optim    = "-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -ip"
213      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
214      omp_flags   = "-openmp -openmp_report0"      omp_flags   = "-openmp -openmp_report0"
215      omp_ldflags = "-openmp -openmp_report0 -lguide -lpthread"      omp_ldflags = "-openmp -openmp_report0 -lpthread"
216      fatalwarning = "-Werror"      fatalwarning = "-Werror"
217  elif cc_name[:3] == 'gcc':  elif cc_name[:3] == 'gcc':
218      # GNU C on any system      # GNU C on any system
# Line 281  env.Append(CCFLAGS = env['cc_flags']) Line 287  env.Append(CCFLAGS = env['cc_flags'])
287  # add system libraries  # add system libraries
288  env.AppendUnique(LIBS = env['sys_libs'])  env.AppendUnique(LIBS = env['sys_libs'])
289    
290  # Get the global Subversion revision number for the getVersion() method  
291  try:  global_revision=ARGUMENTS.get('SVN_VERSION', None)
292    if global_revision:
293        global_revision = re.sub(':.*', '', global_revision)
294        global_revision = re.sub('[^0-9]', '', global_revision)
295        if global_revision == '': global_revision='-2'
296    else:
297      # Get the global Subversion revision number for the getVersion() method
298      try:
299      global_revision = os.popen('svnversion -n .').read()      global_revision = os.popen('svnversion -n .').read()
300      global_revision = re.sub(':.*', '', global_revision)      global_revision = re.sub(':.*', '', global_revision)
301      global_revision = re.sub('[^0-9]', '', global_revision)      global_revision = re.sub('[^0-9]', '', global_revision)
302      if global_revision == '': global_revision='-2'      if global_revision == '': global_revision='-2'
303  except:    except:
304      global_revision = '-1'      global_revision = '-1'
305  env['svn_revision']=global_revision  env['svn_revision']=global_revision
306  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])  env.Append(CPPDEFINES=['SVN_VERSION='+global_revision])
307    
308  if IS_WINDOWS:  if IS_WINDOWS:
309      if not env['share_esysutils']:      if not env['build_shared']:
310          env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB'])          env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB'])
     if not env['share_paso']:  
311          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])          env.Append(CPPDEFINES = ['PASO_STATIC_LIB'])
312    
313  ###################### Copy required environment vars ########################  ###################### Copy required environment vars ########################
# Line 343  except KeyError: Line 355  except KeyError:
355    
356  ######################## Add some custom builders ############################  ######################## Add some custom builders ############################
357    
358  py_builder = Builder(action = build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)  if env['pythoncmd']=='python':
359        py_builder = Builder(action = build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
360    else:
361        py_builder = Builder(action = "scripts/testcomp.py $SOURCE $TARGET", suffix = '.pyc', src_suffix = '.py', single_source=True)
362  env.Append(BUILDERS = {'PyCompile' : py_builder});  env.Append(BUILDERS = {'PyCompile' : py_builder});
363    
364  runUnitTest_builder = Builder(action = runUnitTest, suffix = '.passed', src_suffix=env['PROGSUFFIX'], single_source=True)  runUnitTest_builder = Builder(action = runUnitTest, suffix = '.passed', src_suffix=env['PROGSUFFIX'], single_source=True)
# Line 395  if IS_WINDOWS: Line 410  if IS_WINDOWS:
410  else:  else:
411      python_libs=['python'+sysconfig.get_python_version()]      python_libs=['python'+sysconfig.get_python_version()]
412    
413    #if we want to use a python other than the one scons is running
414    if env['pythoncmd']!='python':
415       py3scons=False   # Is scons running on python3?
416       initstring='from __future__ import print_function;from distutils import sysconfig;'
417       if IS_WINDOWS:
418          cmd='print("python%s%s"%(sys.version_info[0], sys.version_info[1]))'
419       else:
420          cmd='print("python"+sysconfig.get_python_version())'
421       p=Popen([env['pythoncmd'], '-c', initstring+cmd], stdout=PIPE)
422       python_libs=p.stdout.readline()
423       if type(python_libs)!=str():
424          py3scons=True
425          python_libs=python_libs.encode()
426       p.wait()
427       python_libs=python_libs.strip()
428       # Now we know whether we are using python3 or not
429       p=Popen([env['pythoncmd'], '-c',  initstring+'print(sysconfig.get_python_inc())'], stdout=PIPE)
430       python_inc_path=p.stdout.readline()
431       if py3scons:
432             python_inc_path=python_inc_path.encode()
433       p.wait()  
434       python_inc_path=python_inc_path.strip()
435       if IS_WINDOWS:
436            cmd="os.path.join(sysconfig.get_config_var('prefix'), 'libs')"
437       elif env['PLATFORM']=='darwin':
438            cmd="sysconfig.get_config_var(\"LIBPL\")"
439       else:
440            cmd="sysconfig.get_config_var(\"LIBDIR\")"
441    
442       p=Popen([env['pythoncmd'], '-c', initstring+'print('+cmd+')'], stdout=PIPE)
443       python_lib_path=p.stdout.readline()
444       if py3scons:
445          python_lib_path=python_lib_path.decode()
446       p.wait()
447       python_lib_path=python_lib_path.strip()
448    
449    
450    
451    
452  if sysheaderopt == '':  if sysheaderopt == '':
453      conf.env.AppendUnique(CPPPATH = [python_inc_path])      conf.env.AppendUnique(CPPPATH = [python_inc_path])
454  else:  else:
# Line 412  if not conf.CheckFunc('Py_Exit'): Line 466  if not conf.CheckFunc('Py_Exit'):
466      print("Cannot find python library method Py_Main (tried %s in directory %s)" % (python_libs, python_lib_path))      print("Cannot find python library method Py_Main (tried %s in directory %s)" % (python_libs, python_lib_path))
467      Exit(1)      Exit(1)
468    
469    # reuse conf to check for numpy header (optional)
470    if conf.CheckCXXHeader(['Python.h','numpy/ndarrayobject.h']):
471        conf.env.Append(CPPDEFINES = ['HAVE_NUMPY_H'])
472        conf.env['numpy_h']=True
473    else:
474        conf.env['numpy_h']=False
475    
476  # Commit changes to environment  # Commit changes to environment
477  env = conf.Finish()  env = conf.Finish()
478    
# Line 434  env.PrependENVPath(LD_LIBRARY_PATH_KEY, Line 495  env.PrependENVPath(LD_LIBRARY_PATH_KEY,
495    
496  ######## numpy (required)  ######## numpy (required)
497    
498    if env['pythoncmd']=='python':
499        try:
500          from numpy import identity
501        except ImportError:
502          print("Cannot import numpy, you need to set your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)
503          Exit(1)
504    else:
505        p=subprocess.call([env['pythoncmd'],'-c','import numpy'])
506        if p!=0:
507          print("Cannot import numpy, you need to set your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)
508          Exit(1)
509    
510    ######## CppUnit (required for tests)
511    
512  try:  try:
513      from numpy import identity      cppunit_inc_path,cppunit_lib_path=findLibWithHeader(env, env['cppunit_libs'], 'cppunit/TestFixture.h', env['cppunit_prefix'], lang='c++')
514  except ImportError:      env.AppendUnique(CPPPATH = [cppunit_inc_path])
515      print("Cannot import numpy, you need to set your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)      env.AppendUnique(LIBPATH = [cppunit_lib_path])
516      Exit(1)      env.PrependENVPath(LD_LIBRARY_PATH_KEY, cppunit_lib_path)
517        env['cppunit']=True
518    except:
519        env['cppunit']=False
520    
521  ######## VTK (optional)  ######## VTK (optional)
522    
# Line 545  if env['visit']: Line 623  if env['visit']:
623    
624  ######## MPI (optional)  ######## MPI (optional)
625    
626    if env['mpi']=='no':
627        env['mpi']='none'
628    
629  env['usempi'] = env['mpi']!='none'  env['usempi'] = env['mpi']!='none'
630  mpi_inc_path=''  mpi_inc_path=''
631  mpi_lib_path=''  mpi_lib_path=''
# Line 563  if env['usempi']: Line 644  if env['usempi']:
644    
645  ######## BOOMERAMG (optional)  ######## BOOMERAMG (optional)
646    
 #if env['boomeramg'] and env['mpi'] == 'none':  
 #    print("boomeramg requires mpi!")  
 #    Exit(1)  
647  if env['mpi'] == 'none': env['boomeramg'] = False  if env['mpi'] == 'none': env['boomeramg'] = False
648    
649  boomeramg_inc_path=''  boomeramg_inc_path=''
# Line 574  if env['boomeramg']: Line 652  if env['boomeramg']:
652      boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c')      boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c')
653      env.AppendUnique(CPPPATH = [boomeramg_inc_path])      env.AppendUnique(CPPPATH = [boomeramg_inc_path])
654      env.AppendUnique(LIBPATH = [boomeramg_lib_path])      env.AppendUnique(LIBPATH = [boomeramg_lib_path])
     # Note that we do not add the libs since they are only needed for the  
     # weipa library and tools.  
655      env.AppendUnique(LIBS = env['boomeramg_libs'])      env.AppendUnique(LIBS = env['boomeramg_libs'])
656      env.PrependENVPath(LD_LIBRARY_PATH_KEY, boomeramg_lib_path)      env.PrependENVPath(LD_LIBRARY_PATH_KEY, boomeramg_lib_path)
657      env.Append(CPPDEFINES = ['BOOMERAMG'])      env.Append(CPPDEFINES = ['BOOMERAMG'])
# Line 598  if env['parmetis']: Line 674  if env['parmetis']:
674    
675  try:  try:
676      import subprocess      import subprocess
677      p=subprocess.Popen(['gmsh', '-version'], stderr=subprocess.PIPE)      p=subprocess.Popen(['gmsh', '-info'], stderr=subprocess.PIPE)
678      p.poll()      _,e=p.communicate()
679      env['gmsh']=True      if e.split().count("MPI"):
680            env['gmsh']='m'
681        else:
682            env['gmsh']='s'
683  except OSError:  except OSError:
684      env['gmsh']=False      env['gmsh']=False
685    
686    ######## PDFLaTeX (for documentation)
687    if 'PDF' in dir(env) and '.tex' in env.PDF.builder.src_suffixes(env):
688        env['pdflatex']=True
689    else:
690        env['pdflatex']=False
691    
692  ######################## Summarize our environment ###########################  ######################## Summarize our environment ###########################
693    
694  # 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
# Line 642  else: Line 727  else:
727      print("          LAPACK:  DISABLED")      print("          LAPACK:  DISABLED")
728  d_list=[]  d_list=[]
729  e_list=[]  e_list=[]
730  for i in 'debug','openmp','netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit':  for i in 'debug','openmp','netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit','vsl_random':
731      if env[i]: e_list.append(i)      if env[i]: e_list.append(i)
732      else: d_list.append(i)      else: d_list.append(i)
733  for i in e_list:  for i in e_list:
734      print("%16s:  YES"%i)      print("%16s:  YES"%i)
735  for i in d_list:  for i in d_list:
736      print("%16s:  DISABLED"%i)      print("%16s:  DISABLED"%i)
737  if env['gmsh']:  if env['cppunit']:
738        print("         CppUnit:  FOUND")
739    else:
740        print("         CppUnit:  NOT FOUND")
741    if env['gmsh']=='m':
742        print("            gmsh:  FOUND, MPI-ENABLED")
743    elif env['gmsh']=='s':
744      print("            gmsh:  FOUND")      print("            gmsh:  FOUND")
745  else:  else:
746      print("            gmsh:  NOT FOUND")      print("            gmsh:  NOT FOUND")
747  print("      vsl_random:  %s"%env['vsl_random'])  if env['numpy_h']:
748        print("   numpy headers:  FOUND")
749    else:
750        print("   numpy headers:  NOT FOUND")
751    print("   vsl_random:  %s"%env['vsl_random'])
752            
753  if ((fatalwarning != '') and (env['werror'])):  if ((fatalwarning != '') and (env['werror'])):
754      print("  Treating warnings as errors")      print("  Treating warnings as errors")
# Line 683  Export( Line 778  Export(
778    ]    ]
779  )  )
780    
 env.SConscript(dirs = ['tools/CppUnitTest/src'], variant_dir='$BUILD_DIR/$PLATFORM/tools/CppUnitTest', duplicate=0)  
781  env.SConscript(dirs = ['tools/escriptconvert'], variant_dir='$BUILD_DIR/$PLATFORM/tools/escriptconvert', duplicate=0)  env.SConscript(dirs = ['tools/escriptconvert'], variant_dir='$BUILD_DIR/$PLATFORM/tools/escriptconvert', duplicate=0)
782  env.SConscript(dirs = ['paso/src'], variant_dir='$BUILD_DIR/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], variant_dir='$BUILD_DIR/$PLATFORM/paso', duplicate=0)
783  env.SConscript(dirs = ['weipa/src'], variant_dir='$BUILD_DIR/$PLATFORM/weipa', duplicate=0)  env.SConscript(dirs = ['weipa/src'], variant_dir='$BUILD_DIR/$PLATFORM/weipa', duplicate=0)
784  env.SConscript(dirs = ['escript/src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/src'], variant_dir='$BUILD_DIR/$PLATFORM/escript', duplicate=0)
785  env.SConscript(dirs = ['esysUtils/src'], variant_dir='$BUILD_DIR/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], variant_dir='$BUILD_DIR/$PLATFORM/esysUtils', duplicate=0)
786    env.SConscript(dirs = ['pasowrap/src'], variant_dir='$BUILD_DIR/$PLATFORM/pasowrap', duplicate=0)
787  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)  env.SConscript(dirs = ['dudley/src'], variant_dir='$BUILD_DIR/$PLATFORM/dudley', duplicate=0)
788  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], variant_dir='$BUILD_DIR/$PLATFORM/finley', duplicate=0)
789    env.SConscript(dirs = ['ripley/src'], variant_dir='$BUILD_DIR/$PLATFORM/ripley', duplicate=0)
790  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)  env.SConscript(dirs = ['modellib/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/modellib', duplicate=0)
791  env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], variant_dir='$BUILD_DIR/$PLATFORM/doc', duplicate=0)
792  env.SConscript(dirs = ['pyvisi/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pyvisi', duplicate=0)  env.SConscript(dirs = ['pyvisi/py_src'], variant_dir='$BUILD_DIR/$PLATFORM/pyvisi', duplicate=0)
# Line 722  buildvars.write("svn_revision="+str(glob Line 818  buildvars.write("svn_revision="+str(glob
818  buildvars.write("prefix="+prefix+"\n")  buildvars.write("prefix="+prefix+"\n")
819  buildvars.write("cc="+env['CC']+"\n")  buildvars.write("cc="+env['CC']+"\n")
820  buildvars.write("cxx="+env['CXX']+"\n")  buildvars.write("cxx="+env['CXX']+"\n")
821  buildvars.write("python="+sys.executable+"\n")  if env['pythoncmd']=='python':
822  buildvars.write("python_version="+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])+"\n")      buildvars.write("python="+sys.executable+"\n")
823        buildvars.write("python_version="+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])+"\n")
824    else:
825        buildvars.write("python="+env['pythoncmd']+"\n")
826        p=Popen([env['pythoncmd'], '-c', 'from __future__import print_function;import sys;print(str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])'], stdout=PIPE)
827        verstring=p.stdout.readline().strip()
828        p.wait()
829        buildvars.write("python version="+verstring+"\n")
830  buildvars.write("boost_inc_path="+boost_inc_path+"\n")  buildvars.write("boost_inc_path="+boost_inc_path+"\n")
831  buildvars.write("boost_lib_path="+boost_lib_path+"\n")  buildvars.write("boost_lib_path="+boost_lib_path+"\n")
832  buildvars.write("boost_version="+boostversion+"\n")  buildvars.write("boost_version="+boostversion+"\n")
# Line 744  buildvars.close() Line 847  buildvars.close()
847    
848  ################### Targets to build and install libraries ###################  ################### Targets to build and install libraries ###################
849    
850  target_init = env.Command(env['pyinstall']+'/__init__.py', None, Touch('$TARGET'))  target_init = env.Command(os.path.join(env['pyinstall'],'__init__.py'), None, Touch('$TARGET'))
851  env.Alias('target_init', [target_init])  env.Alias('target_init', [target_init])
852    # delete buildvars upon cleanup
853    env.Clean('target_init', os.path.join(env['libinstall'], 'buildvars'))
854    
855  # The headers have to be installed prior to build in order to satisfy  # The headers have to be installed prior to build in order to satisfy
856  # #include <paso/Common.h>  # #include <paso/Common.h>
# Line 758  env.Alias('install_paso', ['build_paso', Line 863  env.Alias('install_paso', ['build_paso',
863  env.Alias('build_escript', ['install_escript_headers', 'build_escript_lib', 'build_escriptcpp_lib'])  env.Alias('build_escript', ['install_escript_headers', 'build_escript_lib', 'build_escriptcpp_lib'])
864  env.Alias('install_escript', ['build_escript', 'install_escript_lib', 'install_escriptcpp_lib', 'install_escript_py'])  env.Alias('install_escript', ['build_escript', 'install_escript_lib', 'install_escriptcpp_lib', 'install_escript_py'])
865    
866    env.Alias('build_pasowrap', ['install_pasowrap_headers', 'build_pasowrap_lib', 'build_pasowrapcpp_lib'])
867    env.Alias('install_pasowrap', ['build_pasowrap', 'install_pasowrap_lib', 'install_pasowrapcpp_lib', 'install_pasowrap_py'])
868    
869    
870  env.Alias('build_dudley', ['install_dudley_headers', 'build_dudley_lib', 'build_dudleycpp_lib'])  env.Alias('build_dudley', ['install_dudley_headers', 'build_dudley_lib', 'build_dudleycpp_lib'])
871  env.Alias('install_dudley', ['build_dudley', 'install_dudley_lib', 'install_dudleycpp_lib', 'install_dudley_py'])  env.Alias('install_dudley', ['build_dudley', 'install_dudley_lib', 'install_dudleycpp_lib', 'install_dudley_py'])
872    
873  env.Alias('build_finley', ['install_finley_headers', 'build_finley_lib', 'build_finleycpp_lib'])  env.Alias('build_finley', ['install_finley_headers', 'build_finley_lib', 'build_finleycpp_lib'])
874  env.Alias('install_finley', ['build_finley', 'install_finley_lib', 'install_finleycpp_lib', 'install_finley_py'])  env.Alias('install_finley', ['build_finley', 'install_finley_lib', 'install_finleycpp_lib', 'install_finley_py'])
875    
876    env.Alias('build_ripley', ['install_ripley_headers', 'build_ripley_lib', 'build_ripleycpp_lib'])
877    env.Alias('install_ripley', ['build_ripley', 'install_ripley_lib', 'install_ripleycpp_lib', 'install_ripley_py'])
878    
879  env.Alias('build_weipa', ['install_weipa_headers', 'build_weipa_lib', 'build_weipacpp_lib'])  env.Alias('build_weipa', ['install_weipa_headers', 'build_weipa_lib', 'build_weipacpp_lib'])
880  env.Alias('install_weipa', ['build_weipa', 'install_weipa_lib', 'install_weipacpp_lib', 'install_weipa_py'])  env.Alias('install_weipa', ['build_weipa', 'install_weipa_lib', 'install_weipacpp_lib', 'install_weipa_py'])
881    
# Line 775  build_all_list = [] Line 887  build_all_list = []
887  build_all_list += ['build_esysUtils']  build_all_list += ['build_esysUtils']
888  build_all_list += ['build_paso']  build_all_list += ['build_paso']
889  build_all_list += ['build_escript']  build_all_list += ['build_escript']
890    build_all_list += ['build_pasowrap']
891  build_all_list += ['build_dudley']  build_all_list += ['build_dudley']
892  build_all_list += ['build_finley']  build_all_list += ['build_finley']
893    build_all_list += ['build_ripley']
894  build_all_list += ['build_weipa']  build_all_list += ['build_weipa']
895  if not IS_WINDOWS: build_all_list += ['build_escriptreader']  if not IS_WINDOWS: build_all_list += ['build_escriptreader']
896  if env['usempi']:   build_all_list += ['build_pythonMPI']  if env['usempi']:   build_all_list += ['build_pythonMPI']
# Line 788  install_all_list += ['target_init'] Line 902  install_all_list += ['target_init']
902  install_all_list += ['install_esysUtils']  install_all_list += ['install_esysUtils']
903  install_all_list += ['install_paso']  install_all_list += ['install_paso']
904  install_all_list += ['install_escript']  install_all_list += ['install_escript']
905    install_all_list += ['install_pasowrap']
906  install_all_list += ['install_dudley']  install_all_list += ['install_dudley']
907  install_all_list += ['install_finley']  install_all_list += ['install_finley']
908    install_all_list += ['install_ripley']
909  install_all_list += ['install_weipa']  install_all_list += ['install_weipa']
910  if not IS_WINDOWS: install_all_list += ['install_escriptreader']  if not IS_WINDOWS: install_all_list += ['install_escriptreader']
911  install_all_list += ['install_pyvisi_py']  #install_all_list += ['install_pyvisi_py']
912  install_all_list += ['install_modellib_py']  install_all_list += ['install_modellib_py']
913  install_all_list += ['install_pycad_py']  install_all_list += ['install_pycad_py']
914  if env['usempi']:   install_all_list += ['install_pythonMPI']  if env['usempi']:   install_all_list += ['install_pythonMPI']
# Line 804  env.Default('install_all') Line 920  env.Default('install_all')
920    
921  ################## Targets to build and run the test suite ###################  ################## Targets to build and run the test suite ###################
922    
923  env.Alias('build_cppunittest', ['install_cppunittest_headers', 'build_cppunittest_lib'])  test_msg = env.Command('.dummy.', None, '@echo "Cannot run C/C++ unit tests, CppUnit not found!";exit 1')
924  env.Alias('install_cppunittest', ['build_cppunittest', 'install_cppunittest_lib'])  if not env['cppunit']:
925  env.Alias('run_tests', ['install_all', 'install_cppunittest_lib'])      env.Alias('run_tests', test_msg)
926  env.Alias('all_tests', ['install_all', 'install_cppunittest_lib', 'run_tests', 'py_tests'])  env.Alias('run_tests', ['install_all'])
927    env.Alias('all_tests', ['install_all', 'run_tests', 'py_tests'])
928  env.Alias('build_full',['install_all','build_tests','build_py_tests'])  env.Alias('build_full',['install_all','build_tests','build_py_tests'])
929  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')  env.Alias('build_PasoTests','$BUILD_DIR/$PLATFORM/paso/profiling/PasoTests')
930    
# Line 820  env.Alias('release_prep', ['docs', 'inst Line 937  env.Alias('release_prep', ['docs', 'inst
937  if not IS_WINDOWS:  if not IS_WINDOWS:
938      try:      try:
939          utest=open('utest.sh','w')          utest=open('utest.sh','w')
940          utest.write(GroupTest.makeHeader(env['PLATFORM']))          utest.write(GroupTest.makeHeader(env['PLATFORM'], prefix))
941          for tests in TestGroups:          for tests in TestGroups:
942              utest.write(tests.makeString())              utest.write(tests.makeString())
943          utest.close()          utest.close()
944          Execute(Chmod('utest.sh', 0755))          Execute(Chmod('utest.sh', 0o755))
945          print("Generated utest.sh.")          print("Generated utest.sh.")
946      except IOError:      except IOError:
947          print("Error attempting to write unittests file.")          print("Error attempting to write unittests file.")
948          Exit(1)          Exit(1)
949    
950        # delete utest.sh upon cleanup
951        env.Clean('target_init', 'utest.sh')
952    
953      # Make sure that the escript wrapper is in place      # Make sure that the escript wrapper is in place
954      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):
955          print("Copying escript wrapper.")          print("Copying escript wrapper.")

Legend:
Removed from v.3560  
changed lines
  Added in v.3851

  ViewVC Help
Powered by ViewVC 1.1.26