Replace legacy graphing/plotting components with GNU plotutils -------------------------------------------------------------- Abstract: This case proposes to remove libplot, graph, and spline from ON, and replace them by integrating GNU plotutils into SFW. Background: We want to remove the native support for legacy plot(4B) from Solaris, particularly from the postscript tools and the printing subsystem. (This is the subject of case PSARC 2009/586). However, there are still some other pieces of Solaris that potentially depend on that infrastructure, and this case is about resolving that dependency. Additionally, these components (graph, split, and libplot) are very old, and largely unmaintained (and frankly have no need to be in ON in any case.) Solaris libplot has other worse problems with it: * functions are all MT Unsafe * output device format is selected at *link* time -- link with -l300s gives output for GSI 300S terminal, -lplot gives plot(4B) data, -l4014 for Tek 4014 output, etc. This model is inherently unfriendly for applications The GNU plotutils ----------------- The GNU project has created a "plotutils" package (home page at http://www.gnu.org/software/plotutils/) which aims to be primarily compatible with the legacy components, but which is well maintained (a new release -- version 2.6 -- was made as recently as Sept. 9, 2009, although the web page is slightly out of date). GNU plotutils has several things it delivers: * libplot application library. This library was originally designed as a drop-in replacement for the legacy UNIX libplot. However, it has been enhanced in a number of significant ways: - many new function calls and features - enhanced support for fonts, including builtin Hershey fonts - native support for numerous output devices (determined by the application) without a need to relink - thread safe versions of functions - internal support for "GNU Metafile" format, which is upwardly compatible with the legacy plot(4B) format * libplotter C++ library. This library is not installed by default, and we are not planning on delivering it either, largely to avoid possible confusion regarding C++ ABI issues. (Someone else could integrate this later if they felt so compelled, and were willing to deal with the potential C++ headaches.) * plotting output and format conversion utilities (see materials directory for actual man pages): - plot -- can convert plot(4B) or GNU Metafile into many formats. Specifically: X11 window, png, pnm, gif (without LZW), SVG, CGM, xfig, Encapsulated PostScript, Adobe Illustrator, PCL5, HPGL/2, ReGIS, Tek4014, and GNU Metafile. It also has lots of advanced features like changing background and pen colors, adjusting fonts, adjusting pen-width, rotating the image, etc. - tek2plot -- can convert Tektronix graphics files to any of the same formats supported by plot - pic2plot -- can convert troff pic to any of the same formats. We are not planning on delivering this in our integration, as it is not installed by default, and is unlikely to be particularly useful to our users. (Would depend on libplotter.) - plotfont -- produces a character map for any font that is supported by the output format (supports all the same output formats). - hersheydemo -- produces a demonstration of the Hershey builtin fonts on a supported output * mathematical utilities: graph, spline, and ode applications - graph - enhanced version of graph(1), but outputs the desired output format directly, so it can be used without "plot". However There are some incompatibilities, see below. - spline - enhanced version of spline(1). This appears to be a fully compatible upgrade to spline(1), although the output format is understood by the plotutils version of graph, and is not understood by legacy Solaris graph. - ode - a numerical solver for ordinary differential equations. This tool generates GNU Metafile format output, which can be plotted by the plotutils graph utility. - double - this utility is a filter for converting, scaling and cutting binary or ASCII data streams. It is not documented, hence will only be getting "Volatile" stability. * support files - there are a variety of demonstration files for "ode" and "tek2plot" that can be used to demonstrate these utilities. These are delivered into ${prefix}/share/ode and ${prefix}/share/tek2plot ($prefix will be /usr for our integration) - info files and man pages There are man pages for the utilties (except hersheydemo and graph) as well as a master info page for the entire plotutils package (although hersheydemo does not appear to be documented at all). - supporting text files -- ${prefix}/share/libplot has some additional information about fonts, colors, stored as ASCII text files. While these files are not necessary to operate the software, they provide useful information to end users. - header files -- there are two header files, plot.h and plotcompat.h. More is discussed on those below. Incompatibilities ----------------- There are some incompatibilities that we feel deserve to be fully examined and understood, which is why this case is not a Fast Track. * Binary incompatbility of libplot. The libplot library is not compatible with the legacy Solaris libplot. While we expect that there are very few, if any, consumers of libplot out there (Solaris libplot was incredibly awkward to use, thanks to poor tool support for plot(4B)), it is possible that this change will break some legacy Solaris applications. We point out that the S10C project may offer such applications an alternative route if they are found. Its not clear what the commitment level of the libplot interfaces are, since they appear to predate ARC. Certainly the legacy library itself is very poorly designed and not terribly usable in modern applications. (See the problems with link time resolution for output format, and MT unsafety already mentioned.) * Source incompatibility. The GNU plotutils library uses pl_ prefixes on its symbol names. In nearly every other respect the code is upwardly compatible for legacy libplot source consumers. To work around this problem, there is a plotcompat.h header which may be included by such legacy source and renames the pl_xxx symbols to the legacy equivalents. While unfortunate, this problem should not be too onerous to develpers. (We believe that developers that compile on Linux or other FOSS systems already will have had to make this adjustment.) * File formats. The GNU plotutils library includes support for the legacy plot(4B) input format, but the tools normally do not generate this legacy format. When using the legacy input files for plot(1), it may be necessary to specify a command line option to force the correct endiannes interpretation. This should be a mostly transparently compatible "upgrade", as long as nobody expects to be able to use the output from the new tools on older systems. * graph(1) command line options. There are some incompatibilities in the command lines understood by graph(1). -l -- legacy graph takes this to mean a label, plotutils graph uses it to indicate that either the X or Y axis is logarithmic instead of linear. -x and -y take an optional argument "l" to indicate a logarithmic axis in legacy graph. plotutils does not support this form. -b and -c from legacy graph are not understood by plotutils graph While there is a good chance that these differences will annoy someone, we believe that the total number of people who will be affected will be very very small. Additionally, many more people coming from Linux are likely to appreciate the equivalent command line switches with Linux that integration of plotutils would bring. Imported Interfaces ------------------- Only standard Committed interfaces are imported. (E.g. libc, X11 libraries.) Exported Interfaces ------------------- /usr/lib/lib300.so Removed Also the 64-bit equivalents. /usr/lib/lib300s.so Removed Also the 64-bit equivalents. /usr/lib/lib4014.so Removed Also the 64-bit equivalents. /usr/lib/lib450.so Removed Also the 64-bit equivalents. /usr/lib/libvt0.so Removed Also the 64-bit equivalents. /usr/lib/libplot.so See notes Replaced. All of the previous runtime (ABI) interfaces removed. New ABI interfaces Uncommitted. Also applies to 64-bit equivalent. See notes Replaced, previous API available via Uncommitted Supports older API. /usr/bin/graph See notes Some options removed, many new ones imported, output format changed to GNU metafile. Input file format and command line options Uncommitted. /usr/bin/graph Uncommitted. Including command line options. /usr/bin/spline Uncommitted. Including command line options. /usr/bin/oed Uncommitted. Including command line options. /usr/bin/plot Uncommitted. Including command line options. /usr/bin/tek2plot Uncommitted. Including command line options. /usr/bin/plotfont Uncommitted. Including command line options. /usr/bin/double Volatile. Entirely undocumented. /usr/bin/hersheydemo Volatile. Entirely undocumented. /usr/share/libplot Volatile. Directory, supporting text files. /usr/share/tek2plot Volatile. Directory, sample Tektronix files. /usr/share/ode Volatile. Directory, ode demo files. plotutils.info Committed GNU info format documentation, delivered in /usr/share/info. tex2plot.1 Committed Man pages, in /usr/share/man/man1 plot.1 " " " " plotfont.1 " " " " spline.1 " " " " ode.1 " " " " plot(4B) Obs Committed File format, will remove man page, since it references other removed components. GNU metafile format Uncommitted. File format.