/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2300 by gross, Wed Mar 11 08:17:57 2009 UTC revision 2324 by jfenwick, Thu Mar 19 04:35:30 2009 UTC
# Line 572  if env_mpi['usempi']: Line 572  if env_mpi['usempi']:
572    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])    conf.env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])
573    
574  if env_mpi['usempi'] and not conf.CheckCHeader('mpi.h'): env_mpi['usempi'] = 0  if env_mpi['usempi'] and not conf.CheckCHeader('mpi.h'): env_mpi['usempi'] = 0
575  if env_mpi['usempi'] and not conf.CheckFunc('MPI_Init'): env_mpi['usempi'] = 0  # if env_mpi['usempi'] and not conf.CheckFunc('MPI_Init'): env_mpi['usempi'] = 0
576    
577  # Add MPI to environment env_mpi if it was found  # Add MPI to environment env_mpi if it was found
578  if env_mpi['usempi']:  if env_mpi['usempi']:
# Line 653  print "" Line 653  print ""
653    
654  ############ Delete option-dependent files #####################  ############ Delete option-dependent files #####################
655    
656  Execute(Delete(env['libinstall'] + "/Compiled.with.debug"))  Execute(Delete(os.path.join(env['libinstall'],"Compiled.with.debug")))
657  Execute(Delete(env['libinstall'] + "/Compiled.with.mpi"))  Execute(Delete(os.path.join(env['libinstall'],"Compiled.with.mpi")))
658  Execute(Delete(env['libinstall'] + "/Compiled.with.openmp"))  Execute(Delete(os.path.join(env['libinstall'],"Compiled.with.openmp")))
659  Execute(Delete(env['libinstall'] + "pyversion"))  Execute(Delete(os.path.join(env['libinstall'],"pyversion")))
660  if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI"))  Execute(Delete(os.path.join(env['libinstall'],"buildvars")))
661    if not env['usempi']: Execute(Delete(os.path.join(env['libinstall'],"pythonMPI")))
662    
663    
664  ############ Build the subdirectories ##########################  ############ Build the subdirectories ##########################
# Line 695  env.SConscript(dirs = ['paso/profiling'] Line 696  env.SConscript(dirs = ['paso/profiling']
696  remember_list = []  remember_list = []
697    
698  if env['usedebug']:  if env['usedebug']:
699    remember_list += env.Command(env['libinstall'] + "/Compiled.with.debug", None, Touch('$TARGET'))    remember_list += env.Command(os.path.join(env['libinstall'],"Compiled.with.debug"), None, Touch('$TARGET'))
700    
701  if env['usempi']:  if env['usempi']:
702    remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Touch('$TARGET'))    remember_list += env.Command(os.path.join(env['libinstall'],"Compiled.with.mpi"), None, Touch('$TARGET'))
703    
704  if env['omp_optim'] != '':  if env['useopenmp']:
705    remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Touch('$TARGET'))    remember_list += env.Command(os.path.join(env['libinstall'],"Compiled.with.openmp"), None, Touch('$TARGET'))
706    
707  env.Alias('remember_options', remember_list)  env.Alias('remember_options', remember_list)
708    
# Line 710  env.Alias('remember_options', remember_l Line 711  env.Alias('remember_options', remember_l
711    
712  if not IS_WINDOWS_PLATFORM:  if not IS_WINDOWS_PLATFORM:
713    versionstring="Python "+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])    versionstring="Python "+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])
714    os.system("echo "+versionstring+" > "+env['libinstall']+"/pyversion")    os.system("echo "+versionstring+" > "+os.path.join(env['libinstall'],"pyversion"))
715    
716    ############## Populate the buildvars file #####################
717    
718    buildvars=open(os.path.join(env['libinstall'],'buildvars'),'w')
719    buildvars.write('python='+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])+'\n')
720    
721    # Find the boost version by extracting it from version.hpp
722    boosthpp=open(os.path.join(env['boost_path'],'boost','version.hpp'))
723    boostversion='unknown'
724    try:
725        for line in boosthpp:
726            ver=re.match(r'#define BOOST_VERSION (\d+)',line)
727            if ver:
728                boostversion=ver.group(1)
729    except StopIteration:
730        pass
731    buildvars.write("boost="+boostversion+"\n")
732    buildvars.write("svn_revision="+str(global_revision)+"\n")
733    out="usedebug="
734    if env['usedebug']:
735        out+="y"
736    else:
737        out+="n"
738    out+="\nusempi="
739    if env['usempi']:
740        out+="y"
741    else:
742        out+="n"
743    out+="\nuseopenmp="
744    if env['useopenmp']:
745        out+="y"
746    else:
747        out+="n"
748    buildvars.write(out+"\n")
749    
750    buildvars.close()
751    
752    
753  ############ Targets to build and install libraries ############  ############ Targets to build and install libraries ############
754    

Legend:
Removed from v.2300  
changed lines
  Added in v.2324

  ViewVC Help
Powered by ViewVC 1.1.26