Building freesteam with Scons

How to compile

Starting with version 0.6, freesteam is built using SCons. SCons is an excellent and fairly new build tool that boasts much better cross-platform support that Autotools. If you're not familiar with SCons, I'd recommend you give it a careful look.

Building with SCons requires that you have Python (version 2.4) and SCons 0.96.92 (or newer, presumably) installed. These can both be installed very easily on Windows using .exe installers from the respective websites.

Linux

  1. tar jxvf /path/to/your/freesteam-0.8.1.tar.bz2
  2. cd freesteam-0.8.1
  3. scons
  4. If you had CppUnit installed, you can then type test/runtest to run tests on your build.
  5. To install the headers and static library in /usr/local/lib and /usr/local/include, type scons install

Windows

Assuming you are using MinGW with the MSYS commandline, the following steps should do it. Note the addition of python directories to the environment's $PATH.
  1. tar jxvf /path/to/yourfreesteam-0.8.1.tar.bz2
  2. cd freesteam-0.8.1
  3. export PATH=/mingw/bin:/bin:/Python24/Scripts:/Python24
  4. scons
  5. To install to c:\MinGW\lib and c:\MinGW\include, type scons install

Note: We're working on getting things running on the Visual C++ compiler. Currently there are some issues with the 'units.h' file, and some problems with allowing C++ exception handling. If you're able to help with these issues, let me know.

Python bindings

To build the Python bindings for ASCEND, you'll need to have a development version of Python installed (standard Python on Windows, or else a 'python-devel' package on Linux). You'll also need SWIG. Python version 2.4 or later and SWIG 1.3.24 or later should be fine.

The SCons installer should detect Python and SWIG automatically. If you use 'scons install' in this case, the relevant files should be installed inside Python such that you can use from freesteam import * whenever you want to use reesteam.

ASCEND bindings

SCons will also attempt to detect ASCEND on your system. This is a mathematical modelling and process simulation tool. You'll need a very new version of ASCEND here: at least 0.9.5.95. ASCEND support is still very experimental, and the interface is likely to change still.

If SCons does not correctly detect ASCEND during the build, you may find it helpful to use the ASCEND_SRCROOT option for SCons, and invoke scons with the ascend target as for example cd ~/src/freesteam && scons ASCEND_SRCROOT=~/src/ascend ascend.

EMSO library

The SCons build process above allows for detection of EMSO on your system, and will build 'hook libraries' to allow you to use freesteam functionality in your EMSO models. Note that this use of freesteam is not currently permitted under the license arrangement. Therefore your EMSO hook library DLLs are not re-distributable and can not be used for commercial purposes. I intend to permit their use for academic use, or for commercial use with a fee, but this has not yet been finalised (neither has the EMSO license, so that's OK, right?)

There is a reasonable number of sample models in the emso/test directory in the source tree that should allow you to test your EMSO hook library and work out what functionality is provided. There is no documentation for this yet. Note that you may need to modify the EMSO 'dll directory' settings using the EMSO GUI.


SourceForge.net LogoJohn Pye
Last modified: 19 February 2009