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

Contents of /trunk/ascend/solver/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


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

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