/[ascend]/trunk/base/generic/solver/SConscript
ViewVC logotype

Contents of /trunk/base/generic/solver/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1786 - (show annotations) (download)
Sat Jun 7 06:17:35 2008 UTC (11 years, 9 months ago) by jpye
File size: 1521 byte(s)
Fixed for missing libpython (DistutilsPlatformError).
Fixed several env.Copy() warnings.
Removed swig 'SideEffect' statement for current SCons swig tool.
1 Import('libascend_env')
2
3 csrcs = Split("""
4 slv_interface.c
5 mps.c
6 slv2.c slv6.c slv7.c
7 slvDOF.c
8 logblock.c
9 solver.c
10 """)
11 # slv9, slv3 and slv8 moved to external packages (dynamically loaded)
12
13 objs = []
14
15 import re
16 def c_escape(str):
17 return re.sub("\\\\","/",str)
18
19
20 solver_env = libascend_env.Clone()
21
22 solver_env['SUBST_DICT'] = {
23 '@ASC_WITH_CONOPT@':str(int('CONOPT' in libascend_env['WITH_SOLVERS']))
24 ,'@ASC_LINKED_CONOPT@':str(int(libascend_env['CONOPT_LINKED']))
25 ,'@ASC_CONOPT_LIB@': '"%s"' % libascend_env.get('CONOPT_LIB')
26 ,'@ASC_CONOPT_ENVVAR@': '"%s"' % libascend_env.get('CONOPT_ENVVAR')
27 ,'@ASC_CONOPT_DLPATH@': '"%s"' % c_escape(libascend_env.subst("$CONOPT_DLPATH"))
28 }
29
30 solverconfig = solver_env.SubstInFile('conoptconfig.h.in')
31
32 if 'CONOPT' in libascend_env['WITH_SOLVERS']:
33 conopt_env = solver_env.Clone()
34
35 if libascend_env.get('CONOPT_LINKED'):
36 # and then we must give the ldflags back to libascend for linking.
37 libascend_env.AppendUnique(
38 LIBPATH=[solver_env.get('CONOPT_LIBPATH')]
39 , LIBS=[solver_env.get('CONOPT_LIB')]
40 )
41
42 conoptdl = conopt_env.SharedObject('conopt_dl.c')
43 conopt_env.Depends(conoptdl,solverconfig)
44
45 objs += conoptdl
46
47 for c in csrcs:
48 objs += solver_env.SharedObject(c)
49
50 #--------------------
51 # INSTALL
52
53 import glob
54
55 if libascend_env.get('CAN_INSTALL'):
56 installdir = Dir(libascend_env.subst("$INSTALL_ROOT$INSTALL_INCLUDE/solver"))
57
58 headers = glob.glob("*.h")
59 libascend_env.InstallHeader(installdir,headers)
60
61 Return('objs')
62
63 # vim: set syntax=python:
64

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