/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 2515 by jpye, Tue Nov 8 08:37:11 2011 UTC revision 2523 by jpye, Wed Jan 18 23:41:37 2012 UTC
# Line 34  default_install_python_ascend = "$INSTAL Line 34  default_install_python_ascend = "$INSTAL
34  default_tcl = '/usr'  default_tcl = '/usr'
35  default_tcl_libpath = "$TCL/lib"  default_tcl_libpath = "$TCL/lib"
36  default_tcl_cpppath = "$TCL/include"  default_tcl_cpppath = "$TCL/include"
 default_tron_envvar="TRON_PATH"  
37  default_conopt_envvar="CONOPT_PATH"  default_conopt_envvar="CONOPT_PATH"
38  default_with_graphviz = True  default_with_graphviz = True
39  default_tcl_lib = "tcl8.5"  default_tcl_lib = "tcl8.5"
# Line 48  default_conopt_prefix="$DEFAULT_PREFIX" Line 47  default_conopt_prefix="$DEFAULT_PREFIX"
47  default_conopt_libpath="$CONOPT_PREFIX"  default_conopt_libpath="$CONOPT_PREFIX"
48  default_conopt_cpppath="$CONOPT_PREFIX"  default_conopt_cpppath="$CONOPT_PREFIX"
49  default_conopt_dlpath="$CONOPT_PREFIX"  default_conopt_dlpath="$CONOPT_PREFIX"
 default_tron_prefix="$DEFAULT_PREFIX"  
 default_tron_dlpath="$TRON_PREFIX/lib"  
 default_tron_lib="tron1"  
50  default_prefix="/usr"  default_prefix="/usr"
51  default_libpath="$DEFAULT_PREFIX/lib"  default_libpath="$DEFAULT_PREFIX/lib"
52  default_cpppath="$DEFAULT_PREFIX/include"  default_cpppath="$DEFAULT_PREFIX/include"
 default_fortran="gfortran"  
53  default_f2c_lib="gfortran"  default_f2c_lib="gfortran"
54  default_swig="swig"  default_swig="swig"
55    
56  icon_extension = '.png'  icon_extension = '.png'
57    
58  if platform.system()=="Windows":  if platform.system()=="Windows":
59      default_prefix="c:\\MinGW"      if os.path.exists("c:\\MinGW"):
60            default_prefix="c:\\MinGW"
61        elif os.path.exists("c:\MinGW64"):
62            default_prefix="c:\\MinGW64"
63        
64      default_libpath="$DEFAULT_PREFIX\\lib"      default_libpath="$DEFAULT_PREFIX\\lib"
65      default_cpppath="$DEFAULT_PREFIX\\include"        default_cpppath="$DEFAULT_PREFIX\\include"  
66    
# Line 86  if platform.system()=="Windows": Line 85  if platform.system()=="Windows":
85      default_solvers_rel_dist = 'solvers'      default_solvers_rel_dist = 'solvers'
86            
87      # where to look for IDA solver libraries, headers, etc.      # where to look for IDA solver libraries, headers, etc.
88      default_ida_prefix = "c:\\MinGW"      default_ida_prefix = "$DEFAULT_PREFIX"
89            
90      # IPOPT      # IPOPT
91      default_ipopt_libpath = "$IPOPT_PREFIX/lib/win32/release"      default_ipopt_libpath = "$IPOPT_PREFIX/lib/win32/release"
# Line 98  if platform.system()=="Windows": Line 97  if platform.system()=="Windows":
97      default_conopt_cpppath="$CONOPT_PREFIX"      default_conopt_cpppath="$CONOPT_PREFIX"
98      default_conopt_dlpath="$CONOPT_PREFIX"      default_conopt_dlpath="$CONOPT_PREFIX"
99      default_conopt_lib="conopt3"      default_conopt_lib="conopt3"
   
     # FIXME remove this  
     default_tron_prefix="c:\\Program Files\\TRON"  
     default_tron_dlpath="$TRON_PREFIX"  
