Hi Sapan,

The JNI code in $PTII/jni is obsolete, see the code in
$PTII/ptolemy/actor/lib/jni instead.  I just marked the code
in $PTII/jni as deprecated.

The code uses gmake, the GNU make program.  Under Windows, you must
install Cygwin, see http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/cygwin.htm"and then you may need to make a symbolic link from gmake to make by
starting up Cygwin bash and doing:

cd c:/cygwin/usr/bin
ln -s make.exe gmake.exe

If you don't have gmake in your path, you might see the message you saw
which  occurs under Windows because the Windows, Java calls the Windows
CreateProcess function, which returns 2, which means that theexecutable, in this case, gmake cannot be found.

It looks like we don't have good step by step instructions for creating
a custom C actor using the newer JNI code in ptolemy.actor.lib.jni.
Your best bet is to look at the Scale demo in
and the demo that invokes the plotter at

Note that using JNI is somewhat tricky in that it requires knowledgen of
C and Java.  Also, programs that use JNI are more likely to have hard
crashes because the C portion can do anything, including segfault.


Sapan AGARWAL wrote:
Hi All,

I was trying to create a custom actor in C using JNI Actor. I am currently using 
Ptolemy6.0.2. I invoked vergil using "vergil -jni".But I do not see 
JNI/Generate C Interface as per documentation. Also when I drag the JNICodeGenerator 
actor and double click on it to generate the code, it gives me an error :

IOException: java.io.IOException: CreateProcess: gmake -C jni/testTrois -f 
JnijnitestTroisIfnTest.mk error=2

Can anyone please let me know the reason for this and what is the correct 
procedure to create custom actor in C using JNI ?

Thanks & Regards,
Sapan Agarwal

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

Christopher Brooks (cxh at eecs berkeley edu) University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718             (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480

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

Reply via email to