Next: , Previous: , Up: Top   [Contents][Index]


2 Building and Installing CALIB.

How to build and install CALIB.

2.1 Basic Installation

CALIB comes with a “GNU style” configure script. For those of you who are especially impatient, type the following:

	./configure
	make

The configure shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create an Minit.mk file used by each Makefile of the package. It also creates a config.h file containing system-dependent definitions. Finally, it creates a shell script config.status that you can run in the future to recreate the current configuration, a file config.cache that saves the results of its tests to speed up reconfiguring, and a file config.log containing compiler output (useful mainly for debugging configure).

If you need to do unusual things to compile CALIB, please try to figure out how configure could check whether and how to do them, and mail diffs or instructions to the address given in the README so they can be considered for our next release.

The file configure.in is used to create configure by a program called autoconf. You only need configure.in if you want to change it or regenerate configure using a newer version of GNU autoconf.

NOTE: you do NOT need the GNU autoconf program unless you plan to change the configure.in file!!!

The simplest way to compile this package is:

  1. cd to the "top-level" directory containing CALIB’s source code and other distributed files. (This directory contains this INSTALL file, LICENSE, README and various other files and sub-directories.) Then type ./configure to configure CALIB for your system. If you’re using csh on an old version of System V, you might need to type sh ./configure instead to prevent csh from trying to execute configure itself.

    Running configure prints various messages telling which features it is checking for, and various options it has chosen.

  2. Type make to compile CALIB.
  3. The CALIB library, header files and sample applications will execute properly right in the build directory. However, if you want to install CALIB in a more permanent place (/usr/local, or whichever --prefix option you gave to configure), then type make install to install the programs and data files. Of course, you need to have write permission on these directories or this will not work.
  4. You can remove the program binaries and object files from the source code directory by typing make clean. To also remove the files that configure created (so you can compile the package for a different kind of computer), type make distclean.

2.2 Compilers and Options

Hopefully you have the GNU C compiler (gcc). This is what we use, and CALIB compiles cleanly with gcc.

Some systems require unusual options for compilation or linking that the configure script does not know about. You can give configure initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this:

     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure

Or on systems that have the env program, you can do it like this:

     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure

2.3 GNU Multi-Precision Arithmetic Library (GMP)

CALIB depends upon GMP (the GNU Multi-Precision arithmetic package) to provide arbitrary precision arithmetic for integer and rational numbers. GMP can be downloaded from:

http://www.gnu.org/software/

It must be installed prior to building CALIB. (Many Linux distributions provide packages for GMP. On RPM-based systems such as Red Hat Enterprise Linux and Fedora, the gmp and gmp-devel RPMs provide what CALIB needs.)

CALIB assumes that GMP has been installed in the “system-wide” locations so that

	#include <gmp.h>

works, and one can simply use -lgmp -lm to link GMP into an application program. It is therefore best to use the version of GMP provided by your Linux distro, if possible.

2.4 The Van Hoeij Algorithm, LLL and FPLLL

CALIB provides an implementation of the Van Hoeij algorithm that factors polynomials in Z[x] (single-variable polynomials with integer coefficients) in polynomial time. The Van Hoeij algorithm in turn requires an implementation of LLL: the Lenstra-Lenstra-Lovász lattice basis reduction algorithm. If a suitable LLL implementation is available, CALIB will automatically provide the polynomial time Van Hoeij algorithm for factoring over Z[x]. (Otherwise it falls back to the older Zassenhaus algorithm that can take exponential time on certain classes of polynomials.)

The LLL algorithm is very challenging to implement in a manner that provides competitive computational performance. (CALIB’s own implementation of LLL is not yet ready for prime time.) CALIB therefore uses FPLLL — a high-performance, floating-point implementation of LLL that is highly tuned. If you want CALIB to use the Van Hoeij algorithm, then you will have to download and build a sufficiently recent version of FPLLL from here:

https://github.com/fplll/fplll

Build FPLLL according to the instructions provided. Then do the following to configure CALIB to use FPLLL:


	./configure --with-fplllheaderdir=H --with-fplllLib=L

where

His the directory containing FPLLL’s header files (you have the correct directory if the file H/fplll/wrapper.h exists); and
Lis the the path name of the FPLLL library file (libfplll.a).

(It is probably best to specify H and L as absolute path names.) And of course you should also provide any additional arguments to the configure script, such as --prefix=PATH. Once again, use of FPLLL is entirely optional.

2.5 Installation Names

By default, make install will install the package’s files in /usr/local/bin, /usr/local/man, etc. You can specify an installation prefix other than /usr/local by giving configure the option --prefix=PATH.

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. Documentation and other data files will still use the regular prefix.

In addition, if you use an unusual directory layout you can give options like --bindir=PATH to specify different values for particular kinds of files. Run configure --help for a list of the directories you can set and what kinds of files go in them.

If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving configure the option --program-prefix=PREFIX or --program-suffix=SUFFIX.

2.6 Sharing Defaults

If you want to set default values for configure scripts to share, you can create a site shell script called config.site that gives default values for variables like CC, cache_file, and prefix. configure looks for PREFIX/share/config.site if it exists, then PREFIX/etc/config.site if it exists. Or, you can set the CONFIG_SITE environment variable to the location of the site script. A warning: not all configure scripts look for a site script.

2.7 Operation Controls

configure recognizes the following options to control how it operates.

--cache-file=FILE

Use and save the results of the tests in FILE instead of ./config.cache. Set FILE to /dev/null to disable caching, for debugging configure.

--help

Print a summary of the options to configure, and exit.

--quiet
--silent
-q

Do not print messages saying which checks are being made.

--srcdir=DIR

Look for the package’s source code in directory DIR. Usually configure can determine that directory automatically.

--version

Print the version of Autoconf used to generate the configure script, and exit.

configure also accepts some other, not widely useful, options.


Next: , Previous: , Up: Top   [Contents][Index]