100                    
101      need_libm = False      need_libm = False
102      python_exe = sys.executable      python_exe = sys.executable
103      default_with_scrollkeeper=False      default_with_scrollkeeper=False
104      pathsep = ";"      pathsep = ";"
105            
     default_fortran="gfortran"  
106      default_f2c_lib="gfortran"      default_f2c_lib="gfortran"
107            
108      default_swig=WhereIs("swig.exe")      default_swig=WhereIs("swig.exe")
# Line 149  elif platform.system()=="Darwin": Line 143  elif platform.system()=="Darwin":
143      default_conopt_prefix = "/Library/CONOPT"      default_conopt_prefix = "/Library/CONOPT"
144    
145      default_conopt_lib="conopt3"      default_conopt_lib="conopt3"
   
     # FIXME remove this  
     default_tron_dlpath="$TRON_PREFIX"  
     default_tron_lib="tron1"  
146                    
147      need_libm = False      need_libm = False
148      python_exe = sys.executable      python_exe = sys.executable
# Line 250  else: # LINUX, unix we hope Line 240  else: # LINUX, unix we hope
240      #   default_graphviz_libpath="/usr/lib/graphviz"      #   default_graphviz_libpath="/usr/lib/graphviz"
241      #   default_graphviz_rpath="$GRAPHVIZ_LIBPATH"      #   default_graphviz_rpath="$GRAPHVIZ_LIBPATH"
242    
 if not os.path.exists(default_tron_prefix):  
     default_tron_prefix = None  
   
