This package provides a draft implementation of a way to create actors that call native C code. In Java, the Java Native Interface (JNI) is used to interface with C code. This package and subpackages provide glue code that make it easier to create actors that call C functions.
Under Windows, JNI has problems with recent versions of Cygwin and GCC after gcc3.2.x. One workaround is to use Microsoft Visual C. Another workaround is to invoke Ptolemy by using the launcher program written in C, which is found at $PTII/jni/launcher.
The launcher program is from http://elliotth.blogspot.com/2005/08/porting-jni-code-to-win32-with-cygwin.html
The .cpp and .h files in the launcher directory are from salma-hayek, found at http://software.jessies.org/terminator/ salma-hayek is LGPL'd, see the COPYING.txt file.
If you invoke $PTII/bin/vergil -jni
, then the launcher
program will be invoked for you. If you do not use the launcher program
under Windows with Cygwin, the Ptolemy is likely to exit when you run
a model that tries to load a JNI shared object.
Another alternative is to install the version of Cygwin that shipped with Ptolemy II 4.0, see http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII4.0/cygwin.htm
The Interface to C actors using the Java Native Interface is not available via the Windows Installer (or Web Start). To use the JNI/Ptolemy II interface, you must download Ptolemy II as source files and compile.
To build under Windows, you may need to edit jni_md.h
,
see
JNIUtilities.html (javadoc, if present)
or
JNIUtilities.java (source, if present).
Under Windows with Cygwin, you may need to create
/usr/bin/gmake
:
cp /usr/bin/make /usr/bin/gmake
A demo can be found in
$PTII/jni/demo/jni
See the README.html
file in that directory. To run
the demo, you should start vergil in that directory.
JNI will not work with Hierarchical classes, subclasses, and inner classes.
@since Ptolemy II 0.2