/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 426 by johnpye, Mon Apr 3 05:17:50 2006 UTC revision 427 by johnpye, Tue Apr 4 04:13:34 2006 UTC
# Line 19  if platform.system()=='Windows' and env. Line 19  if platform.system()=='Windows' and env.
19      print "LINKCOM =",env['LINKCOM']      print "LINKCOM =",env['LINKCOM']
20      print "AR =",env['AR']      print "AR =",env['AR']
21      print "ARCOM =",env['ARCOM']      print "ARCOM =",env['ARCOM']
22        #env['AR']='link /lib'
23      env.Append(CPPPATH=env['ENV']['INCLUDE'])      env.Append(CPPPATH=env['ENV']['INCLUDE'])
24      env.Append(LIBPATH=env['ENV']['LIB'])      env.Append(LIBPATH=env['ENV']['LIB'])
25        env.Append(CPPDEFINES=['_CRT_SECURE_NO_DEPRECATED','_CRT_SECURE_NO_DEPRECATE'])
26    
27  # Package linking option  # Package linking option
28  opts.Add(EnumOption(  opts.Add(EnumOption(
# Line 139  opts.Add(PackageOption( Line 141  opts.Add(PackageOption(
141      ,None      ,None
142  ))  ))
143    
   
144  # TODO: OTHER OPTIONS?  # TODO: OTHER OPTIONS?
   
145  # TODO: flags for optimisation  # TODO: flags for optimisation
   
146  # TODO: turning on/off bintoken functionality  # TODO: turning on/off bintoken functionality
147    # TODO: Where will the 'Makefile.bt' file be installed?
 # TODO: Where will the 'Makefile.bt' file be installed  
 # ....  
148    
149  opts.Update(env)  opts.Update(env)
150  opts.Save('options.cache',env)  opts.Save('options.cache',env)
151    
152  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
153    
 env.Append(CPPDEFINES=env['PACKAGE_LINKING'])  
   
154  with_tcltk_gui = (env['WITHOUT_TCLTK_GUI']==False)  with_tcltk_gui = (env['WITHOUT_TCLTK_GUI']==False)
155    without_tcltk_reason = "disabled by options/config.py"
156    
157  with_python = (env['WITHOUT_PYTHON']==False)  with_python = (env['WITHOUT_PYTHON']==False)
158  without_python_reason = None  without_python_reason = "disabled by options/config.py"
159    
160  with_cunit_tests = env['WITH_CUNIT_TESTS']  with_cunit_tests = env['WITH_CUNIT_TESTS']
161    without_cunit_reason = "not requested"
162    
163  print "SOLVERS:",env['WITH_SOLVERS']  print "SOLVERS:",env['WITH_SOLVERS']
   