243  if not os.path.exists(default_ida_prefix):  if not os.path.exists(default_ida_prefix):
244      default_ida_prefix = None      default_ida_prefix = None
245    
# Line 270  soname_full = "%s%s" % (soname_clean,son Line 257  soname_full = "%s%s" % (soname_clean,son
257  vars = Variables(['options.cache', 'config.py'])  vars = Variables(['options.cache', 'config.py'])
258            
259  vars.Add(  vars.Add(
260        'HOST_PREFIX'
261        ,"Host architecture prefix"
262        ,""
263    )
264    
265    vars.Add(
266      'CC'      'CC'
267      ,'C Compiler command'      ,'C Compiler command'
268      ,None      ,"${HOST_PREFIX}gcc"
269  )  )
270    
271  vars.Add(  vars.Add(
272      'CXX'      'CXX'
273      ,'C++ Compiler command'      ,'C++ Compiler command'
274      ,None      ,"${HOST_PREFIX}g++"
275  )  )
276    
277  vars.Add(BoolVariable(  vars.Add(BoolVariable(
# Line 514  if platform.system()=="Windows": Line 507  if platform.system()=="Windows":
507          ,default_ipopt_dll          ,default_ipopt_dll
508      )      )
509    
 #------- TRON -------  
   
 vars.Add(  
     'TRON_ENVVAR'  
     ,"What environment variable should be used at runtime to override the default search location for TRON DLL/SO?"  
     ,default_tron_envvar  
 )  
   
 vars.Add(  
     "TRON_LIB"  
     ,"Library linked to for TRON"  
     ,"tron"  
 )  
   
 vars.Add(  
     "TRON_PREFIX"  
     ,"Prefix for your TRON install"  
     ,default_tron_prefix  
 )  
   
 vars.Add(  
     'TRON_DLPATH'  
     ,"What is the default search path that ASCEND should use when dlopening the TRON library at runtime?"  
     ,default_tron_dlpath  
 )  
   
510  #-------- f2c ------  #-------- f2c ------
511    
512  vars.Add(  vars.Add(
# Line 557  vars.Add(PackageVariable( Line 524  vars.Add(PackageVariable(
524  vars.Add(  vars.Add(
525      "FORTRAN"      "FORTRAN"
526      ,"Fortran compiler (eg g77, gfortran)"      ,"Fortran compiler (eg g77, gfortran)"
527      ,default_fortran      ,"${HOST_PREFIX}gfortran"
528  )  )
529    
530  #------- tcl/tk --------  #------- tcl/tk --------
# Line 1152  C     Hello World in Fortran 77 Line 1119  C     Hello World in Fortran 77
1119        END          END  
1120  """;  """;
1121    
1122  def CheckF77(context):  def CheckFortran(context):
1123      context.Message("Checking Fortran 77 compiler ('%s')..." % context.env.get('FORTRAN'))      context.Message("Checking Fortran compiler ('%s')..." % context.env.get('FORTRAN'))
1124      if not context.env.get('FORTRAN'):      if not context.env.get('FORTRAN'):
1125          context.Result('not found')          context.Result('not found')
1126          return False          return False
# Line 1643  def CheckDLOpen(context): Line 1610  def CheckDLOpen(context):
1610    
1611  libpython_test_text = """  libpython_test_text = """
1612  #include <Python.h>  #include <Python.h>
1613    PyObject *get10(void){
1614        PyObject *p = Py_BuildValue("i", 10);
1615        return p;
1616    }
1617  int main(void){  int main(void){
     PyObject *p;  
     p = Py_None;  
1618      return 0;      return 0;
1619  }  }
1620  """  """
# Line 2176  conf = Configure(env Line 2145  conf = Configure(env
2145      , custom_tests = {      , custom_tests = {
2146          'CheckCC' : CheckCC          'CheckCC' : CheckCC
2147          , 'CheckCXX' : CheckCXX          , 'CheckCXX' : CheckCXX
2148          , 'CheckF77' : CheckF77          , 'CheckFortran' : CheckFortran
2149          , 'CheckMath' : CheckMath          , 'CheckMath' : CheckMath
2150          , 'CheckMalloc' : CheckMalloc          , 'CheckMalloc' : CheckMalloc
2151          , 'CheckDLOpen' : CheckDLOpen          , 'CheckDLOpen' : CheckDLOpen
# Line 2284  for _var,_type in _sizes.iteritems(): Line 2253  for _var,_type in _sizes.iteritems():
2253    
2254  # check for some string functions  # check for some string functions
2255    
2256  if conf.CheckFunc('snprintf') is False:  if conf.CheckFunc('sprintf') is False:
2257      print "Didn't find snprintf";      print "Didn't find sprintf";
2258      Exit(1)      Exit(1)
2259    
2260  if conf.CheckFunc('strdup'):  if conf.CheckFunc('strdup'):
2261      conf.env['HAVE_STRDUP'] = True      conf.env['HAVE_STRDUP'] = True
2262    
2263    if conf.CheckFunc('snprintf'):
2264        conf.env['HAVE_SNPRINTF'] = True
2265    elif conf.CheckFunc('_snprintf'):
2266        conf.env['HAVE__SNPRINTF'] = True
2267    
2268  # attempt to support MSVCRT 7.1 on Windows  # attempt to support MSVCRT 7.1 on Windows
2269    
2270  if platform.system()=="Windows" and env.get('WITH_MSVCR71'):  if platform.system()=="Windows" and env.get('WITH_MSVCR71'):
# Line 2516  if need_fortran: Line 2490  if need_fortran:
2490  else:  else:
2491      print "FORTRAN WAS NOT FOUND TO BE REQUIRED"      print "FORTRAN WAS NOT FOUND TO BE REQUIRED"
2492    
2493  if need_fortran and conf.CheckF77() is False:  if need_fortran and conf.CheckFortran() is False:
2494      print "Failed to build simple test file with your Fortran compiler."      print "Failed to build simple test file with your Fortran compiler."
2495      print "Check your compiler is installed and running correctly."      print "Check your compiler is installed and running correctly."
2496      print "You can set your Fortran compiler using the FORTRAN scons option."      print "You can set your Fortran compiler using the FORTRAN scons option."
# Line 2899  env.Alias('extfns',env['extfns']) Line 2873  env.Alias('extfns',env['extfns'])
2873  #-------------  #-------------
2874  # FPROPS python bindings  # FPROPS python bindings
2875    
2876  env.Alias('pyfprops',env['pyfprops'])  env.Alias('pyfprops',env.get('pyfprops'))
2877    
2878  #------------------------------------------------------  #------------------------------------------------------
2879  # CREATE ASCEND-CONFIG scriptlet  # CREATE ASCEND-CONFIG scriptlet

Legend:
Removed from v.2515  
changed lines
  Added in v.2523

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