diff --git a/ChangeLog b/ChangeLog index 746e0b4..c24586c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,17 @@ -2007-02-23 Bruno Haible +2008-03-15 Richard B. Kreckel + + * m4/gmp.m4 (CL_LIBGMP): New macro brings support for --with-gmp=DIR... + * configure.ac: ...used here. + * doc/cln.texi: Document that new feature. + Suggested by Paul Zimmermann . + +2008-02-23 Bruno Haible Support for gcc-4.3 snapshots. * autoconf/floatparam.c (check): Change argument types to 'volatile type*'. This defeats optimizations of gcc 4.3.0 snapshots. -2007-02-23 Bruno Haible +2008-02-23 Bruno Haible Change "make alls" and "make allo" to recurse into subdirectories. * src/Makefile.in (alls-local): Renamed from alls. @@ -13,7 +20,7 @@ (alls, allo): New rules. (SUBDIRS_TARGET_ALLS, SUBDIRS_TARGET_ALLO): New variables. -2007-02-22 Richard B. Kreckel +2008-02-22 Richard B. Kreckel * include/cln/integer_io.h (read_integer): Make index args uintC. * src/integer/input/cl_I_readparsed.cc: Likewise. @@ -25,19 +32,19 @@ * src/vector/output/cl_SV_aprint.cc: Likewise. * src/vector/output/cl_SV_number_aprint.cc: Likewise. -2007-02-15 Richard B. Kreckel +2008-02-15 Richard B. Kreckel * m4/cc.m4 (CL_HAVE_ATTRIBUTE_FLATTEN): More robust definition allows... * src/base/cl_maybe_inline.h (CL_FLATTEN): ...simplification here. -2007-02-10 Richard B. Kreckel +2008-02-10 Richard B. Kreckel * autoconf/ltmain.sh: Update to libtool-1.5.26. * autoconf/config.guess: Likewise. * autoconf/config.sub: Likewise. * m4/libtool.m4: Likewise. -2007-02-09 Alexei Sheplyakov +2008-02-09 Alexei Sheplyakov Richard B. Kreckel Avoid compiler warning about ignored 'flatten' attribute directive: @@ -46,7 +53,7 @@ * include/cln/config.h.in: ...defining CL_HAVE_ATTRIBUTE_FLATTEN,... * src/base/cl_maybe_inline.h: ...used to prevent a warning here. -2007-02-07 Richard B. Kreckel +2008-02-07 Richard B. Kreckel * include/cln/integer.h: Enable modifying operators by default. * include/cln/rational.h: Likewise. @@ -59,26 +66,26 @@ * include/cln/complex.h: Likewise. * doc/cln.texi: Document that. -2007-02-06 Richard B. Kreckel +2008-02-06 Richard B. Kreckel Fix crash in output of huge numbers: * src/integer/conv/cl_I_to_digits.cc: Make erglen uintC. * src/integer/output/cl_I_print_string.cc: Make B_baselen uintC. -2007-02-04 Richard B. Kreckel +2008-02-04 Richard B. Kreckel Fix cl_F output of more than 2^32 decimal digits: * src/base/string/cl_sstring.cc (cl_sstring): make len uintC. * src/base/string/cl_sstring.h: Likewise. -2007-01-23 Bruno Haible +2008-01-23 Bruno Haible Allow 64-bit builds on MacOS X 10.5. * m4/general.m4 (CL_CANONICAL_HOST_CPU): Test for x86_64 CPU if "uname -m" returns "i386". Reported by Ron Garret . -2007-01-20 Bruno Haible +2008-01-20 Bruno Haible Avoid some gcc warnings. * autoconf/floatparam.c (flipped_double): Use a union instead of a @@ -105,17 +112,17 @@ * src/float/transcendental/cl_LF_zeta_int.cc (compute_zeta_cvz2): Remove unused local variable. -2007-01-19 Richard B. Kreckel +2008-01-19 Richard B. Kreckel * Version 1.2.0 released. -2007-01-19 Richard B. Kreckel +2008-01-19 Richard B. Kreckel * doc/Makefile.in: texi2html -split_chapter doesn't generate cln_toc.html any more. * doc/cln.texi: Add table of contents in TeX output. -2007-01-18 Alexei Sheplyakov +2008-01-18 Alexei Sheplyakov Fix linking problems on some platforms caused by inline/non-inline versions of same functions (obsoletes MAYBE_INLINE): diff --git a/configure.ac b/configure.ac index e5e06de..051223e 100644 --- a/configure.ac +++ b/configure.ac @@ -154,32 +154,12 @@ dnl checks for compiler characteristics dnl AC_C_CHAR_UNSIGNED dnl DEFS __CHAR_UNSIGNED__ if char is unsigned -test -d 'include/cln' || mkdir -p 'include/cln' CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,[CL_INTPARAM_CROSS],include/cln/intparam.h,cl_cv_file_intparam_h) dnl builds include/cln/intparam.h CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,[CL_FLOATPARAM_CROSS],include/cln/floatparam.h,cl_cv_file_floatparam_h) dnl builds include/cln/floatparam.h -dnl -dnl interfacing to GNU gmp (must be at least version 3) -dnl -AC_ARG_WITH(gmp, AS_HELP_STRING([--with-gmp], - [use external fast low-level functions from GNU MP (default: yes).]), - with_gmp="$withval", - with_gmp="yes") -if test "$with_gmp" = yes; then - CL_GMP_H_VERSION - if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi - if test "$with_gmp" = yes; then - CL_GMP_CHECK - if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi - fi -fi -if test "$with_gmp" = yes; then - CL_GMP_SET_UINTD - AC_DEFINE(CL_USE_GMP) -else - AC_MSG_WARN([disabling external GNU MP library]) -fi +CL_LIBGMP + dnl DEFS CL_USE_GMP, GMP_DEMANDS_UINTD_* dnl dnl That's it. dnl diff --git a/doc/cln.texi b/doc/cln.texi index 47a3bcc..813ce4a 100644 --- a/doc/cln.texi +++ b/doc/cln.texi @@ -471,6 +471,9 @@ Flags to be given to the C++ compiler when compiling programs (not when linking) @item CPPFLAGS Flags to be given to the C/C++ preprocessor. + +@item LDFLAGS +Flags to be given to the linker. @end table Examples: @@ -538,25 +541,31 @@ libraries so runtime-critical applications should be linked statically. @subsection Using the GNU MP Library @cindex GMP -Starting with version 1.1, CLN may be configured to make use of a -preinstalled @code{gmp} library for some low-level routines. Please -make sure that you have at least @code{gmp} version 3.0 installed -since earlier versions are unsupported and likely not to work. This -feature is known to be quite a boost for CLN's performance. +CLN may be configured to make use of a preinstalled @code{gmp} library +for some low-level routines. Please make sure that you have at least +@code{gmp} version 3.0 installed since earlier versions are unsupported +and likely not to work. Using @code{gmp} is known to be quite a boost +for CLN's performance. + +By default, CLN will autodetect @code{gmp} and use it. If you do not +want CLN to make use of a preinstalled @code{gmp} library, then you can +explicitly specify so by calling @code{configure} with the option +@samp{--without-gmp}. -By default, CLN will autodetect @code{gmp} and use it. But if you have -installed the @code{gmp} library and its header file in some place where -your compiler cannot find it by default, you must help @code{configure} -by setting @code{CPPFLAGS} and @code{LDFLAGS}. Here is an example: +If you have installed the @code{gmp} library and its header files in +some place where the compiler cannot find it by default, you must help +@code{configure} and specify the prefix that was used when @code{gmp} +was configured. Here is an example: @example -$ CFLAGS="-O2" CXXFLAGS="-O2" CPPFLAGS="-I/opt/gmp/include" \ - LDFLAGS="-L/opt/gmp/lib" ./configure --with-gmp +$ ./configure --with-gmp=/opt/gmp-4.2.2 @end example -If you do not want CLN to make use of a preinstalled @code{gmp} -library, then you can explicitly specify so by calling -@code{configure} with the option @samp{--without-gmp}. +This assumes that the @code{gmp} header files have been installed in +@file{/opt/gmp-4.2.2/include/} and the library in +@file{/opt/gmp-4.2.2/lib/}. More uncommon GMP installations can be +handled by setting CPPFLAGS and LDFLAGS appropriately prior to running +@code{configure}. @node Installing the library diff --git a/m4/gmp.m4 b/m4/gmp.m4 index 455a304..1ad8898 100644 --- a/m4/gmp.m4 +++ b/m4/gmp.m4 @@ -1,5 +1,5 @@ dnl -*- Autoconf -*- -dnl Copyright (C) 1993-2003 Free Software Foundation, Inc. +dnl Copyright (C) 1993-2008 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -28,7 +28,7 @@ AC_DEFUN([CL_GMP_CHECK], AC_TRY_LINK([#include ],[mpn_divexact_by3(0,0,0)], cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no") LIBS=$SAVELIBS]) - if test x"$cl_cv_new_libgmp" = xyes; then + if test "$cl_cv_new_libgmp" = yes; then LIBS="$LIBS -lgmp" fi ]) @@ -64,3 +64,62 @@ int main() { ]) AC_DEFINE_UNQUOTED($cl_gmp_demands) ]) + +dnl Whether or not to use GMP. Sets CL_USE_GMP. +dnl Also sets CPPFLAGS, LDFLAGS if --with-gmp=DIR was specified. +AC_DEFUN([CL_LIBGMP], +[AC_ARG_WITH(gmp, AS_HELP_STRING([--with-gmp@<:@=DIR@:>@], + [use external low-level functions from GNU MP (installed in prefix DIR) @<:@default=yes@:>@.]),[ + with_gmp="$withval" + ], + with_gmp="yes") +case $with_gmp in + yes) + dnl --with-gmp + CL_GMP_H_VERSION + if test "$cl_cv_new_gmp_h" = yes; then + CL_GMP_CHECK + if test "$cl_cv_new_libgmp" = yes; then + CL_GMP_SET_UINTD + AC_DEFINE(CL_USE_GMP) + else + AC_MSG_WARN([The GNU MP library is too old to be used.]) + fi + else + AC_MSG_WARN([The header file is too old to be used.]) + fi + ;; + no) + dnl --without-gmp + ;; + *) + dnl --with-gmp=DIR + case $withval in + [[\\/$]]* | ?:[[\\/]]* ) + ;; + *) AC_MSG_ERROR([expected an absolute directory name for --with-gmp: $withval]) + ;; + esac + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I${withval}/include" + saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L${withval}/lib" + CL_GMP_H_VERSION + if test "$cl_cv_new_gmp_h" = yes; then + CL_GMP_CHECK + if test "$cl_cv_new_libgmp" = yes; then + CL_GMP_SET_UINTD + AC_DEFINE(CL_USE_GMP) + else + AC_MSG_WARN([The GNU MP library is too old to be used.]) + CPPFLAGS="$saved_CPPFLAGS" + LDFLAGS="$saved_LDFLAGS" + fi + else + AC_MSG_WARN([The header file is too old to be used.]) + CPPFLAGS="$saved_CPPFLAGS" + LDFLAGS="$saved_LDFLAGS" + fi + ;; +esac +])