/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2296 by jfenwick, Thu Mar 5 05:47:34 2009 UTC revision 2302 by jfenwick, Thu Mar 12 04:40:03 2009 UTC
# Line 15  Line 15 
15  EnsureSConsVersion(0,96,91)  EnsureSConsVersion(0,96,91)
16  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
17    
18  import sys, os, re, socket, platform  import sys, os, re, socket, platform, stat
19    
20  # Add our extensions  # Add our extensions
21  if os.path.isdir('scons'): sys.path.append('scons')  if os.path.isdir('scons'): sys.path.append('scons')
# Line 189  elif env["CC"] == "gcc": Line 189  elif env["CC"] == "gcc":
189  #the long long warning occurs on the Mac  #the long long warning occurs on the Mac
190    cc_optim      = "-O3"    cc_optim      = "-O3"
191    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
192    omp_optim     = ""    omp_optim     = "-fopenmp"
193    omp_debug     = ""    omp_debug     = "-fopenmp"
194    omp_libs      = []    omp_libs      = ['gomp']
195    pedantic      = "-pedantic-errors -Wno-long-long"    pedantic      = "-pedantic-errors -Wno-long-long"
196    fatalwarning      = "-Werror"    fatalwarning      = "-Werror"
197    sysheaderopt      = "-isystem "    sysheaderopt      = "-isystem "
# Line 656  print "" Line 656  print ""
656  Execute(Delete(env['libinstall'] + "/Compiled.with.debug"))  Execute(Delete(env['libinstall'] + "/Compiled.with.debug"))
657  Execute(Delete(env['libinstall'] + "/Compiled.with.mpi"))  Execute(Delete(env['libinstall'] + "/Compiled.with.mpi"))
658  Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))  Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))
659    Execute(Delete(env['libinstall'] + "pyversion"))
660  if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))  if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))
661    
662    
# Line 699  if env['usedebug']: Line 700  if env['usedebug']:
700  if env['usempi']:  if env['usempi']:
701    remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Touch('$TARGET'))    remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Touch('$TARGET'))
702    
703  if env['omp_optim'] != '':  if env['useopenmp']:
704    remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Touch('$TARGET'))    remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Touch('$TARGET'))
705    
706  env.Alias('remember_options', remember_list)  env.Alias('remember_options', remember_list)
707    
708    
709    ############### Record python interpreter version ##############
710    
711    if not IS_WINDOWS_PLATFORM:
712      versionstring="Python "+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])
713      os.system("echo "+versionstring+" > "+os.path.join(env['libinstall'],"pyversion"))
714    
715    ############## Populate the buildvars file #####################
716    
717    buildvars=open(os.path.join(env['libinstall'],'buildvars'),'w')
718    buildvars.write('python='+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])+'\n')
719    
720    # Find the boost version by extracting it from version.hpp
721    boosthpp=open(os.path.join(env['boost_path'],'boost','version.hpp'))
722    boostversion='unknown'
723    try:
724        for line in boosthpp:
725            ver=re.match(r'#define BOOST_VERSION (\d+)',line)
726            if ver:
727                boostversion=ver.group(1)
728    except StopIteration:
729        pass
730    buildvars.write("boost="+boostversion+"\n")
731    buildvars.write("svn_revision="+str(global_revision)+"\n")
732    out="usedebug="
733    if env['usedebug']:
734        out+="y"
735    else:
736        out+="n"
737    out+="\nusempi="
738    if env['usempi']:
739        out+="y"
740    else:
741        out+="n"
742    out+="\nuseopenmp="
743    if env['useopenmp']:
744        out+="y"
745    else:
746        out+="n"
747    buildvars.write(out+"\n")
748    
749    buildvars.close()
750    
751    
752  ############ Targets to build and install libraries ############  ############ Targets to build and install libraries ############
753    
754  target_init = env.Command(env['pyinstall']+'/__init__.py', None, Touch('$TARGET'))  target_init = env.Command(env['pyinstall']+'/__init__.py', None, Touch('$TARGET'))
# Line 773  if not IS_WINDOWS_PLATFORM: Line 818  if not IS_WINDOWS_PLATFORM:
818      for tests in TestGroups:      for tests in TestGroups:
819          utest.write(tests.makeString())          utest.write(tests.makeString())
820      utest.close()      utest.close()
821        os.chmod("utest.sh",stat.S_IRWXU|stat.S_IRGRP|stat.S_IXGRP|stat.S_IROTH|stat.S_IXOTH)
822      print "utest.sh written"      print "utest.sh written"
823     except IOError:     except IOError:
824      print "Error attempting to write unittests file."      print "Error attempting to write unittests file."

Legend:
Removed from v.2296  
changed lines
  Added in v.2302

  ViewVC Help
Powered by ViewVC 1.1.26