Programming Library Prerequisites

The Netpbm package as a whole uses over half a dozen external libraries, but you don't necessarily need to install them all in order to build Netpbm. Each library is used by a few Netpbm programs, and if you don't have the library, the Netpbm build will automatically skip building those parts. If the library is obscure, so is the part that requires it and you may not care to build it.

For most of these libraries, configure asks you whether you have it or not, and offers a default based on its attempt to determine for itself whether you have the library.

The following sections describe the prerequired libraries, how to get them, and what they're good for.

libjpeg

This is code that knows the JFIF format (commonly called JPEG). It is required to build the following Netpbm programs:

  • jpegtopnm
  • pamtotiff
  • pnmtojpeg
  • pnmtotiff
  • pnmtotiffcmyk
  • tifftopnm

    The TIFF converters need the JFIF library because there is a subformat of TIFF that uses JPEG compression. But it is possible to have a TIFF library that cannot handle that subformat and thus does not use the JFIF library, and in that case the Netpbm TIFF converter programs don't need it either. If you have such a TIFF library, you must manually modify your Makefile.config to state that fact. configure doesn't take care of that.

    ppmtompeg needs the JFIF library in order to create MPEGs from JPEGs (without the loss of quality that comes with converting from JPEG to PPM first). If you don't have the JFIF library, the build still builds ppmtompeg, but without that capability.

    You can get a JFIF library from the Independent JPEG Group (IJG). You need Release 6b or better. With earlier releases, Netpbm build fails with undefined jpeg symbols. The basic JFIF library installation procedure installs only the runtime part of the package -- you need the development part as well, so run 'make install-lib'. The JFIF library documentation erroneously calls this installing "the library itself." This apparently was written before shared libraries. With shared libraries, "the library itself" is part of the runtime installation, but install-lib still installs the compile-time stuff you need.

    libtiff

    This is code that knows the TIFF format. It is required to build the following Netpbm programs:

  • pamtotiff
  • pnmtotiff
  • pnmtotiffcmyk
  • tifftopnm You can get libtiff from libtiff.org.

    libpng

    This is code that knows the PNG format. It is required to build the following Netpbm programs:

  • pngtopnm
  • pnmtopng

    You can get libpng from libpng.org or Sourceforge. Older libpng won't work -- you get unresolved external references to png_sig_cmp and png_set_sig_bytes.

    libz

    This is compression code. It is required to build the following Netpbm programs:

  • pamtotiff
  • pnmtotiff
  • pnmtotiffcmyk
  • tifftopnm

    In addition, libz is required to build the flate compression feature of pnmtops. If you don't have it, you can still build pnmtops, but its -flate option won't work.

    (libz is also normally required to build Pnmtopng and Pngtopnm, but we don't list it here because that's technically not Netpbm's requirement, but libpng's. If you don't have libz, you don't have libpng either).

    You can get libz from the zlib web site.

    The TIFF converters need the LZW library because there is a subformat of TIFF that uses LZW compression. But it is possible to have a TIFF library that cannot handle that subformat and thus does not use the LZW library, and in that case the Netpbm TIFF converter programs don't need it either. If you have such a TIFF library, you must manually modify your Makefile.config to state that fact. configure doesn't take care of that.

    libX11

    This is code that displays stuff on an X Window System display. It is required to build the following Netpbm program:

  • pamx

    libX11 is part of any X Window System implementation, for example the one produced by x.org.

    libvga (Svgalib)

    This is code that displays graphics on a SVGA Linux virtual console. It is required to build the following Netpbm program:

  • ppmsvgalib

    libxml2

    This is code that generates and parses XML. It is required to build the following Netpbm program:

  • svgtopam

    Libxml2 must be Release 2.5.9 (August 2003) or newer, because Netpbm uses the 'xmlReaderTypes' type (defined in the <libxml/xmlreader.h> header file), which was added then.

    Utah Raster Toolkit

    The Utah Raster Toolkit is not a prerequisite because Netpbm includes a subset of it that meets the needs of Pnmtorle and Rletopnm. However, you can also substitute the real package by properly configuring Makefile.config. You can get it from here. There's also a patch for it.

    Program Prerequisites

    This section lists programs that you must have installed to run Netpbm programs.

    These programs need to be installed such that the OS finds them in its default search path (i.e. via the PATH evironment variable on unix systems).

    Ghostscript

    The following programs invoke Ghostscript, which is a Postscript interpreter:

    Note that the standard name for the main Ghostscript program (the one Netpbm uses by default) is gs.

    Build Tools

    Make

    You need GNU Make.

    C compiler

    Very old C compilers (in addition to current ones) are known to work.

    perl

    You need Perl Release 6 or later. The build configuration program and a few other programs that the build system uses are Perl programs.

    Note that some of the Netpbm programs (runtime components of Netpbm) are also Perl programs, so you'll need a Perl interpreter to run some of Netpbm as well.

    Lex

    You need Lex. GNU Flex is a form of Lex that works.

    pkg-config

    pkg-config is a system (and a program by that name) for finding things on a system. For example, a make file can use pkg-config to find out where on your system your PNG library is installed and what link options are needed to build a program that uses that PNG library.

    The Netpbm build system uses pkg-config to find out how to use the following libraries on your system:

    Note that normal Netpbm installation includes installing a netpbm.pc file so that so that other things can use pkg-config to use Netpbm.


    By Bryan Henderson, San Jose, CA; bryanh@giraffe-data.com last checked 2014.01.25.