From: Ali M. <so...@sy...> - 2004-05-18 01:42:00
|
Hi, I am trying to build java binding on windows. The documentation provided = only talks about unix. I will appreciate it somebody can provide help.=20 Thanks -Ali |
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 __________________________ |
From: Ali M. <so...@sy...> - 2004-05-21 11:01:53
|
Hi Alan, I think I did manage to generate the dll. Now I am trying to run the example programs. I am getting following when I run. C:\>java plplot/examples/x01 Plotting Options: < 1> win3 PLplot Win32 Window < 2> plmeta PLplot Native Meta-File < 3> ps PostScript File (monochrome) < 4> psc PostScript File (color) < 5> null Null device Enter device number or keyword: 1 *** PLPLOT ERROR *** Unable to open or allocate memory for font file Program aborted Please help Thank you -Ali ----- Original Message ----- From: "Alan W. Irwin" <ir...@be...> To: "Ali Muhammad" <so...@sy...> Sent: Tuesday, May 18, 2004 8:49 PM Subject: Re: [Plplot-general] newbie question > On 2004-05-18 18:23-0400 Ali Muhammad wrote: > > > Dear Alan, > > > > Thank you for the advice. It was very useful. It helped me understand the > > build process. I did manage to generate the dll and also managed to compile > > the example java files. Right now I am struggling with running these > > examples. > > > > C:\>java plplot.examples.x01 > > Native code library failed to load. See the chapter on Dynamic Linking > > Problems > > in the SWIG Java documentation for help. > > java.lang.UnsatisfiedLinkError: > > C:\plplot\plplot-5.3.0\sys\win32\msdev\plpdll: A > > ccess is denied > > > > Hi Ali: > > Sounds like you have made a lot of progress, and you are close to success. > > If that were Linux (which of course it isn't), I would say that error > message means the file name doesn't exist (wrong spelling or directory > location in config.java?), or it has the wrong permissions, or it was built > from the wrong source (plpdll should be built from plplotjavac_wrap.c), or > it wasn't built quite right for a native dll that can be dynamically loaded > by java. If the first three simple explanations don't apply, it is probably > time to hit the java native dll tutorials for Windows to find out exactly > what compile and link options you need for a dll loaded by the System.load > command. (That command is in PLStreamc.java, and you will note that it uses > libname, the variable you define in config.java.) > > Google found me some Linux java tutorials that mentioned System.load > so I assume there are also similar tutorials for Windows. > > Good luck getting this final step to work and documenting the steps you took. > > Furthermore, once you get java to work on Windows, I hope you can also give > me some advice on how to make a user-friendly interface. See my comments > about this in bindings/java/README.javaAPI. The truth is my java experience > is minimal and consists of rather mechanical extension of the java examples > based on what was done before. I inherited the hand-crafted interface from > somebody else, but I knew enough about swig so I could generalize that > hand-crafted approach quite easily with swig. So I am proud we have a Java > interface and want to maintain it, but that interface and making sure all > the examples work under Linux is the totality of my Java experience. Thus, > I am definitely open to advice from developers more expert than me in the > Java language. > > 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 > __________________________ |
From: Arjen M. <arj...@wl...> - 2004-05-24 07:03:11
|
Ali Muhammad wrote: > > Hi Alan, > > I think I did manage to generate the dll. Now I am trying to run the example > programs. I am getting following when I run. > > C:\>java plplot/examples/x01 > > Plotting Options: > < 1> win3 PLplot Win32 Window > < 2> plmeta PLplot Native Meta-File > < 3> ps PostScript File (monochrome) > < 4> psc PostScript File (color) > < 5> null Null device > > Enter device number or keyword: 1 > > *** PLPLOT ERROR *** > Unable to open or allocate memory for font file > Program aborted > > Please help > I think this is due to the font files not being found. The quickest way: copy the *.fnt files you find in the data directory into the directory where you start your program (there are also two environment variable you can set: PLPLOT_LIB and PLPLOT_HOME). The new chapter on deployment in the documentation holds more information about this. Regards, Arjen |