From: Alan W. I. <ir...@be...> - 2006-09-13 18:39:34
|
On 2006-09-13 10:11-0700 Joe Chuma wrote: > So, the answer is that if the plplot wxwidgets driver is used within an > application, the plplot library must be installed on the target machine? Yes. > There is no way to distribute a self-contained executable image of an > application which uses the wxwidgets driver? No. As I explained, wxwidgets.so and libplplot.so normally must be separate since they are written in two different languages (C++ and C). > Building the plplot libs, with the wxwidgets driver, requires the target > machine to also have the wxwidgets package already installed. Yes. In fact, to use wxwidgets.so you must have the wxwidgets software package installed since all wxwidgets.so does is provide an interface between PLplot and the wxwidgets software package. > So, an > app which uses the plplot wxwidgets driver cannot be distributed as an > executable image. That conclusion is incorrect. If you link your app correctly, and supply all the required bits and pieces of PLplot, there should be no problems. The whole point of shared libraries and plug-ins is to keep logically distinct things separate rather than putting all code into one giant library. This approach actually minimizes the size of what you have to distribute since you only have to include the bits and pieces of PLplot that you need rather than everything. However, the trick is figuring out the exact bits and pieces that you need (see below). Your C app should link to the core PLplot library which supplies fundamental plotting routines such as the surface plots that you need. When your app asks for the wxwidgets device, then that core library dynamically loads the wxwidgets.so plug-in which supplies a PLplot interface to the wxwidgets library which your application can use with normal PLplot commands. So you only have to distribute the core PLplot library (consisting of the actual library and some additional support files) and wxwidgets.so, and your user has to have the wxwidgets package of software installed. As I explained at the start of this thread, this approach is not particularly easy to figure out. There will not be a lot of additional support files you have to distribute from your PLplot install on your original machine, but you will have to do some experimentation to see which files are actually required. The approach of using shared libraries and plug-ins is standard for most software these days. Therefore, you should familiarize yourself with this approach if you plan to distribute software. PLplot also provides the old-fashioned way of doing things; use static libraries and disable dynamic devices with all device driver code lumped into the core library. One disadvantage of that approach is your various apps become huge in size since they all contain duplicated code. More fundamentally, that old-fashioned approach does not work for wxwidgets.so since that device is written in C++ (as in the wxwidgets software package), and the PLplot core code is written in C. Mixing C and C++ code in the same library should be avoided because it can cause linking problems. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); 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 __________________________ |