TO INSTALL THIS PACKAGE *********************************************************************** USING DEFAULTS: Execute commands similar to the following (note: the following commands log the installation process and allow you to view it at the same time): Using csh(1) or tcsh(1): % (./configure && make all install clean) >&! log & % tail -f log Using a POSIX.2 shell (e.g. sh, bash, or ksh): $ (./configure && make all install clean) > log 2>&1 & $ tail -f log By default, an optimized version of the software will be built using the compilers referenced by your PATH environment variable. The software will be installed in peer directories of the directory containing this file (e.g. in `../bin/', `../lib/', etc.). ADDITIONALLY, THE INSTALLATION PROCEDURE WILL ATTEMPT TO BUILD AND INSTALL THE UDUNITS EXTENSION MODULE FOR THE PERL(1) UTILITY, WHICH MIGHT REQUIRE SUPERUSER PRIVILEGES. If any of this is unsatisfactory, then see the next section. NB: There are some systems on which using defaults will not work (see the following sections for a list and system-specific commentary). *********************************************************************** USING CUSTOMIZATIONS: 1. Configure the package for your system. In the directory that this file is in, execute the command `./configure'. If you're using `csh' on an old version of System V, you might need to execute the command `sh configure' instead to prevent `csh' from trying to execute `configure' itself. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation, and creates the Makefile(s) (one in each subdirectory of the source directory). In some packages it creates a C header file containing system-dependent definitions. It also creates a file `config.status' that you can run in the future to recreate the current configuration. Running `configure' takes a minute or two. While it is running, it prints some messages that tell what it is doing. If you don't want to see the messages, run `configure' with its standard output redirected to `/dev/null'; for example, `./configure >/dev/null'. By default, `make install' will install the package's files in ../bin, ../lib, ../man, etc., relative to the directory containing this file. You can specify an installation prefix other than /usr/local by giving `configure' the option `--prefix=PATH'. Alternately, you can do so by changing the `prefix' variable in the Makefile that `configure' creates (the Makefile in the top-level directory, if the package contains subdirectories). You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec_prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Data files and documentation will still use the regular prefix. Normally, all files are installed using the regular prefix. You can tell `configure' to figure out the configuration for your system, and record it in `config.status', without actually configuring the package (creating `Makefile's and perhaps a configuration header file). To do this, give `configure' the `--no-create' option. Later, you can run `./config.status' to actually configure the package. This option is useful mainly in `Makefile' rules for updating `config.status' and `Makefile'. You can also give `config.status' the `--recheck' option, which makes it re-run `configure' with the same arguments you used before. This is useful if you change `configure'. `configure' ignores any other arguments that you give it. If your system requires unusual options for compilation or linking that `configure' doesn't know about, you can give `configure' initial values for some variables by setting them in the environment. In standard UNIX shells (e.g. sh, ksh, bash) you can do that on the command line like this: CC=gcc CPPFLAGS=-D_POSIX_SOURCE ./configure In csh-like shells (e.g. csh, tcsh) the equivalent would be this setenv CC gcc setenv CPPFLAGS -D_POSIX_SOURCE ./configure For more information on defining and setting environment variable, please see the manual page for your shell. Please see the TESTED SYSTEMS section below for examples of settings used in actual builds. The `make' variables that you might want to override with environment variables when running `configure' are: CC C compiler program. Default is system-dependent. NOTE: If you want to build the perl extension module, then he same environment (i.e. compiler, linker, etc.) that built the perl package should be used to build the UDUNITS package. Differences might result in the perl extension module not being built. NOTE: Because building the Perl extension module involves using your perl(1) utility to generate the makefile, I can't guarantee that the same compiler will be used to build both the udunits(3) library and the extension module. GNU C Notes: Solaris 2: The use of the GNU C compiler causes problems under SunOS 5 (alias Solaris 2). Perl 5 configures the makefile perl/Makefile so that the option `-K pic' is passed to the C compiler so as to build the perl 5 extension using a dynamic library. This is the wrong option for the GNU C compiler -- it should be `-fpic' instead. If you use the GNU C compiler and want to build the perl 5 extension, then you'll have to manually edit the makefile perl/Makefile and change the option. OSF/1: The use of the GNU C compiler causes problems under OSF/1. Perl 5 configures the makefile perl/Makefile so that the option `-Olimit 2900' is passed to the C compiler. This option isn't understood by the GNU C compiler. Thus, if you use the GNU C compiler and want to build the perl 5 extension, then you'll have to manually edit the makefile perl/Makefile and remove this option. CPPFLAGS Additional C preprocessor options (e.g. `-Dfoo -Dbar ...'). CFLAGS Additional C compiler options (e.g. `-g'). NB: Because building the Perl extension module involves using your perl(1) utility to generate the makefile, I can't guarantee that the same options will be used to build both the udunits(3) library and the extension module. Discrepancies can cause problems. LIBS Additional libraries to link against (e.g. `-lfoo -lbar ...'). PERL Pathname of the perl 5 utility. If set to the empty string, then the top-level makefile will ignore the UDUNITS extension module in the perl/ subdirectory. If, however, it is set to a non-empty string, or the configure script finds the perl 5 utility, then the top-level makefile will build, test, and install the UDUNITS extension module. NOTE: YOU MUST HAVE VERSION 5.001 (PATCHLEVEL E) OR LATER OF THE PERL PACKAGE INSTALLED OR YOU WON'T BE ABLE TO BUILD THE EXTENSION MODULE (check by executing the command `perl -version'). NOTE: Installing the Perl extension module requires write-access to the perl installation. If you don't have such access, then you shouldn't try to build this component. If you don't want the UDUNITS perl extension module, then you should set the PERL variable to the empty string. This might be necessary, for example, if you can't get both the extension module *and* the udunits(3) library to build or if you don't have write-access to the perl installation. perl 5 is available from `http://www.metronet.com/perlinfo/perl5.html'. LINKTYPE Type of perl extension module to build. The two options are "static" and "dynamic". The default option depends on the system. "static" causes a completely new perl(1) utility to be built and installed. "dynamic" causes a shared-library for the UDUNITS extension module to be built and installed. Alternatively, you can specify initial values to the `configure' script by modifying the file CUSTOMIZE. If you need to do unusual things to compile the package, we encourage you to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the README so we can include them in the next release. 2. Execute the command `make' to compile the package. If you want, you can override the `make' variable CFLAGS like this: make CFLAGS=-O2 On some systems, this `make' will fail in the perl/ subdirectory with an error message akin to the following: ./blib[/$system]/auto/UDUNITS/.packlist: Cannot create (where /$system -- if it exists -- is the identifier for your system that the perl utility has chosen). This problem is caused by a bug in the procedure that perl5 uses to build extension modules. The workaround is to manually create the relevant directory, e.g. $ mkdir -p perl/blib[/$system]/auto/UDUNITS and then re-execute the `make' command. 3. Execute the command `make test' to test the package. 4. Execute the command `make install' to install programs, data files, and documentation. YOU MIGHT NEED TO BE THE SUPERUSER IN ORDER TO INSTALL THE UDUNITS EXTENSION MODULE BECAUSE THE PROCEDURE ATTEMPTS TO MODIFY THE INSTALLED PERL 5 PACKAGE. 5. You can remove the program binaries and object files from the source directory by executing the command `make clean'. To also remove the Makefile(s), the header file containing system-dependent definitions (if the package uses one), and `config.status' (all the files that `configure' created), execute the command `make distclean'. The file `configure.in' is used as a template to create `configure' by a program called `autoconf'. You will only need it if you want to regenerate `configure' using a newer version of `autoconf'. *********************************************************************** TESTED SYSTEMS: A build of this package has been attempted on the following systems using the indicated settings. The examples with the remark "earlier UDUNITS release" are historical. aix_4.2-rs6000 (Gale) (earlier UDUNITS release): CC=/bin/c89 PERL=/usr/local/bin/perl # version 5.003 with EMBED aix_4.3-rs6000 (Gale): CC=/bin/c89 PERL=/usr/local/bin/perl # version 5.004 -------- CC=/usr/vac/bin/c89 CFLAGS=-qnolm # necessary to disable bogus # license warning on our system PERL=/usr/local/bin/perl # version 5.004 bsdos_2.1-i386 (Emo) (earlier UDUNITS release): CC=/usr/bin/cc PERL= # i.e. unable to build extension module hpux_9.05-hp9000 (Robin) (earlier UDUNITS release): CC=/bin/cc CFLAGS=-Aa PERL=/usr/local/bin/perl # version 5.003 with EMBED hpux_10.20-hp9000 (Robin) (earlier UDUNITS release): CC=/bin/cc CFLAGS=-Aa PERL=/usr/local/bin/perl # version 5.004 hpux_11.00-hp9000 (Robin): CC=/bin/cc CPPFLAGS=-w # necessary for proper configuration CFLAGS=-Aa PERL=/usr/local/bin/perl # version 5.003 with EMBED irix_5.3-mips (Dana) (earlier UDUNITS release): CC=/bin/cc PERL=/usr/local/bin/perl # version 5.004 with EMBED irix_6.2-mips (Chevy) (earlier UDUNITS release): CC=/bin/cc PERL=/usr/local/bin/perl # version 5.001 patchlevel 1e irix_6.5-mips (Chevy): CC=/bin/cc PERL=/usr/local/bin/perl # v5.6.0 irix64_6.4-mips (Binnie) (earlier UDUNITS release): CC='/bin/cc -32' PERL=/opt/bin/perl # version 5.003 with EMBED irix64_6.5-mips (Flip): CC='/bin/cc -32' PERL=/opt/bin/perl # version 5.004_04 linux_2.4-i686 (Daffy): CPPFLAGS='-DNDEBUG -Df2cFortran' CC=/usr/bin/gcc CFLAGS='-O -fno-builtin' PERL=/usr/bin/perl osf1_4.0-alpha (Ernie): CC=/bin/cc LIBS=-lm PERL=/usr/local/bin/perl # version 5.004 sunos_4.1-sparc (Gummo): CPPFLAGS=-DHASCONST CC=/usr/local/lang/acc LIBS='-L/usr/lang/SC3.0.1/lib -lansi' PERL= # PERL=/usr/local/bin/perl # version 5.003 with EMBED NB: The extension module couldn't be tested because the symbol "__lib_version" was unresolved. If you discover a solution, please let me know. sunos_5.5-sparc (Laraine) (earlier UDUNITS release): CC=/opt/SUNWspro/bin/cc PERL=/opt/bin/perl # version 5.003 with EMBED sunos_5.6-sparc (Gilda) (earlier UDUNITS release): CC=/opt/SUNWspro/bin/cc PERL=/opt/bin/perl # version 5.004 sunos_5.7-sparc (Gilda): CC=/opt/SUNWspro/bin/cc PERL=/opt/bin/perl # v5.6.0 sunos_5.8-i86pc (Lenny): CC=/opt/SUNWspro/bin/cc PERL=/opt/bin/perl # version 5.004 super-ux_9.1: CC=cc # C/SX Version 1.0 (Rev.4.01) CFLAGS='-h2 -Xc -hacct -h stack=nan -pvctl,fullmsg' LINKTYPE=static FFLAGS=-ew F90FLAGS=-ew FLMOD=0 ultrix_4.4-vax (Milton) (earlier UDUNITS release): CC=gcc PERL= # i.e. unable to build extension module LD_MATH=/usr/lib/libm.a ultrix_4.5-risc (Curly) (earlier UDUNITS release): CC=gcc PERL= # i.e. unable to build extension module unicos_8.0-cray_ymp (Shavano) (earlier UDUNITS release): CC=/opt/ctl/bin/c89 CFLAGS=-g PERL= # i.e. unable to build extension module # because perl(1) was version 4 unicos_9.2-cray_j90 (Ouray) (earlier UDUNITS release): CPPFLAGS=-DDOUBLE_PRECISION=double # Causes UDUNITS library to # assume that Fortran "doubleprecision" # is C "double". THIS OPTION APPEARS # TO BE NECESSARY. CC=/opt/ctl/bin/c89 CFLAGS=-g PERL=/usr/local/bin/perl # version 5.002 LINKTYPE=static # i.e. build new, static version of # perl(1) utility (dynamic version # wouldn't build). *********************************************************************** IF PROBLEMS OCCUR: If you have problems with the installation, then please try the following first: 1. Re-read and understand all of this INSTALL document -- especially any examples and commentary relevant to your system. 2. Go to the top-level source directory (the directory containing this file). 3. Execute the command "make distclean". Don't worry if it fails or even fails to execute. 4. Remove the file "config.cache" if it exists. 5. Set your environment variables as before as described above. 6. Re-execute the configure script. Redirect standard output and standard error to the file "configure.log". If an error message occurs in the output, then stop and send items A through E below to . 7. Execute the command "make". Redirect standard output and standard error to the file "make.log". If an error occurs, then then stop and send items A through F below to . 8. Execute the command "make test". Redirect standard output and standard error to the file "test.log". If an error occurs, then stop and send items A through G below to . 9. Execute the command "make install". Redirect standard output and standard error to the file "install.log". If an error occurs, then stop and send items A through H below to . The following items help us diagnose installation problems: A. The standard output of the command "uname -a". B. The file VERSION, which is in the top-level source directory. C. The file "configure.log". D. The file "config.log", which is created by the configure script in the top-level source directory. E. The absolute pathname of the C compiler used in the build process (use the type(1) or which(1) utility to determine this). F. The file "make.log". G. The file "test.log". H. The file "install.log".