EQUIP2 C++ Introduction
Chris Greenhalgh, 2006-03-29; last updated 2007-06-06
Introduction
EQUIP v.1 was originally written in C++ and then ported to Java. The
two versions then had to be maintained and cross-patched in parallel.
This tended not to work. Later on the Java version was ported to C#
with the help of the Visual Studio porting tool, plus manual fix-ups.
This suffered from the same problems, and the Java version is now the
only stable/reliable/maintained version.
To avoid this issue, for EQUIP2, I have written a Java-to-C++
translator, which will convert the Java reference version to C++,
currently targetting Posix/Unix, Windows OS and Symbian (used on mobile
phones).
If you haven't already, you should probably now look at EQUIP2_CPP_Programming.html
before coming back here for build information.
This means all cross-language development should be done on the Java
version!!
This can currently be obtained from the same CVS as EQUIP2 in the
parallel javatrans directory:
CVSROOT :pserver:anonymous@dumas.mrl.nott.ac.uk:/mrl/src/cvsroot
/Equator/javatrans
This is likely to move, e.g. to sourceforge, before too long.
Documentation
Probably best to start with EQUIP2_CPP_Programming.html.
For general documentation on the translator, including build and usage
information see ../../javatrans/docs/Javatrans_introduction.html
Building the C++ version
You need a version of javatrans (as above), compiled, and the
javasupport library compiled - see Javatrans_introduction.html
You need to set the property javatranshome
in ../build.properties to
point to this javatrans installation (its top-level directory).
The translation is supported by the equip2 ANT build file, in
particular:
- ant cpp
- compile the translated subset of equip2 (ant cpp_compile) and translate
using javatrans (ant cpp_generate).
The java subset of equip2 to be translated will be compiled into build.cpp/classes. The
generated c++ files will be placed in build.cpp/src.cpp; headers will
be copied over to dist/include.
Similarly, a minimal interface/implementation of Log4j is comiled
into build.cpp/log4j.classes,
C++
files generated in build.cpp/log4j.src.cpp
; headers will
be copied over to dist/include.
Similarly, tests are comiled into build.cpp/test.classes,
C++
files generated in build.cpp/test.src.cpp
These can be compiled by target platform-specific scripts in the
subdirectories of the top-level
targets/ directory, currently:
- targets/win32/
- these require the environment variable JAVATRANSHOME to be
set as per
the javatranshome
property, above
- buildlog4j-win32.bat
- compiles the translated log4j subset to make dist/win32/log4j.dll
and .lib (for win32)
- buildequip2-win32.bat - compiles
the equip2 sources to make the dist/win32/equip2.dll
and .lib (for win32);
this requires that the minimal log4j implementation has
already been built.
- buildequip2test-win32.bat
- compiles the tests to the main executable dist/win32/equip2test.exe.
- targets/unix/
- these require the environment variable JAVATRANSHOME to be
set as per
the javatranshome
property, above
- buildlog4j.sh -
dist/unix/liblog4j.a
- buildequip2.sh -
dist/unix/libequip2.a
- buildequip2test.sh -
dist/unix/libequip2test.a
Known issues
- See general Javatrans known issues, Javatrans_introduction.html
- I have only tried porting a subset of EQUIP2 - the main APIs and
the default (transient) dataspace. In other words there is currently no
persistent C++ dataspace implementation. This will require more
supporting classes to be implemented (e.g. java.io.File,
java.io.FileInput/OutputStream) and/or a new native C++ implementation
using OS-specific APIs (the best option on Symbian, I think).
- I have not attempted to port PART (yet), so no networking support.
- The Java version includes Javadoc documentation (in the source
code and available as generated web-pages using the Javadoc tool);
these are not copied into the C++ version, so you must refer to these
directly for method and class usage.
Change log
2007-06-06
2007-05-30
- documented multiple targets structure
2007-01-26
2006-05-09
2006-05-04
- added local build information
2006-03-29