1 |
jpye |
2007 |
|
2 |
|
|
ASCEND Tool for SCons |
3 |
|
|
===================== |
4 |
|
|
|
5 |
|
|
This folder contains a 'tool' suitable for use with the software build tool, |
6 |
|
|
SCons. You can use it on Windows and Linux, and possibly Mac, to detect |
7 |
|
|
where ASCEND is installed, and what its compile-time settings were. |
8 |
|
|
|
9 |
|
|
If you use SCons for your own software project, this tool makes it easier to |
10 |
|
|
link to ASCEND and gives you the correct file location for installing |
11 |
|
|
external libraries so that they will be automatically loadable in ASCEND models. |
12 |
|
|
|
13 |
|
|
Suggested usage |
14 |
|
|
--------------- |
15 |
|
|
|
16 |
|
|
The following gives a suggested 'SConstruct' file for your external library |
17 |
|
|
project: |
18 |
|
|
|
19 |
|
|
tools = ['ascend',...] |
20 |
|
|
env = Environment(toolpath="#/scons",tools=['ascend']) |
21 |
|
|
env['INSTALL_ROOT'] = "" # (for use when building RPM/DEB packages only) |
22 |
|
|
|
23 |
|
|
if env['HAVE_ASCEND']: |
24 |
|
|
asclib_env = env.Clone() |
25 |
|
|
# add settings to #include from and link to libascend... |
26 |
|
|
asclib_env.Append( |
27 |
|
|
LIBS=env.get('ASCEND_LIBS') |
28 |
|
|
, LIBPATH=env.get('ASCEND_LIBPATH') |
29 |
|
|
, CPPPATH=env.get('ASCEND_CPPPATH') |
30 |
|
|
lib = libenv.SharedLibrary("freesteam",["freesteam_ascend.c"] |
31 |
|
|
,SHLIBSUFFIX = env['ASCEND_EXTLIB_SUFFIX'] |
32 |
|
|
,SHLIBPREFIX = env['ASCEND_EXTLIB_PREFIX'] |
33 |
|
|
) |
34 |
|
|
|
35 |
|
|
) |
36 |
|
|
# build your ASCEND external library... |
37 |
|
|
lib = asclib_env.SharedLibrary("mylib",["mylib_ascend.c"] |
38 |
|
|
,SHLIBSUFFIX = env['ASCEND_EXTLIB_SUFFIX'] |
39 |
|
|
,SHLIBPREFIX = env['ASCEND_EXTLIB_PREFIX'] |
40 |
|
|
) |
41 |
|
|
# install your shared library in the correct place... |
42 |
|
|
env.InstallLibrary("$INSTALL_ROOT$ASCEND_MODELS",[lib]) |
43 |
|
|
|
44 |
|
|
-- |
45 |
|
|
John Pye |
46 |
|
|
Apr 2009. |
47 |
|
|
|