/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3975 by caltinay, Thu Sep 20 01:54:06 2012 UTC revision 4244 by jfenwick, Mon Feb 25 05:37:50 2013 UTC
# Line 1  Line 1 
1  ########################################################  ##############################################################################
2  #  #
3  # Copyright (c) 2003-2012 by University of Queensland  # Copyright (c) 2003-2013 by University of Queensland
4  # Earth Systems Science Computational Center (ESSCC)  # http://www.uq.edu.au
 # http://www.uq.edu.au/esscc  
5  #  #
6  # Primary Business: Queensland, Australia  # Primary Business: Queensland, Australia
7  # Licensed under the Open Software License version 3.0  # Licensed under the Open Software License version 3.0
8  # http://www.opensource.org/licenses/osl-3.0.php  # http://www.opensource.org/licenses/osl-3.0.php
9  #  #
10  ########################################################  # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11    # Development since 2012 by School of Earth Sciences
12    #
13    ##############################################################################
14    
15  EnsureSConsVersion(0,98,1)  EnsureSConsVersion(0,98,1)
16  EnsurePythonVersion(2,5)  EnsurePythonVersion(2,5)
# Line 183  if len(vars.UnknownVariables())>0: Line 185  if len(vars.UnknownVariables())>0:
185    
186  #################### Make sure install directories exist #####################  #################### Make sure install directories exist #####################
187    
188  env['BUILD_DIR']=env['build_dir']  env['BUILD_DIR']=Dir(env['build_dir']).abspath
189  prefix=Dir(env['prefix']).abspath  prefix=Dir(env['prefix']).abspath
190  env['incinstall'] = os.path.join(prefix, 'include')  env['incinstall'] = os.path.join(prefix, 'include')
191  env['bininstall'] = os.path.join(prefix, 'bin')  env['bininstall'] = os.path.join(prefix, 'bin')
# Line 223  cc_name=os.path.basename(env['CC']) Line 225  cc_name=os.path.basename(env['CC'])
225    
226  if cc_name == 'icc':  if cc_name == 'icc':
227      # Intel compiler      # Intel compiler
228      cc_flags    = "-std=c99 -fPIC -wd161 -w1 -vec-report0 -DBLOCKTIMER -DCORE_ID1"      # #1875: offsetof applied to non-POD types is nonstandard (in boost)
229      cc_optim    = "-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -ip"      cc_flags    = "-std=c99 -fPIC -w2 -wd1875 -Wno-unknown-pragmas -DBLOCKTIMER -DCORE_ID1"
230        cc_optim    = "-O3 -ftz -fno-alias -ipo -xHost"
231      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug    = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
232      omp_flags   = "-openmp -openmp_report0"      omp_flags   = "-openmp"
233      omp_ldflags = "-openmp -openmp_report0 -lpthread"      omp_ldflags = "-openmp -openmp_report=1"
234      fatalwarning = "-Werror"      fatalwarning = "-Werror"
235  elif cc_name[:3] == 'gcc':  elif cc_name[:3] == 'gcc':
236      # GNU C on any system      # GNU C on any system
237      cc_flags     = "-pedantic -Wall -fPIC -ffast-math -Wno-unknown-pragmas -DBLOCKTIMER  -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing -finline-functions"      # note that -ffast-math is not used because it breaks isnan(),
238        # see mantis #691
239        cc_flags     = "-pedantic -Wall -fPIC -Wno-unknown-pragmas -DBLOCKTIMER  -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing -finline-functions"
240      cc_optim     = "-O3"      cc_optim     = "-O3"
241      cc_debug     = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"      cc_debug     = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
242      omp_flags    = "-fopenmp"      omp_flags    = "-fopenmp"
# Line 348  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N Line 353  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N
353          env['ENV'][key] = 1          env['ENV'][key] = 1
354    
355  env_export=env['env_export']  env_export=env['env_export']
356  env_export.extend(['ESCRIPT_NUM_THREADS','ESCRIPT_HOSTFILE','DISPLAY','XAUTHORITY','PATH','HOME','TMPDIR','TEMP','TMP'])  env_export.extend(['ESCRIPT_NUM_THREADS','ESCRIPT_HOSTFILE','DISPLAY','XAUTHORITY','PATH','HOME','KMP_MONITOR_STACKSIZE','TMPDIR','TEMP','TMP'])
357    
358  for key in set(env_export):  for key in set(env_export):
359      try:      try:
# Line 560  else: Line 565  else:
565      print("Cannot import sympy. Symbolic toolbox and nonlinear PDEs will not be available.")      print("Cannot import sympy. Symbolic toolbox and nonlinear PDEs will not be available.")
566      env['sympy'] = False      env['sympy'] = False
567    
568    ######## pyproj (optional)
569    
570    if detectModule(env, 'pyproj'):
571        env['pyproj'] = True
572    else:
573        print("Cannot import pyproj. Inversions may not work.")
574        env['pyproj'] = False
575    
576  ######## netCDF (optional)  ######## netCDF (optional)
577    
578  netcdf_inc_path=''  netcdf_inc_path=''
# Line 758  else: Line 771  else:
771      print("          LAPACK:  DISABLED")      print("          LAPACK:  DISABLED")
772  d_list=[]  d_list=[]
773  e_list=[]  e_list=[]
774  for i in 'debug','openmp','boomeramg','mkl','netcdf','papi','parmetis','silo','sympy','umfpack','visit','vsl_random':  for i in 'debug','openmp','boomeramg','mkl','netcdf','papi','parmetis','pyproj','silo','sympy','umfpack','visit','vsl_random':
775      if env[i]: e_list.append(i)      if env[i]: e_list.append(i)
776      else: d_list.append(i)      else: d_list.append(i)
777  for i in e_list:  for i in e_list:
# Line 961  env.Alias('build_PasoTests','$BUILD_DIR/ Line 974  env.Alias('build_PasoTests','$BUILD_DIR/
974    
975  ##################### Targets to build the documentation #####################  ##################### Targets to build the documentation #####################
976    
977  env.Alias('api_epydoc','install_all')  env.Alias('pdfdocs',['user_pdf', 'install_pdf', 'cookbook_pdf', 'inversion_pdf'])
978  env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'user_pdf', 'install_pdf', 'cookbook_pdf'])  env.Alias('basedocs', ['pdfdocs','examples_tarfile', 'examples_zipfile', 'api_doxygen'])
979    env.Alias('docs', ['basedocs', 'sphinxdoc'])
980  env.Alias('release_prep', ['docs', 'install_all'])  env.Alias('release_prep', ['docs', 'install_all'])
981    env.Alias('release_prep_old', ['basedocs', 'api_epydoc', 'install_all'])
982    
983    
984    # The test scripts are always generated, this target allows us to
985    # generate the testscripts without doing a full build
986    env.Alias('testscripts',[])
987    
988  if not IS_WINDOWS:  if not IS_WINDOWS:
989      try:      try:
990          utest=open('utest.sh','w')          utest=open('utest.sh','w')
991          utest.write(GroupTest.makeHeader(env['PLATFORM'], prefix))          utest.write(GroupTest.makeHeader(env['PLATFORM'], prefix, False))
992          for tests in TestGroups:          for tests in TestGroups:
993              utest.write(tests.makeString())              utest.write(tests.makeString())
994          utest.close()          utest.close()
995          Execute(Chmod('utest.sh', 0o755))          Execute(Chmod('utest.sh', 0o755))
996          print("Generated utest.sh.")          print("Generated utest.sh.")
997            # This version contains only python tests - I want this to be usable
998            # From a binary only install if you have the test files
999            utest=open('itest.sh','w')
1000            utest.write(GroupTest.makeHeader(env['PLATFORM'], prefix, True))
1001            for tests in TestGroups:
1002              if tests.exec_cmd=='$PYTHONRUNNER ':
1003                utest.write(tests.makeString())
1004            utest.close()
1005            Execute(Chmod('itest.sh', 0o755))
1006            print("Generated itest.sh.")        
1007      except IOError:      except IOError:
1008          print("Error attempting to write unittests file.")          print("Error attempting to write unittests file.")
1009          Exit(1)          Exit(1)
1010    
1011      # delete utest.sh upon cleanup      # delete utest.sh upon cleanup
1012      env.Clean('target_init', 'utest.sh')      env.Clean('target_init', 'utest.sh')
1013        env.Clean('target_init', 'itest.sh')
1014    
1015      # Make sure that the escript wrapper is in place      # Make sure that the escript wrapper is in place
1016      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):      if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')):

Legend:
Removed from v.3975  
changed lines
  Added in v.4244

  ViewVC Help
Powered by ViewVC 1.1.26