summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-03-21 15:24:36 +0000
committerthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-03-21 15:24:36 +0000
commit0784707afdc3dfca69ebea7c253631e0796ddbf5 (patch)
treef4795ebede60cf6b530523e09762348926847735
parent0947ed620f82a5681fa2fbd855d34dc678ee4df4 (diff)
downloadmpc-feature-autotools.tar.gz
configure.ac: add options for GMP/MPFR library directories selectionfeature-autotools
Makefile.am: put mpc.h in include_HEADERS INSTALL: explanations on the new compilation process mpc.texi: deeper explanations on the new compilation process README.dev: add a remind note on autoreconf ChangeLog: add comments on INSTALL, mpc.texi and configure.ac changes git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/branches/feature-autotools@76 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r--ChangeLog9
-rw-r--r--INSTALL42
-rw-r--r--Makefile.am7
-rw-r--r--README.dev7
-rw-r--r--configure.ac27
-rw-r--r--mpc.texi159
6 files changed, 173 insertions, 78 deletions
diff --git a/ChangeLog b/ChangeLog
index 2fe2ee4..f9d51c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
-2008-03-14 Philippe THEVENY <philippe.theveny@loria.fr>
+2008-03-21 Philippe THEVENY <philippe DOT theveny AT loria DOT fr>
+
+ * INSTALL: short description of the new compilation commands
+ * mpc.texi: deeper explanations on the compilation options
+ * configure.ac: add options selecting GMP/MPFR installation
+ directory
+
+2008-03-14 Philippe THEVENY <philippe DOT theveny AT loria DOT fr>
* NEWS: Added for autotools support
* AUTHORS: Added for autotools support
diff --git a/INSTALL b/INSTALL
index 6f2f36e..b26b0d1 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,46 +1,44 @@
Installing MPC
==============
+This is for the impatient, for deeper explanations see Installing MPC chapter
+in the Texinfo documentation (type 'info mpc.info').
+
0. You first need to install GMP and MPFR. See <http://gmplib.org/>
and <http://www.mpfr.org>.
MPC requires GMP version 4.2.2 or later and MPFR version 2.3.0 or later.
-1. In the MPC build directory, type
+1. In the directory MPC archive, type
+ tar xzf mpc-0.4.7.tar.gz
+ cd mpc-0.4.7
+ ./configure
make
- This assumes that GMP and MPFR are installed into /usr/local.
-
- Otherwise, type
-
- make GMP=<gmp_install_dir> MPFR=<mpfr_install_dir>
-
- where <gmp_install_dir> is the directory where you installed GMP and
- <mpfr_install_dir> is the directory where you installed MPFR. The GMP
- header files like gmp.h are then expected to be in <gmp_install_dir>/include,
- the GMP library files like libgmp.a in <gmp_install_dir>/lib, and likewise
- for MPFR.
-
-2. Type
+ This assumes that GMP and MPFR are installed in a directory searched by
+ default by the compiler. Otherwise, use --with-gmp=DIR or --with-mpfr=DIR
+ (see Texinfo documentation).
+2. You can optionally run the test suit, type
+
make check
- resp.
-
- make check GMP=<gmp_install_dir> MPFR=<mpfr_install_dir>
+3. To install the MPC library, type
+
+ make install
- to produce and run the test files (please check that <gmp_install_dir>/lib
- is first in your LD_LIBRARY_PATH environment variable if you use the dynamic
- GMP libraries, or compile the test files with the -static option).
+ By default, the files are copied into /usr/local subdirectories. You
+ need write permissions on these directories.
-3. Type
+4. You can optionally create documentation, type
make mpc.dvi
or
+
make mpc.ps
- to produce the documentation in DVI or Postscript format.
+ This requires Texinfo package.
In case of difficulties, send a description of the problem to
<enge at lix dot polytechnique.fr, zimmerma at loria dot fr>
diff --git a/Makefile.am b/Makefile.am
index fcc86cd..c11c285 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,8 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
+include_HEADERS = mpc.h
+
lib_LTLIBRARIES = libmpc.la
-libmpc_la_SOURCES = mpc.h mpc-impl.h abs.c add.c add_fr.c add_ui.c clear.c \
+libmpc_la_SOURCES = mpc-impl.h abs.c add.c add_fr.c add_ui.c clear.c \
cmp.c cmp_si_si.c conj.c div_2exp.c div.c div_fr.c div_ui.c exp.c \
get_prec2.c get_prec.c init2.c init3.c init.c inp_str.c mul_2exp.c mul.c \
mul_fr.c mul_i.c mul_si.c mul_ui.c neg.c norm.c out_str.c random2.c random.c \
@@ -9,10 +11,11 @@ set_ui_ui.c sin.c sqr.c sqrt.c sub.c sub_ui.c uceil_log2.c ui_div.c \
ui_ui_sub.c
LDADD = $(top_builddir)/libmpc.la
-INCLUDES = -I$(top_srcdir)
+check_INCLUDES = -I$(top_srcdir)
check_PROGRAMS = test tabs tdiv texp tmul tsin tsqr
TESTS = $(check_PROGRAMS)
+CLEANFILES = $(top_builddir)/mpc_test
info_TEXINFOS = mpc.texi
diff --git a/README.dev b/README.dev
index fba2654..392b45a 100644
--- a/README.dev
+++ b/README.dev
@@ -1,3 +1,10 @@
+Source code from Subversion repository:
+To compile source code obtained from Subversion repository, you need autoconf,
+automake and libtools packages. To create the configure file, type:
+
+$ autoreconf -i
+
+
To make a new release:
1) create a tag for the new release, for example:
diff --git a/configure.ac b/configure.ac
index 3e3800a..9a351a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,19 +2,38 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT(mpc, 0.4.6, mpc@loria.fr)
-AC_CONFIG_SRCDIR([set_d_d.c])
+AC_INIT(mpc, 0.4.7, mpc-discuss@lists.gforge.inria.fr)
+AC_CONFIG_SRCDIR([mpc-impl.h])
AC_CONFIG_HEADER([config.h])
-AM_INIT_AUTOMAKE([1.9 foreign])
+AM_INIT_AUTOMAKE([1.9 -Wall -Werror])
AM_MAINTAINER_MODE
+AM_CFLAGS="-O2 -g"
+
+dnl Extra arguments to configure
+AC_ARG_WITH([mpfr],
+ AC_HELP_STRING([--with-mpfr=DIR],
+ [MPFR install directory]),
+ [
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ ])
+AC_ARG_WITH([gmp],
+ AC_HELP_STRING([--with-gmp=DIR],
+ [GMP install directory]),
+ [
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ ])
+
# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
# Checks for libraries.
-AC_CHECK_LIB([mpfr], [mpfr_clear])
+AC_CHECK_LIB([mpfr], [mpfr_clear],,
+ AC_MSG_ERROR([MPC library needs the MPFR library]))
# Checks for header files.
AC_HEADER_STDC
diff --git a/mpc.texi b/mpc.texi
index 0a9371e..50386f6 100644
--- a/mpc.texi
+++ b/mpc.texi
@@ -6,7 +6,8 @@
@afourpaper
@end iftex
-@set VERSION 0.4.7
+@include version.texi
+
@set DATE October 2007
@set AUTHORS Andreas Enge, Paul Zimmermann
@set COPYRIGHTDATES 2002, 2003, 2004, 2005, 2007
@@ -77,14 +78,14 @@ into another language, under the above conditions for modified versions.
@end titlepage
@headings double
-@ifinfo
+@ifnottex
@node Top, Copying, (dir), (dir)
@top MPC
This manual documents how to install and use the Multiple Precision
Complex Library, version @value{VERSION}
-@end ifinfo
+@end ifnottex
@menu
* Copying:: MPC Copying Conditions (LGPL).
@@ -162,79 +163,137 @@ probably a good idea to glance through it.
@chapter Installing MPC
@cindex Installation
-To build MPC, you first have to install GNU MP
-(version 4.2.2 or higher) and MPFR (version 2.2.1 or higher) on your computer.
-You need a C compiler, preferably GCC, but any reasonable compiler should
-work. And you need a standard Unix @samp{make} program, plus some other
-standard Unix utility programs.
+To build MPC, you first have to install GNU MP (version 4.2.2 or higher) and
+MPFR (version 2.2.1 or higher) on your computer. You need a C compiler,
+preferably GCC, but any reasonable compiler should work. And you need a
+standard Unix @samp{make} program, plus some other standard Unix utility
+programs.
Here are the steps needed to install the library on Unix systems:
@enumerate
-@item
-@samp{make}
+@item
+@samp{tar xzf mpc-@value{VERSION}.tar.gz}
+
+@item
+@samp{cd mpc-@value{VERSION}}
+
+@item
+@samp{./configure}
+
+if GMP and MPFR are installed into standard directories, that is, directories
+that are searched by default by the compiler and the linking tools.
-if GMP and MPFR are installed into the standard directory @samp{/usr/local}.
-This will compile MPC, and create a library archive file @file{libmpc.a}
-in the working directory.
+@samp{./configure --with-gmp=<gmp_install_dir>}
-@samp{make GMP=<gmp_install_dir>}.
+is used to indicate a different location where GMP is installed.
-is used to indicate a different location where both GMP and MPFR
-are installed.
+@samp{./configure --with-mpfr=<mpfr_install_dir>}
-@samp{make GMP=<gmp_install_dir> MPFR=<mpfr_install_dir>}.
+is used to indicate a different location where MPFR is installed.
+
+@samp{./configure --with-gmp=<gmp_install_dir> --with-mpfr=<mpfr_install_dir>}
is used to indicate different locations of GMP and MPFR.
+@emph{Warning!} Do not use these options if you have CPPFLAGS and/or LDFLAGS
+containing a -I or -L option with a directory that contains a GMP header or
+library file, as these options just add -I and -L options to CPPFLAGS and
+LDFLAGS @emph{after} the ones that are currently declared, so that DIR will
+have a lower precedence. Also, this may not work if DIR is a system directory.
@item
-@samp{make check} resp.
+@samp{make}
+
+This compiles MPC in the working directory.
-@samp{make check GMP=<gmp_install_dir>} resp.
+@item
+@samp{make check}
-@samp{make check GMP=<gmp_install_dir> MPFR=<mpfr_install_dir>}
+This will make sure MPC was built correctly.
-This will make sure MPC was built correctly.
-If you get error messages, please
-report them to @samp{enge@@lix.polytechnique.fr,zimmerma@@loria.fr}.
-(@xref{Reporting Bugs}, for
-information on what to include in useful bug reports.)
+If you get error messages, please report them to
+@samp{mpc-discuss@@lists.gforge.inria.fr} (@xref{Reporting Bugs}, for
+information on what to include in useful bug reports).
+
+@item
+@samp{make install}
+
+This will copy the file @file{mpc.h} to the directory
+@file{/usr/local/include}, the file @file{libmpc.a} to the directory
+@file{/usr/local/lib}, and the file @file{mpc.info} to the directory
+@file{/usr/local/share/info} (or if you passed the @samp{--prefix} option to
+@file{configure}, using the prefix directory given as argument to
+@samp{--prefix} instead of @file{/usr/local}). Note: you need write permissions
+on these directories.
@end enumerate
+
+@section Other `make' Targets
+
There are some other useful make targets:
@itemize @bullet
@item
-@samp{make doc}
+@samp{mpc.info} or @samp{info}
-Create a dvi version of the manual in @file{mpc.dvi},
-a pdf version in @file{mpc.pdf} and an info version in @file{mpc.info}.
+Create an info version of the manual, in @file{mpc.info}.
@item
-@samp{make clean}
+@samp{mpc.pdf} or @samp{pdf}
-Delete all object and archive files.
+Create a PDF version of the manual, in @file{mpc.pdf}.
+@item
+@samp{mpc.dvi} or @samp{dvi}
+
+Create a DVI version of the manual, in @file{mpc.dvi}.
+
+@item
+@samp{mpc.ps} or @samp{ps}
+
+Create a Postscript version of the manual, in @file{mpc.ps}.
+
+@item
+@samp{mpc.html} or @samp{html}
+
+Create a HTML version of the manual, in several pages in the directory
+@file{mpc.html}; if you want only one output HTML file, then type
+@samp{makeinfo --html --no-split mpc.texi} instead.
+
+@item
+@samp{clean}
+
+Delete all object files and archive files, but not the configuration files.
+
+@item
+@samp{distclean}
+
+Delete all files not included in the distribution.
+
+@item
+@samp{uninstall}
+
+Delete all files copied by @samp{make install}.
@end itemize
+
@section Known Build Problems
-MPC suffers from all bugs from the GNU MP and MPFR libraries,
-plus many many more.
+MPC suffers from all bugs from the GNU MP and MPFR libraries, plus many many
+more.
-Please report other problems to
-@samp{enge@@lix.polytechnique.fr,zimmerma@@loria.fr}.
-@xref{Reporting Bugs}.
+Please report other problems to
+@samp{enge@@lix.polytechnique.fr,zimmerma@@loria.fr}. @xref{Reporting Bugs}.
@node Reporting Bugs, MPC Basics, Installing MPC, Top
@comment node-name, next, previous, up
@chapter Reporting Bugs
@cindex Reporting bugs
-If you think you have found a bug in the MPC library,
+If you think you have found a bug in the MPC library,
please investigate
and report it. We have made this library available to you, and it is not to ask
too much from you, to ask you to report the bugs that you find.
@@ -297,7 +356,7 @@ See the MPFR documentation for more details on the allowed precision range.
@cindex Rounding Mode
@tindex @code{mpc_rnd_t}
@noindent
-The @dfn{rounding mode} specifies the way to round the result of a
+The @dfn{rounding mode} specifies the way to round the result of a
complex operation, in case the exact result can not be represented
exactly in the destination mantissa;
the corresponding C data type is @code{mpc_rnd_t}.
@@ -318,7 +377,7 @@ arguments. This notation is based on an analogy with the assignment operator.
MPC allows you to use the same variable for both input and output in the same
expression. For example, the main function for floating-point multiplication,
-@code{mpc_mul}, can be used like this: @code{mpc_mul (x, x, x, rnd_mode)}.
+@code{mpc_mul}, can be used like this: @code{mpc_mul (x, x, x, rnd_mode)}.
This
computes the square of @var{x} with rounding mode @code{rnd_mode}
and puts the result back in @var{x}.
@@ -326,7 +385,7 @@ and puts the result back in @var{x}.
Before you can assign to an MPC variable, you need to initialize it by calling
one of the special initialization functions. When you are done with a
variable, you need to clear it out, using one of the functions for that
-purpose.
+purpose.
A variable should only be initialized once, or at least cleared out between
each initialization. After a variable has been initialized, it may be
@@ -339,7 +398,7 @@ loop has exited.
You do not need to be concerned about allocating additional space for MPC
variables, since each of its real and imaginary part
has a mantissa of fixed size.
-Hence unless you change its precision, or clear and reinitialize it,
+Hence unless you change its precision, or clear and reinitialize it,
a complex variable will have the same allocated space during all its
life.
@@ -350,7 +409,7 @@ life.
The complex functions expect arguments of type @code{mpc_t}.
-The MPC floating-point functions have an interface that is similar to the
+The MPC floating-point functions have an interface that is similar to the
GNU MP
integer functions. The function prefix for operations on complex numbers is
@code{mpc_}.
@@ -384,7 +443,7 @@ different word size.
@section Rounding Modes
A complex rounding mode is of the form @code{MPC_RNDxy} where
-@code{x} and @code{y} are one of @code{N} (to nearest), @code{Z} (towards
+@code{x} and @code{y} are one of @code{N} (to nearest), @code{Z} (towards
zero), @code{U} (towards plus infinity), @code{D} (towards minus infinity).
The first letter refers to the rounding mode for the real part,
and the second one for the imaginary part.
@@ -480,7 +539,7 @@ closely match the actual accurate part of the numbers.
Reset the precision of @var{x} to be @strong{exactly} @var{prec} bits,
and set its real/imaginary parts to NaN.
The previous value stored in @var{x} is lost. It is equivalent to
-a call to @code{mpc_clear(x)} followed by a call to
+a call to @code{mpc_clear(x)} followed by a call to
@code{mpc_init2(x, prec)}, but more efficient as no allocation is done in
case the current allocated space for the mantissa of @var{x} is sufficient.
@end deftypefun
@@ -615,7 +674,7 @@ Just changes the sign if @var{rop} and @var{op} are the same variable.
@deftypefun int mpc_conj (mpc_t @var{rop}, mpc_t @var{op}, mpc_rnd_t @var{rnd})
Set @var{rop} to the conjugate of @var{op} rounded according to @var{rnd}.
-Just changes the sign of the imaginary part
+Just changes the sign of the imaginary part
if @var{rop} and @var{op} are the same variable.
@end deftypefun
@@ -730,8 +789,8 @@ Return the number of characters written.
@deftypefun size_t mpc_inp_str (mpc_t @var{rop}, FILE *@var{stream}, int @var{base}, mpc_rnd_t @var{rnd})
Input a string in base @var{base} from stdio stream @var{stream},
rounded according to @var{rnd}, and put the
-read complex in @var{rop}.
-Each of the real and imaginary part should be of the form @samp{M@@N} or,
+read complex in @var{rop}.
+Each of the real and imaginary part should be of the form @samp{M@@N} or,
if the base is 10 or less, alternatively @samp{MeN} or @samp{MEN}.
@samp{M} is the mantissa and
@samp{N} is the exponent. The mantissa is always in the specified base. The
@@ -762,7 +821,7 @@ real (resp. imaginary) part is in
the interval @minus{}@var{exp} to @var{exp}.
This function is useful for
testing functions and algorithms, since this kind of random numbers have
-proven to be more likely to trigger corner-case bugs.
+proven to be more likely to trigger corner-case bugs.
Negative parts are generated when @var{max_size} is negative.
@end deftypefun
@@ -770,7 +829,7 @@ Negative parts are generated when @var{max_size} is negative.
@comment node-name, next, previous, up
@section Internals
-These types and
+These types and
functions were mainly designed for the implementation of MPC,
but may be useful for users too.
However no upward compatibility is guaranteed.
@@ -812,7 +871,7 @@ Guillaume Hanrot, Vincent Lef@`evre, Patrick P@'elissier, Paul Zimmermann et al.
Version 2.2.1, @url{http://www.mpfr.org}.
@item
-IEEE standard for binary floating-point arithmetic, Technical Report
+IEEE standard for binary floating-point arithmetic, Technical Report
ANSI-IEEE Standard 754-1985, New York, 1985.
Approved March 21, 1985: IEEE Standards Board; approved July 26,
1985: American National Standards Institute, 18 pages.
@@ -833,5 +892,7 @@ Donald E. Knuth, "The Art of Computer Programming", vol 2,
@unnumbered Function and Type Index
@printindex fn
+@ifnothtml
@contents
+@end ifnothtml
@bye