The JNI interface does not work very well.
See 
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII4.0/ptII4.0.1/doc/ptII4.0.release.htm
or $PTII/doc/ptII4.0.release.htm

--start--
Limitations in JNI
# 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.
# The JNI user interface does not permit creation of new JNI actors.

If you follow the instructions in JNIUtilities, then eventually you
will get a NameDuplicationException.

The resulting model will be missing

<property name="output" class="jni.Argument"
value="false,false,true,double">
</property>

We are working with the original authors on a solution.
In the short term, one workaround is to edit the xml file directly and
add the appropriate property by hand.
# JNI will not work with Hierarchical classes, subclasses, and inner
classes 
--end--

Also, if Ptolemy exits when running the JNI model, then
try using gcc-3.2.x in the Cygwin installer from
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII5.0/cygwin.htm
which includes gcc-3.2.x

The 
    BASH: cant cd "Ptolemy/ptII4.0.1/"  "Sun/AppServer/jdk/bin".....
error message you report makes no sense to me.  Can you copy and
paste the contents of the Cygwin bash window?  To do this, highlight
the text by left clicking in the Cygwin bash window and dragging the
mouse over the text.  Then hit the Enter key to put the text into
the cut buffer.

Note that to use the JNI interface, you must rebuild Ptolemy II
from sources.

$PTII/bin/vergil -jni should work for you, I just verified that
it brings up JNI for me after I've installed Ptolemy II 4.0.1
from the Windows installer and then rebuilt.

You might need to do
  export PTII=c:/Ptolemy/ptII4.0.1
  $PTII/bin/vergil -jni

For information about using JNI, see $PTII/jni/demo/jni/README.htm

BTW - Don't include /cygdrive/c in your CLASSPATH.
Java does not understand /cygdrive/c
See
"Cygwin Directory Mapping" in
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII4.0/ptII/doc/install.htm
or $PTII/doc/install.htm

Instead, you would do:

CLASSPATH=c:/Ptolemy/ptII4.0.1
export CLASSPATH

or
export CLASSPATH=c:/Ptolemy/ptII4.0.1

_Christopher

--------

    hi
    I m trying to open vergil with jni interface enabled.
    
    1.created a c file called "meaningOfLife.c" which contains
                              double meaningOfLife(){
                              return 42.0 ;
                              }
    
    2. created a header file called "meaningOfLife.h" which contains
                             extern "c" double meaningOfLife();
    
    3. $gcc -shared -o meaningOfLife.dll meaningOfLife.c
    
    4. $ CLASSPATH=/cygdrive/c/Ptolemy/ptII4.0.1
        $ export CLASSPATH
    
    5. $ ./vergil
    BASH: cant cd "Ptolemy/ptII4.0.1/"  "Sun/AppServer/jdk/bin".....
    
    what may be the problem?
    even i have tried  $vergil -jni,  $PTII/bin/vergil -jni.   It says no such 
    command or file name.
    
    Could anybody please enlighten me.
    
    with luv,
    karthik venkatesh
    
    _________________________________________________________________
    Manage information better. Optimise your tasks. 
    http://www.microsoft.com/india/office/experience/  Experience MS Office 
    System.
    
    
    ---------------------------------------------------------------------------
   -
    Posted to the ptolemy-hackers mailing list.  Please send administrative
    mail for this list to: [EMAIL PROTECTED]
--------

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to