% cd ./tiff-4.0.5 % cmake ...lots of messages... % make ...lots of messages... % make test ...lots of messages... # make install
In general, the software is designed such that the following targets will always be available
make [all] build stuff make test run the test suite make install build and install stuff make clean remove object files, executables and cruft
% gzip -dc tiff-4.0.5.tar.gz | tar -xf - % cd ./tiff-4.0.5 % cmake % make % make test % make install
Otherwise, you can configure a build tree that is parallel to the source tree hierarchy (or in some completely different place) but which contains only configured files and files created during the build procedure.
% gzip -dc tiff-4.0.5.tar.gz | tar -xf - % mkdir tiff-4.0.5-build % cd ./tiff-4.0.5-build % cmake ../tiff-4.0.5 % make % make test % make install
cmake -G Ninja cmake --build . ctest -V cmake --build . --target install
Note that cmake --build . is a build-system-independent way of building a target; you can always use the build system directly.
Alternatively, using the MSBuild system on Windows (64-bit Release build with VS2013):
cmake -G "Visual Studio 12 2013 Win64" cmake --build . --config Release ctest -V -C Release cmake --build . --config Release --target installWith the above configuration, it's also possible to open the generated solution file with the Visual Studio IDE as well as building on the command-line.
A second function of the configure script is to set the default configuration parameters for the software. Of particular note are the directories where the software is to be installed. By default the software is installed in the /usr/local hierarchy. To change this behaviour the appropriate parameters can be specified on the command line. Run cmake --help to get a full list of possible options, and cmake -LH to list all the configurable options for this software package, or cmake -LAH to show all advanced options in addition. Standard installation related options are shown below.
Installation directories: CMAKE_INSTALL_PREFIX Fine tuning of the installation directories: CMAKE_INSTALL_BINDIR user executables [PREFIX/bin] CMAKE_INSTALL_SBINDIR system admin executables [PREFIX/sbin] CMAKE_INSTALL_LIBEXECDIR program executables [PREFIX/libexec] CMAKE_INSTALL_SYSCONFDIR read-only single-machine data [PREFIX/etc] CMAKE_INSTALL_SHAREDSTATEDIR modifiable architecture-independent data [PREFIX/com] CMAKE_INSTALL_LOCALSTATEDIR modifiable single-machine data [PREFIX/var] CMAKE_INSTALL_LIBDIR object code libraries [PREFIX/lib] CMAKE_INSTALL_INCLUDEDIR C header files [PREFIX/include] CMAKE_INSTALL_OLDINCLUDEDIR C header files for non-gcc [/usr/include] CMAKE_INSTALL_DATAROOTDIR read-only arch.-independent data root [PREFIX/share] CMAKE_INSTALL_DATADIR read-only architecture-independent data [DATAROOTDIR] CMAKE_INSTALL_LOCALEDIR locale-dependent data [DATAROOTDIR/locale] CMAKE_INSTALL_MANDIR man documentation [DATAROOTDIR/man] CMAKE_INSTALL_DOCDIR documentation root [DATAROOTDIR/doc/tiff]Also see the CMake documentation for additional variables which may be set.
This option controls whether or not to configure the software to build a shared and static binaries for the TIFF library. Use of shared libraries can significantly reduce the disk space needed for users of the TIFF software. If shared libraries are not used then the code is statically linked into each application that uses it.
ld-version-script[=ON|OFF] Enable linker version script (default is ON)
Add shared library symbol versioning on ELF-based systems (e.g. Linux and FreeBSD) which use the GNU linker. This is needed if several major versions of libtiff might be loaded at once into the same program.
% cd ./tiff-4.0.5 % ./configure ...lots of messages... % make ...lots of messages... % make check ...lots of messages... # make install
In general, the software is designed such that the following should be ``make-able'' in each directory:
make [all] build stuff make check run the test suite make install build and install stuff make clean remove object files, executables and cruft make distclean remove everything, that can be recreated
% gzip -dc tiff-4.0.5.tar.gz | tar -xf - % cd ./tiff-4.0.5 % ./configure % make % make check % make install
Otherwise, you can configure a build tree that is parallel to the source tree hierarchy (or in some completely different place) but which contains only configured files and files created during the build procedure.
% gzip -dc tiff-4.0.5.tar.gz | tar -xf - % mkdir tiff-4.0.5-build % cd ./tiff-4.0.5-build % ../tiff-4.0.5/configure % make % make check % make install
A second function of the configure script is to set the default configuration parameters for the software. Of particular note are the directories where the software is to be installed. By default the software is installed in the /usr/local hierarchy. To change this behaviour the appropriate parameters can be specified on the command line to configure. Run ./configure --help to get a full list of possible options. Standard installation related options are shown below.
Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/tiff] --htmldir=DIR html documentation [DOCDIR] Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names
These options control whether or not to configure the software to build a shared and static binaries for the TIFF library. Use of shared libraries can significantly reduce the disk space needed for users of the TIFF software. If shared libraries are not used then the code is statically linked into each application that uses it. By default both types of binaries is configured.
--enable-rpath Enable runtime linker paths (-R libtool option)
Add library directories (see other options below) to the TIFF library run-time linker path.
--enable-ld-version-script Enable linker version script (default is disabled)
Add shared library symbol versioning on ELF-based systems (e.g. Linux and FreeBSD) which use the GNU linker. This is needed if several major versions of libtiff might be loaded at once into the same program.
The source package is delivered using Unix line termination conventions, which work with MSVC but do not work with Windows 'notepad'. If you use unzip from the Info-Zip package, you can extract the files using Windows normal line termination conventions with a command similar to:
unzip -aa -a tiff-4.0.5.zip
By default the nmake-based libtiff build does not depend on any additional libraries. Normally libtiff should be built with at least JPEG and ZIP support so that it can open JPEG and ZIP-compressed TIFF files. In order to add additional libraries (e.g. libjpeg, zlib, jbigkit), build those libraries according to their own particular build instructions, and then edit 'nmake.opt' (using a capable plain-text editor) to enable use of the libraries, including specifying where the libraries are installed. It is also necessary to edit libtiff/tiffconf.vc.h to enable the related configuration defines (JPEG_SUPPORT, OJPEG_SUPPORT, PIXARLOG_SUPPORT, ZIP_SUPPORT), or to disable features which are normally included by default. Ignore the comment at the top of the libtiff/tiffconf.vc.h file which says that it has no influence on the build, because the statement is not true for Windows. Please note that the nmake build copies tiffconf.vc.h to tiffconf.h, and copies tif_config.vc.h to tif_config.h, overwriting any files which may be present. Likewise, the 'nmake clean' step removes those files.
To build using the provided makefile.vc you may use:
C:\tiff-4.0.5> nmake /f makefile.vc clean C:\tiff-4.0.5> nmake /f makefile.vc or (the hard way) C:\tiff-4.0.5> cd port C:\tiff-4.0.5\port> nmake /f makefile.vc clean C:\tiff-4.0.5\port> nmake /f makefile.vc C:\tiff-4.0.5> cd ../libtiff C:\tiff-4.0.5\libtiff> nmake /f makefile.vc clean C:\tiff-4.0.5\libtiff> nmake /f makefile.vc C:\tiff-4.0.5\libtiff> cd ..\tools C:\tiff-4.0.5\tools> nmake /f makefile.vc clean C:\tiff-4.0.5\tools> nmake /f makefile.vc
This will build the library file libtiff\libtiff\libtiff.lib.
The makefile also builds a DLL (libtiff.dll) with an associated import library (libtiff_i.lib). Any builds using libtiff will need to include the LIBTIFF\LIBTIFF directory in the include path.
The libtiff\tools\makefile.vc should build .exe's for all the standard TIFF tool programs.
$ SET DEFAULT DISK:[TIFF.CONTRIB.VMS] $ RENAME [.LIBTIFF]*.* [-.-.LIBTIFF] $ RENAME [.TOOLS]*.* [-.-.TOOLS]
$ SET DEFAULT DISK:[TIFF.LIBTIFF] $ @MAKEVMS
$ SET DEFAULT DISK:[TIFF.TOOLS] $ @MAKEVMS
$ DEFINE TIFFSHR DISK:[TIFF.LIBTIFF]TIFFSHR $ FAX2PS :==$DISK:[TIFF.TOOLS]FAX2PS $ FAX2TIFF :==$DISK:[TIFF.TOOLS]FAX2TIFF $ GIF2TIFF :==$DISK:[TIFF.TOOLS]GIF2TIFF $ PAL2RGB :==$DISK:[TIFF.TOOLS]PAL2RGB $ PPM2TIFF :==$DISK:[TIFF.TOOLS]PPM2TIFF $ RAS2TIFF :==$DISK:[TIFF.TOOLS]RAS2TIFF $ RGB2YCBCR :==$DISK:[TIFF.TOOLS]RGB2YCBCR $ THUMBNAIL :==$DISK:[TIFF.TOOLS]THUMBNAIL $ TIFF2BW :==$DISK:[TIFF.TOOLS]TIFF2BW $ TIFF2PS :==$DISK:[TIFF.TOOLS]TIFF2PS $ TIFFCMP :==$DISK:[TIFF.TOOLS]TIFFCMP $ TIFFCP :==$DISK:[TIFF.TOOLS]TIFFCP $ TIFFDITHER:==$DISK:[TIFF.TOOLS]TIFFDITHER $ TIFFDUMP :==$DISK:[TIFF.TOOLS]TIFFDUMP $ TIFFINFO :==$DISK:[TIFF.TOOLS]TIFFINFO $ TIFFMEDIAN:==$DISK:[TIFF.TOOLS]TIFFMEDIAN $ TIFFSPLIT :==$DISK:[TIFF.TOOLS]TIFFSPLIT $ YCBCR :==$DISK:[TIFF.TOOLS]YCBCR
This release has been tested on OpenVMS/VAX 5.5-2, using VAX C 3.2. A previous release was tested under OpenVMS/AXP ?.? using DEC C ?.?, it is believed that this release as well works on AXP. The code contains some GNU C specific things. This does *not* imply, however, that the VAX/GCC configuration has been tested, *it has not*.
The command procedures (MAKEVMS.COM) for building the library and tools, is believed to choose the correct options for the VAX and AXP cases automatically.
On the AXP, IEEE floating point is used by default. If you want VAX floating point, remove the /FLOAT=IEEE_FLOAT qualifier, and change HAVE_IEEEFP=1 to HAVE_IEEEFP=0 in the MAKEVMS.COM files in both the libtiff and tools directories.
$ CC/INCLUDE=DISK:[TIFF.LIBTIFF]This ensures that the header file is found. On the AXP, also add /FLOAT=IEEE_FLOAT (if used when building the library).
$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS,SYS$INPUT:/OPTIONS SYS$SHARE:VAXCRTL/SHAREABLE
$ LINK MY_PROGRAM, - DISK:[TIFF.LIBTIFF]TIFF/LIBRARY/INCLUDE=(TIF_FAX3SM,TIF_CODEC), - SYS$INPUT:/OPTIONS SYS$SHARE:VAXCRTL/SHAREABLE
$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS
$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/LIBRARY
Method 2 gives somewhat longer link time and larger .EXE files, but does not require TIFFSHR to be defined. This method is recommended if you want to run your program on another machine, and for some reason don't want to have the library on that machine. If you plan to have more than one program (including the tools) on the machine, it is recommended that you copy the library to the other machine and use method 1.
The library requires two files that are generated on-the-fly. The file tif_fax3sm.c has the state tables for the Group 3 and Group 4 decoders. This file is generated by the mkg3states program on a UNIX system; for example,
cd libtiff cc -o mkg3states mkg3states.c rm -f tif_fax3sm.c ./mkg3states -c const tif_fax3sm.c
The second file required to build the library, version.h, contains the version information returned by the TIFFGetVersion routine. This file is built on most systems using the mkversion program and the contents of the VERSION and tiff.alpha files; for example,
cd libtiff cc -o mkversion mkversion.c rm -f version.h ./mkversion -v ../VERSION -a ../dist/tiff.alpha version.h
Otherwise, when building the library on a non-UNIX system be sure to consult the files tiffcomp.h and tiffconf.h. The former contains system compatibility definitions while the latter is provided so that the software configuration can be controlled on systems that do not support the make facility for building the software.
Systems without a 32-bit compiler may not be able to handle some of the codecs in the library; especially the Group 3 and 4 decoder. If you encounter problems try disabling support for a particular codec; consult the documentation.
Programs in the tools directory are written to assume an ANSI C compilation environment. There may be a few POSIX'isms as well. The code in the port directory is provided to emulate routines that may be missing on some systems. On UNIX systems the configure script automatically figures out which routines are not present on a system and enables the use of the equivalent emulation routines from the port directory. It may be necessary to manually do this work on a non-UNIX system.
Assuming you have working versions of tiffgt and tiffsv, you can just use them to view any of the sample images available for testing (see the section on obtaining the test images). Otherwise, you can do a cursory check of the library with the tiffcp and tiffcmp programs. For example,
tiffcp -lzw cramps.tif x.tif tiffcmp cramps.tif x.tif
(tiffcmp should be silent if the files compare correctly).
libtiff/tiff.h TIFF spec definitions libtiff/tiffcomp.h non-UNIX OS-compatibility definitions libtiff/tiffconf.h non-UNIX configuration definitions libtiff/tiffio.h public TIFF library definitions libtiff/tiffiop.h private TIFF library definitions libtiff/t4.h CCITT Group 3/4 code tables+definitions libtiff/tif_dir.h private defs for TIFF directory handling libtiff/tif_fax3.h CCITT Group 3/4-related definitions libtiff/tif_predict.h private defs for Predictor tag support libtiff/uvcode.h LogL/LogLuv codec-specific definitions libtiff/version.h version string (generated by Makefile) libtiff/tif_apple.c Apple-related OS support libtiff/tif_atari.c Atari-related OS support libtiff/tif_aux.c auxiliary directory-related functions libtiff/tif_close.c close an open TIFF file libtiff/tif_codec.c configuration table of builtin codecs libtiff/tif_compress.c compression scheme support libtiff/tif_dir.c directory tag interface code libtiff/tif_dirinfo.c directory known tag support code libtiff/tif_dirread.c directory reading code libtiff/tif_dirwrite.c directory writing code libtiff/tif_dumpmode.c "no" compression codec libtiff/tif_error.c library error handler libtiff/tif_fax3.c CCITT Group 3 and 4 codec libtiff/tif_fax3sm.c G3/G4 state tables (generated by mkg3states) libtiff/tif_flush.c i/o and directory state flushing libtiff/tif_getimage.c TIFFRGBAImage support libtiff/tif_jpeg.c JPEG codec (interface to the IJG distribution) libtiff/tif_luv.c SGI LogL/LogLuv codec libtiff/tif_lzw.c LZW codec libtiff/tif_msdos.c MSDOS-related OS support libtiff/tif_next.c NeXT 2-bit scheme codec (decoding only) libtiff/tif_open.c open and simply query code libtiff/tif_packbits.c Packbits codec libtiff/tif_pixarlog.c Pixar codec libtiff/tif_predict.c Predictor tag support libtiff/tif_print.c directory printing support libtiff/tif_read.c image data reading support libtiff/tif_strip.c some strip-related code libtiff/tif_swab.c byte and bit swapping support libtiff/tif_thunder.c Thunderscan codec (decoding only) libtiff/tif_tile.c some tile-related code libtiff/tif_unix.c UNIX-related OS support libtiff/tif_version.c library version support libtiff/tif_vms.c VMS-related OS support libtiff/tif_warning.c library warning handler libtiff/tif_win3.c Windows-3.1-related OS support libtiff/tif_win32.c Win32 (95/98/NT) related OS support libtiff/tif_write.c image data writing support libtiff/tif_zip.c Deflate codec libtiff/mkg3states.c program to generate G3/G4 decoder state tables libtiff/mkspans.c program to generate black-white span tables libtiff/mkversion.c program to generate libtiff/version.h.