164  print "WITH_LOCAL_HELP:",env['WITH_LOCAL_HELP']  print "WITH_LOCAL_HELP:",env['WITH_LOCAL_HELP']
165  print "WITH_BINTOKEN:",env['WITH_BINTOKEN']  print "WITH_BINTOKEN:",env['WITH_BINTOKEN']
166  print "DEFAULT_ASCENDLIBRARY:",env['DEFAULT_ASCENDLIBRARY']  print "DEFAULT_ASCENDLIBRARY:",env['DEFAULT_ASCENDLIBRARY']
# Line 190  env.Append(SUBST_DICT=subst_dict) Line 186  env.Append(SUBST_DICT=subst_dict)
186    
187  import os,re  import os,re
188    
189    need_fortran = False
190    
191  def get_swig_version(env):  def get_swig_version(env):
192      cmd = env['SWIG']+' -version'      cmd = env['SWIG']+' -version'
193      (cin,coutcerr) = os.popen4(cmd);      (cin,coutcerr) = os.popen4(cmd)
194      output = coutcerr.read()      output = coutcerr.read()
195            
196      restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"      restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"
# Line 386  conf = Configure(env Line 384  conf = Configure(env
384    
385    
386  # Math library  # Math library
387  if not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):  
388      print 'Did not find math library, exiting!'  #if not conf.CheckFunc('sinh') and not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):
389      Exit(1)  #   print 'Did not find math library, exiting!'
390    #   Exit(1)
391    
392  # Where is 'isnan'?  # Where is 'isnan'?
393    
# Line 434  if not conf.CheckSwigVersion(): Line 433  if not conf.CheckSwigVersion():
433    
434  if with_cunit_tests:  if with_cunit_tests:
435      if not conf.CheckCUnit():      if not conf.CheckCUnit():
436          print "CUnit not found. Use 'scons WITH_CUNIT_TESTS=0'"          without_cunit_reason = 'CUnit not found'
437    
438    # BLAS
439    
440    if conf.CheckLib('blas'):
441        print "FOUND BLAS"
442        with_local_blas = False
443        without_local_blas_reason = "Found BLAS installed on system"
444    else:
445        print "DIDN'T FIND BLAS"
446        with_local_blas = True
447        need_fortran = True
448    
449    # FORTRAN
450    
451    if need_fortran:
452        conf.env.Tool('f77')
453        detect_fortran = conf.env.Detect(['g77','f77'])
454        if detect_fortran:
455            # For some reason, g77 doesn't get detected properly on MinGW
456            if not env.has_key('F77'):
457                conf.env.Replace(F77=detect_fortran)
458                conf.env.Replace(F77COM='$F77 $F77FLAGS -c -o $TARGET $SOURCE')
459                conf.env.Replace(F77FLAGS='')
460                print "F77:",conf.env['F77']
461                print "F77COM:",conf.env['F77COM']
462                print "F77FLAGS:",conf.env['F77FLAGS']
463                fortran_builder = Builder(
464                    action='$F77COM'
465                    , suffix='.o'
466                    , src_suffix='.f'
467                )
468                conf.env.Append(BUILDERS={'Fortran':fortran_builder})
469        else:
470            print "FORTRAN-77 required but not found"
471          Exit(1)          Exit(1)
472    else:
473        print "FORTRAN not required"
474    
475  # TODO: -D_HPUX_SOURCE is needed  # TODO: -D_HPUX_SOURCE is needed
476    
# Line 443  if with_cunit_tests: Line 478  if with_cunit_tests:
478    
479  # TODO: detect if dynamic libraries are possible or not  # TODO: detect if dynamic libraries are possible or not
480    
481    if platform.system()=="Windows" and env.has_key('MSVS'):
482        if not conf.CheckHeader('windows.h') and env['PACKAGE_LINKING']=='DYNAMIC_PACKAGES':
483            print "Reverting to STATIC_PACKAGES since windows.h is not available. Probably you "\
484                +"need to install the Microsoft Windows Server 2003 Platform SDK, or similar."
485            env['PACKAGE_LINKING']='STATIC_PACKAGES'
486            
487        if with_python and not conf.CheckHeader('basetsd.h'):
488            with_python = 0;
489            without_python_reason = "Header file 'basetsd.h' not found. Install the MS Platform SDK."
490    
491    conf.env.Append(CPPDEFINES=env['PACKAGE_LINKING'])
492    
493  conf.Finish()  conf.Finish()
494    
495  env.Append(PYTHON_LIBPATH=[distutils.sysconfig.PREFIX+"/libs"])  env.Append(PYTHON_LIBPATH=[distutils.sysconfig.PREFIX+"/libs"])
# Line 560  if with_cunit_tests: Line 607  if with_cunit_tests:
607            
608            
609  else:  else:
610      print "Skipping... CUnit tests aren't being built"      print "Skipping... CUnit tests aren't being built:",without_cunit_reason
611    
612    #if with_tcltk_gui:
613    if with_local_blas:
614        env.SConscript(['blas/SConscript'],'env')
615    else:
616        print "Skipping... BLAS won't be build:", without_local_blas_reason
617    
618    env.SConscript(['lsod/SConscript'],'env')      
619    
620    env.SConscript(['linpack/SConscript'],'env')
621    
622  #------------------------------------------------------  #------------------------------------------------------
623  # INSTALLATION  # INSTALLATION

Legend:
Removed from v.426  
changed lines
  Added in v.427

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22