/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 3961 by jfenwick, Tue Sep 11 07:21:41 2012 UTC revision 3977 by caltinay, Thu Sep 20 04:27:10 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 *
 import subprocess  
19  from subprocess import PIPE, Popen  from subprocess import PIPE, Popen
20    
21  # 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
# Line 144  vars.AddVariables( Line 143  vars.AddVariables(
143  # in default locations.  # in default locations.
144  env = Environment(tools = ['default'], options = vars,  env = Environment(tools = ['default'], options = vars,
145                    ENV = {'PATH': os.environ['PATH']})                    ENV = {'PATH': os.environ['PATH']})
146                      
147    
148    #set the vars for clang
149    def mkclang(env):
150      env['CC']='clang'
151      env['CXX']='clang++'
152                      
153                      
154  if env['tools_names'] != 'default':  if env['tools_names'] != 'default':
155        zz=env['tools_names']
156        if 'clang' in zz:
157            zz.remove('clang')
158            zz.insert(0, mkclang)
159      env = Environment(tools = ['default'] + env['tools_names'], options = vars,      env = Environment(tools = ['default'] + env['tools_names'], options = vars,
160                        ENV = {'PATH' : os.environ['PATH']})                        ENV = {'PATH' : os.environ['PATH']})
161    
# Line 337  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N Line 348  for key in 'OMP_NUM_THREADS', 'ESCRIPT_N
348          env['ENV'][key] = 1          env['ENV'][key] = 1
349    
350  env_export=env['env_export']  env_export=env['env_export']
351  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'])
352    
353  for key in set(env_export):  for key in set(env_export):
354      try:      try:
# Line 526  env.PrependENVPath(LD_LIBRARY_PATH_KEY, Line 537  env.PrependENVPath(LD_LIBRARY_PATH_KEY,
537    
538  ######## numpy (required)  ######## numpy (required)
539    
540  if env['pythoncmd']=='python':  if not detectModule(env, 'numpy'):
541      try:      print("Cannot import numpy. If it is installed try setting your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)
542        from numpy import identity      Exit(1)
     except ImportError:  
       print("Cannot import numpy, you need to set your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)  
       Exit(1)  
 else:  
     p=subprocess.call([env['pythoncmd'],'-c','import numpy'])  
     if p!=0:  
       print("Cannot import numpy, you need to set your PYTHONPATH and probably %s"%LD_LIBRARY_PATH_KEY)  
       Exit(1)  
543    
544  ######## CppUnit (required for tests)  ######## CppUnit (required for tests)
545    
# Line 549  try: Line 552  try:
552  except:  except:
553      env['cppunit']=False      env['cppunit']=False
554    
555    ######## sympy (optional)
556    
557    if detectModule(env, 'sympy'):
558        env['sympy'] = True
559    else:
560        print("Cannot import sympy. Symbolic toolbox and nonlinear PDEs will not be available.")
561        env['sympy'] = False
562    
563  ######## netCDF (optional)  ######## netCDF (optional)
564    
565  netcdf_inc_path=''  netcdf_inc_path=''
# Line 694  if env['parmetis']: Line 705  if env['parmetis']:
705  ######## gmsh (optional, for tests)  ######## gmsh (optional, for tests)
706    
707  try:  try:
708      import subprocess      p=Popen(['gmsh', '-info'], stderr=PIPE)
     p=subprocess.Popen(['gmsh', '-info'], stderr=subprocess.PIPE)  
709      _,e=p.communicate()      _,e=p.communicate()
710      if e.split().count("MPI"):      if e.split().count("MPI"):
711          env['gmsh']='m'          env['gmsh']='m'
# Line 748  else: Line 758  else:
758      print("          LAPACK:  DISABLED")      print("          LAPACK:  DISABLED")
759  d_list=[]  d_list=[]
760  e_list=[]  e_list=[]
761  for i in 'debug','openmp','netcdf','parmetis','papi','mkl','umfpack','boomeramg','silo','visit','vsl_random':  for i in 'debug','openmp','boomeramg','mkl','netcdf','papi','parmetis','silo','sympy','umfpack','visit','vsl_random':
762      if env[i]: e_list.append(i)      if env[i]: e_list.append(i)
763      else: d_list.append(i)      else: d_list.append(i)
764  for i in e_list:  for i in e_list:

Legend:
Removed from v.3961  
changed lines
  Added in v.3977

  ViewVC Help
Powered by ViewVC 1.1.26