From: Alan W. I. <ir...@be...> - 2004-05-18 04:15:19
|
On 2004-05-17 21:41-0400 Ali Muhammad wrote: > I am trying to build java binding on windows. The documentation provided only talks about unix. I will appreciate it somebody can provide help. I think building java binding on windows is possible since the java interface C file and other essential java interface wrappers that are generated by swig are all part of the tarball. But as far as I know, a Java interface to PLplot on windows has never been done before. Also, I have no windows expertise so you will have to infer what to do on the Windows side from what is currently done on the Linux/Unix side of things which I will now explain. What is done with the tarball java files is pretty straightforward on the Linux side so it shouldn't be that difficult to follow. In particular our installation procedure creates the following tree in the install area. ./plplot/core/README.javaAPI ./plplot/core/PLStreamc.java ./plplot/core/config.java ./plplot/core/SWIGTYPE_p_p_char.java ./plplot/core/plplotjavac.java ./plplot/core/plplotjavacJNI.java ./plplot/core/plplotjavacConstants.java ./plplot/core/plplotjavac_wrap.so ./plplot/core/PLStreamc.class ./plplot/core/SWIGTYPE_p_p_char.class ./plplot/core/config.class ./plplot/core/plplotjavac.class ./plplot/core/plplotjavacConstants.class ./plplot/core/plplotjavacJNI.class ./plplot/examples/README.javademos ./plplot/examples/x01.java ./plplot/examples/x02.java ./plplot/examples/x03.java ./plplot/examples/x04.java ./plplot/examples/x05.java ./plplot/examples/x06.java ./plplot/examples/x07.java ./plplot/examples/x08.java ./plplot/examples/x09.java ./plplot/examples/x10.java ./plplot/examples/x11.java ./plplot/examples/x12.java ./plplot/examples/x13.java ./plplot/examples/x14.java ./plplot/examples/x15.java ./plplot/examples/x16.java ./plplot/examples/x17.java ./plplot/examples/x18.java ./plplot/examples/x19.java ./plplot/examples/x01.class ./plplot/examples/x02.class ./plplot/examples/x03.class ./plplot/examples/x04.class ./plplot/examples/x05.class ./plplot/examples/x06.class ./plplot/examples/x07.class ./plplot/examples/x08.class ./plplot/examples/x09.class ./plplot/examples/x10.class ./plplot/examples/x11.class ./plplot/examples/x12.class ./plplot/examples/x13.class ./plplot/examples/x14.class ./plplot/examples/x15.class ./plplot/examples/x16.class ./plplot/examples/x17.class ./plplot/examples/x18.class ./plplot/examples/x19.class I assume you mostly know on the Windows side of thing how to create a similar directory tree using the swig-generated java files from the tarball. The only difficult file I am aware of is ./plplot/core/plplotjavac_wrap.so. That is the actual wrapper library under Linux is created with the following two commands under Linux on my system which happens to have a peculiar location for java, hence all the strange -I options. gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -I../../include \ -I../../libltdl -I/home/software/java/IBMJava2-14/include \ -I/home/software/java/IBMJava2-14/include -g -O2 -mieee-fp -c \ plplotjavac_wrap.c -Wp,-MD,.deps/plplotjavac_wrap.TPlo -fPIC -DPIC -o \ .libs/plplotjavac_wrap.o gcc -shared .libs/plplotjavac_wrap.o -Wl,--rpath \ -Wl,/usr/local/plplot_at/lib \ -L/home/software/plplot_cvs/HEAD/plplot_devel/lib/nn/.libs \ -L/home/software/plplot_cvs/HEAD/plplot_devel/lib/csa/.libs -L/usr/lib/ \ -L/usr/local/plplot_at/lib -lplplotd -lm -mieee-fp -Wl,-soname \ -Wl,plplotjavac_wrap.so -o .libs/plplotjavac_wrap.so The first command compiles the tarball-supplied plplotjavac_wrap.c, and the second command links the result into a shared object (I think you call that a DLL on the windows side of things). So you should be okay if you know how to compile and link on windows. My best guess for those steps is you should follow what is done to compile and link libplplot itself on windows, and then install the result in the above tree. Then you will have to edit config.java.in from the tarball to point to the correct absolute location of the shared object (or DLL?) you just installed. For example, after Unix configuration (which puts the configured result from config.java.in into config.java, my resulting config.java file has the following line: public static String libname = "/usr/local/plplot_at/lib/java/plplot/core/plplotjavac_wrap.so"; (My particular absolute installation prefix for the above plplot java interface tree is /usr/local/plplot_at/lib/java so you will have to adjust the line in your own config.java according to where you have installed the above plplot tree containing the java interface.) Finally, you will have to java compile all the *.java files in the above tree that you copied from the tarball (or edited from config.java.in for the config.java case). But that should be straightforward so the only difficult part is compiling and linking the shared object, and I hope I have given you enough details on that so it should be straightforward for you. Anyhow, good luck, and if you get the java interface to PLplot to work on windows, please document what you did so we can add it to the windows instructions for PLplot to make it easier for other windows users to follow what you have done. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |