/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 391 by johnpye, Thu Mar 30 07:19:05 2006 UTC revision 392 by johnpye, Thu Mar 30 12:36:15 2006 UTC
# Line 1  Line 1 
1  import os, commands, platform  import os, commands, platform, distutils.sysconfig
2    
3  #------------------------------------------------------  #------------------------------------------------------
4  # OPTIONS  # OPTIONS
5    #
6    # Note that if you set the options via the command line, they will be
7    # remembered in the file 'options.cache'. It's a feature ;-)
8    
 env = Environment(ENV=os.environ)  
9  opts = Options(['options.cache', 'config.py'])  opts = Options(['options.cache', 'config.py'])
10  print "PLATFORM = ",platform.system()  print "PLATFORM = ",platform.system()
11    
12  # TODO: add install options  # Import the outside environment
13    env = Environment(ENV=os.environ)
 # TODO: OTHER OPTIONS?  
   
 # TODO: flags for optimisation  
14    
15  # Package linking option  # Package linking option
16  opts.Add(EnumOption(  opts.Add(EnumOption(
# Line 21  opts.Add(EnumOption( Line 20  opts.Add(EnumOption(
20      , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']      , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']
21  ))  ))
22    
23    # You can turn off building of Tcl/Tk interface
24  opts.Add(BoolOption(  opts.Add(BoolOption(
25      'WITHOUT_TCLTK_GUI'      'WITHOUT_TCLTK_GUI'
26      ,"Set to True if you don't want to build the original Tcl/Tk GUI."      ,"Set to True if you don't want to build the original Tcl/Tk GUI."
27      , False      , False
28  ))  ))
29    
30    # You can turn off the building of the Python interface
31  opts.Add(BoolOption(  opts.Add(BoolOption(
32      'WITHOUT_PYTHON'      'WITHOUT_PYTHON'
33      ,"Set to True if you don't want to build Python wrappers."      ,"Set to True if you don't want to build Python wrappers."
34      , False      , False
35  ))  ))
36    
37    # Which solvers will we allow?
38    opts.Add(ListOption(
39        'WITH_SOLVERS'
40        ,"List of the solvers you want to build"
41        ,["QRSLV","CMSLV"]
42        ,['QRSLV','MPS','SLV','OPTSQP'
43            ,'NGSLV','CMSLV','LRSLV','MINOS','CONOPT'
44            ,'LSOD','OPTSQP'
45         ]
46    ))
47    
48    # TODO: add install options
49    
50    # TODO: OTHER OPTIONS?
51    
52    # TODO: flags for optimisation
53    
54  opts.Update(env)  opts.Update(env)
55  opts.Save('options.cache',env)  opts.Save('options.cache',env)
56    
# Line 44  with_tcltk_gui = (env['WITHOUT_TCLTK_GUI Line 62  with_tcltk_gui = (env['WITHOUT_TCLTK_GUI
62    
63  with_python = (env['WITHOUT_PYTHON']==False)  with_python = (env['WITHOUT_PYTHON']==False)
64    
65    print "SOLVERS:",env['WITH_SOLVERS']
66        
67  #------------------------------------------------------  #------------------------------------------------------
68  # CONFIGURATION  # CONFIGURATION
69    
# Line 79  if not conf.CheckLib('tcl'): Line 99  if not conf.CheckLib('tcl'):
99  if not conf.CheckLib('tk'):  if not conf.CheckLib('tk'):
100      with_tcktk_gui = False      with_tcktk_gui = False
101    
102    
103  if platform.system()=="Windows":  if platform.system()=="Windows":
104      conf.env.Append(LIBPATH='c:\Python24\libs')      #conf.env.Append(LIBPATH='c:\Python24\libs')
105      conf.env.Append(CPPPATH='c:\Python24\include')      #conf.env.Append(CPPPATH='c:\Python24\include')
106      python_header='Python.h'      python_header='Python.h'
107      python_lib='python24'      python_lib=['python24']
108      python_libpath='c:\\Python24\\libs'      #python_libpath=['c:\\Python24\\libs']
109        #python_cpppath=['c:\\Python24\\include']
110  else:  else:
111      python_header='python2.4/Python.h'      python_header='python2.4/Python.h'
112      python_lib='python2.4'      python_lib=['python2.4']
113      python_libpath='/usr/include/python2.4'      #python_libpath=[]
114        #python_cpppath=['/usr/include/python2.4']
115        
116    
117  # Python  # Python
118  if not conf.CheckLibWithHeader(python_lib,python_header,'C'):  if not conf.CheckLibWithHeader(python_lib,python_header,'C'):
119      print "Didn't find Python 2.4 ("+python_lib+")"      print "Didn't find Python 2.4 ("+python_lib+")"
120      with_python = False      with_python = False
121  else:  else:
122      env.Append(PYTHON_LIBPATH=[python_libpath])      env.Append(PYTHON_LIBPATH=[distutils.sysconfig.PREFIX+"/libs"])
123      env.Append(PYTHON_LIB=python_lib)      #env.Append(PYTHON_LIB=python_lib)
124        env.Append(PYTHON_CPPPATH=[distutils.sysconfig.get_python_inc()])
125        print "PYTHON_LIBPATH =",env['PYTHON_LIBPATH']
126        print "PYTHON_CPPPATH =",env['PYTHON_CPPPATH']
127    
128  # TODO: -D_HPUX_SOURCE is needed  # TODO: -D_HPUX_SOURCE is needed
129    

Legend:
Removed from v.391  
changed lines
  Added in v.392

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