/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2603 by jfenwick, Wed Aug 12 00:44:35 2009 UTC revision 2742 by jfenwick, Thu Nov 12 06:03:37 2009 UTC
# Line 16  EnsureSConsVersion(0,96,91) Line 16  EnsureSConsVersion(0,96,91)
16  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
17    
18  import sys, os, re, socket, platform, stat  import sys, os, re, socket, platform, stat
19    # For copy()
20    import shutil
21    
22  # Add our extensions  # Add our extensions
23  if os.path.isdir('scons'): sys.path.append('scons')  if os.path.isdir('scons'): sys.path.append('scons')
# Line 100  adder( Line 102  adder(
102    BoolVariable('usepedantic', 'Compile with -pedantic if using gcc', 'no'),    BoolVariable('usepedantic', 'Compile with -pedantic if using gcc', 'no'),
103    BoolVariable('usewarnings','Compile with warnings as errors if using gcc','yes'),    BoolVariable('usewarnings','Compile with warnings as errors if using gcc','yes'),
104    ('forcelazy','for testing use only - set the default value for autolazy','leave_alone'),    ('forcelazy','for testing use only - set the default value for autolazy','leave_alone'),
105      ('forcecollres','for testing use only - set the default value for force resolving collective ops','leave_alone'),
106  # Python  # Python
107    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),    ('python_path', 'Path to Python includes', '/usr/include/'+python_version),
108    ('python_lib_path', 'Path to Python libs', usr_lib),    ('python_lib_path', 'Path to Python libs', usr_lib),
# Line 121  adder( Line 124  adder(
124    ('mpi_path', 'Path to MPI includes', '/usr/include'),    ('mpi_path', 'Path to MPI includes', '/usr/include'),
125    ('mpi_run', 'mpirun name' , 'mpiexec -np 1'),    ('mpi_run', 'mpirun name' , 'mpiexec -np 1'),
126    ('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)', usr_lib),    ('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)', usr_lib),
127    ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', ['mpich' , 'pthread', 'rt']),    ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', []),
128    ('mpi_flavour','Type of MPI execution environment','none'),    ('mpi_flavour','Type of MPI execution environment','none'),
129  # ParMETIS  # ParMETIS
130    BoolVariable('useparmetis', 'Compile parallel version using ParMETIS', 'yes'),    BoolVariable('useparmetis', 'Compile parallel version using ParMETIS', 'yes'),
# Line 158  adder( Line 161  adder(
161    ('blas_path', 'Path to BLAS includes', '/usr/include/suitesparse'),    ('blas_path', 'Path to BLAS includes', '/usr/include/suitesparse'),
162    ('blas_lib_path', 'Path to BLAS libs', usr_lib),    ('blas_lib_path', 'Path to BLAS libs', usr_lib),
163    ('blas_libs', 'BLAS libraries to link with', ['blas']),    ('blas_libs', 'BLAS libraries to link with', ['blas']),
164    #Lapack options
165      BoolVariable('uselapack','switch on/off use of Lapack','no'),
166      ('lapack_path', 'Path to Lapack includes','/usr/include'),
167      ('lapack_lib_path', 'Path to Lapack libs', usr_lib),
168      ('lapack_libs', 'Lapack libraries to link with', []),
169      ('lapack_type', '{clapack,mkl}','clapack'),
170  # An option for specifying the compiler tools set (see windows branch).  # An option for specifying the compiler tools set (see windows branch).
171    ('tools_names', 'allow control over the tools in the env setup', ['intelc']),    ('tools_names', 'allow control over the tools in the env setup', ['intelc']),
172  # finer control over library building, intel aggressive global optimisation  # finer control over library building, intel aggressive global optimisation
# Line 167  adder( Line 176  adder(
176    ('env_export','Environment variables to be passed to children',[])    ('env_export','Environment variables to be passed to children',[])
177  )  )
178    
179    
180    
181  ############ Specify which compilers to use ####################  ############ Specify which compilers to use ####################
182    
183  # intelc uses regular expressions improperly and emits a warning about  # intelc uses regular expressions improperly and emits a warning about
# Line 187  else: Line 198  else:
198        env = Environment(tools = ['default'], options = opts)        env = Environment(tools = ['default'], options = opts)
199  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
200    
201    
202    ############ Make sure target directories exist ################
203    
204    if not os.path.isdir(env['bininstall']):
205        os.makedirs(env['bininstall'])
206    if not os.path.isdir(env['libinstall']):
207        os.makedirs(env['libinstall'])
208    if not os.path.isdir(env['pyinstall']):
209        os.makedirs(env['pyinstall'])
210    
211  ########## Copy required environment vars ######################  ########## Copy required environment vars ######################
212    
213  for i in env['env_export']:  for i in env['env_export']:
# Line 222  elif env["CC"] == "gcc": Line 243  elif env["CC"] == "gcc":
243    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"    cc_debug      = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK"
244    omp_optim     = "-fopenmp"    omp_optim     = "-fopenmp"
245    omp_debug     = "-fopenmp"    omp_debug     = "-fopenmp"
246    omp_libs      = ['gomp']    omp_libs      = []
247    pedantic      = "-pedantic-errors -Wno-long-long"    pedantic      = "-pedantic-errors -Wno-long-long"
248    fatalwarning      = "-Werror"    fatalwarning      = "-Werror"
249    sysheaderopt      = "-isystem "    sysheaderopt      = "-isystem "
# Line 255  if env["omp_libs"] == "-DEFAULT_6": env[ Line 276  if env["omp_libs"] == "-DEFAULT_6": env[
276  #set up the autolazy values  #set up the autolazy values
277  if env['forcelazy']    != "leave_alone":  if env['forcelazy']    != "leave_alone":
278    if env['forcelazy'] == 'on':    if env['forcelazy'] == 'on':
279      env.Append(CPPDEFINES='FAUTOLAZYON')      env.Append(CPPDEFINES=['FAUTOLAZYON'])
280    else:    else:
281       if env['forcelazy'] == 'off':       if env['forcelazy'] == 'off':
282      env.Append(CPPDEFINES='FAUTOLAZYOFF')      env.Append(CPPDEFINES=['FAUTOLAZYOFF'])
283    
284    #set up the colective resolve values
285    if env['forcecollres']    != "leave_alone":
286      print env['forcecollres']
287      if env['forcecollres'] == 'on':
288        env.Append(CPPDEFINES=['FRESCOLLECTON'])
289      else:
290         if env['forcecollres'] == 'off':
291        env.Append(CPPDEFINES=['FRESCOLLECTOFF'])
292    
293    
294  # OpenMP is disabled if useopenmp=no or both variables omp_optim and omp_debug are empty  # OpenMP is disabled if useopenmp=no or both variables omp_optim and omp_debug are empty
295  if not env["useopenmp"]:  if not env["useopenmp"]:
# Line 578  if env['usesilo']: Line 609  if env['usesilo']:
609    env.AppendUnique(LIBPATH = [env['silo_lib_path']])    env.AppendUnique(LIBPATH = [env['silo_lib_path']])
610    env.Append(CPPDEFINES = ['HAVE_SILO'])    env.Append(CPPDEFINES = ['HAVE_SILO'])
611    
612    ########### Lapack (optional) ##################################
613    
614    
615    if env['uselapack']:
616        env.AppendUnique(CPPDEFINES='USE_LAPACK')
617        env.AppendUnique(CPPPATH = [env['lapack_path']])
618        env.AppendUnique(LIBPATH =[env['lapack_lib_path']])
619    
620        env.Append(LIBPATH = '/usr/lib/atlas')
621        env.Append(LIBS = [env['lapack_libs']])
622        if env['lapack_type']=='mkl':
623           env.AppendUnique(CPPDEFINES='MKL_LAPACK')
624    
625  ############ Add the compiler flags ############################  ############ Add the compiler flags ############################
626    
627  # Enable debug by choosing either cc_debug or cc_optim  # Enable debug by choosing either cc_debug or cc_optim
# Line 804  else: Line 848  else:
848      out+="n"      out+="n"
849  buildvars.write(out+"\n")  buildvars.write(out+"\n")
850  buildvars.write("mpi_flavour="+env['mpi_flavour']+'\n')  buildvars.write("mpi_flavour="+env['mpi_flavour']+'\n')
851    buildvars.write("lapack=")
852    if env['uselapack']:
853       buildvars.write('y')
854    else:
855       buildvars.write('n')
856    buildvars.write('\n')
857  buildvars.close()  buildvars.close()
858    
859    
# Line 885  if not IS_WINDOWS_PLATFORM: Line 934  if not IS_WINDOWS_PLATFORM:
934      print "Error attempting to write unittests file."      print "Error attempting to write unittests file."
935      sys.exit(1)      sys.exit(1)
936    
937       #Make sure that the escript wrapper is in place
938       if not os.path.isfile(os.path.join(env['bininstall'],'escript')):
939           print "Copying escript wrapper"
940           shutil.copy("bin/escript",os.path.join(env['bininstall'],'escript'))

Legend:
Removed from v.2603  
changed lines
  Added in v.2742

  ViewVC Help
Powered by ViewVC 1.1.26