PLplot Installation Notes: Unix-based systems
---------------------------------------------

For non Unix-based systems, refer to the notes in sys/<system name>.

PLplot building and installation is trivially easy on most Unix systems.
From the distribution directory, type:

./configure
make
make install

IMPORTANT.  Only the Gnu form of the make command is supported.  This superior
version of make is documented at http://www.gnu.org/software/make/make.html
and can be downloaded from ftp://ftp.gnu.org/pub/gnu/make.

To find out what options are available for configure type
./configure --help |less

The most important option is --prefix as this determines where the files are
installed.  E.g.

./configure --prefix=$HOME/local/plplot

sets up $HOME/local/plplot as the home directory for the installed
package.

Another important option is --with-double, e.g.,

./configure --prefix=$HOME/local/plplot --with-double

This compiles the PLplot libraries with double precision floating point
rather than single precision.  Note, the python front end (also the
independent yorick front end, see yplot.sourceforge.net) only works if
the double precision is turned on.

An important new configure option available for Plplot-5.1.0 is
"--enable-dyndrivers", e.g.,

./configure --prefix=$HOME/local/plplot --with-double --enable-dyndrivers

which is mostly useful in systems that support shared libraries. Dynamic
drivers are dynamically loaded at run-time, reducing the PLplot library
size, easing software updates, and reducing the number of libraries that
your program and plplot libraries need to link against.

The package is actually built in the tmp directory.  You can build any of
a number of demo programs and run them from there.  Example:

./configure
cd tmp		(also "cd tmp; ../configure" works fine too)
make
make x01c
x01c

	<program presents you with a driver list, pick one>


Additional notes
----------------

The Makefile in the distribution directory just recursively invokes "make"
on the Makefile in tmp/.  The latter has many more targets so it's better
to build and test the package from there.  I provide the top-level
Makefile only as a convenience, since most GNU packages work that way.

Targets supported by the Makefile include:

	cdemos		All the C demos
	fdemos		All the Fortran demos
	tkdemos		All the extended wish (TK) demos
	jdemos		All the Java demos
	cxxdemos	The C++ demo
	x??[cf]		Demo number ??, C or fortran versions
	xtk??		Demo number ??, extended wish versions

By default, the configure script chooses the most powerful configuration
of PLplot supported on your system, based on a search for all the include
files and libraries that PLplot can use.  If it is unable to locate a
library that /is/ available on your system, either you need to change the
location of the library, put in a soft link to a more common place,
request for the directory to be added to the search path, or set up the
directory in a site specific way (more on that below).

"configure" IS NOW generated by the GNU autoconf facility, although
it didn't used to be.  Normally you don't need to create a new configure
script, just use the one that comes with the package.  See cf/README
for notes on how to recreate it if you really need to.

There are many ways in which to influence the configure process.  It's
best to run configure once to see what options are set already.  You can
enable/disable packages (or device drivers) with a --enable-<pkg> or
--disable-<pkg> switch, and set/unset options with a --with-<option> or
--without-<option> switch.  The value of each important flag is printed
near the end of the configuration process.  Here is an example:

-----------------------------------------------------------------------------
Example configuration results (edit and run ./config.status to modify):

system:         Linux-2.2.18
prefix:         /usr/local/bin
CC:             gcc -c          -O  
LDC:            gcc    
CXX:            g++ -c            -O 
LDCXX:          g++      
F77:            g77 -c           -O 
LDF:            g77    
INCS:            -I. -I/usr/lib/java//include -I/usr/lib/java//include/linux -I/opt/gnome/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/opt/gnome/include -I/opt/gnome/lib/gnome-libs/include
LIBS:            -litk3.1 -ltk8.3 -litcl3.1 -ltcl8.3 -L/usr/X11R6/lib -lX11 -ldl -lm -lg2c
LIB_TAG:        d
devices:         plmeta null xterm tek4010 tek4010f tek4107 tek4107f mskermit conex vlt versaterm dg300 png jpeg ps psc xfig ljii hp7470 hp7580 lj_hpgl ljiip imp xwin tk pbm gnome pstex ntk

Available device drivers
static:          xwin tk
dynamic:         plmeta null tek dg300 gd ps xfig ljii hpgl ljiip impress pbm gnome pstex ntk

with_shlib:     yes             with_double:    yes
with_debug:     no              with_opt:       yes
with_warn:      no              with_profile:   no
with_gcc:       yes             with_rpath:     yes

enable_xwin:    yes             enable_tcl:     yes
enable_tk:      yes             enable_itcl:    yes
enable_cxx:     yes             enable_python:  yes
enable_f77:     yes             enable_java:    yes
enable_octave:  yes             enable_gnome:   yes
-----------------------------------------------------------------------------

If you want to change to using e.g. double precision with optimization
turned on and no shared library, you could rerun configure by typing:

./configure --with-double --with-opt --without-shlib

Similarly, all device drivers can be enabled/disabled by using
--enable-<device> or --disable-<device>.  I treat the f77 interface layer
the same way since it's an "extra" capability.   Configure options
are as follows:

with-shlib	Build shared library if supported for your system
with-double	Use double precision floats
with-debug	Build with debugging on
with-opt	Build with optimization on
with-warn	Build with all warnings on
with-profile	Build with profiling turned on
with-f2c	Use f2c to compile Fortran interface
with-gcc	Use gcc as C compiler instead of default

(--without-<option> to disable)

enable-f77	Include Fortran interface
enable-<...>	Include "..." driver (if present) and all dependent code.

(--disable-<capability> to disable)

You can specify the installation directory by using the --prefix flag, e.g.:

./configure --prefix=$HOME/tools/plplot

If you want configure to remember certain settings each time it is run
for your site, you can create a file ~/config/cf_plplot.in.  If found,
this file is sourced by configure.  An example cf_plplot.in file is
given in the cf/README file.

------------------------------------------------------------------------------

To compile your own programs, use "plplot-config", eg:

cc  `plplot-config --cflags` myprog.c -o myprog  `plplot-config --libs`

which expands (on my system) to 

cc -I/usr/local/include -I. -I/usr/X11R6/include  myprog.c -o myprog -L/usr/local/lib -lplplot -ltclmatrix -ltk8.3 -ltcl8.3 -L/usr/X11R6/lib -lX11 -lgd -lpng -ljpeg -lz -ldl -lm -Wl,-rpath,/usr/local/lib 
