diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-05-25 10:43:08 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-05-25 10:43:08 +0000 |
commit | d267e248a2288207688a10bdffb76f56a8beec02 (patch) | |
tree | 5bd71d77f1657789d7cab3354c6c1717829a0387 /INSTALL | |
parent | a602bf6fdb0b811bf9eb4c7de06cd2fa94a351ef (diff) | |
download | mpfr-d267e248a2288207688a10bdffb76f56a8beec02.tar.gz |
[INSTALL] Reverted incorrect changeset r6870.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6872 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'INSTALL')
-rw-r--r-- | INSTALL | 692 |
1 files changed, 355 insertions, 337 deletions
@@ -1,365 +1,383 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. 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'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' 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. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - 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'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `<wchar.h>' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type +Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +Contributed by the Arenaire and Cacao projects, INRIA. + +This file is part of the GNU MPFR Library. + +The GNU MPFR Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The GNU MPFR Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see +http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + + + + Installing GNU MPFR + =================== + +Note: In case of problem, please read this INSTALL file carefully before +reporting a bug, in particular Section "In case of problem" below. Some +problems are due to bad configuration on the user side (not specific to +MPFR). + +0. You first need to install GMP. See <http://www.gnu.org/software/gmp/>. + MPFR requires GMP version 4.1 or later. + +1. Extract the files from the archive. + +2. It is strongly advised to apply the latest patches (if this has + not been done yet), e.g. + wget http://www.mpfr.org/mpfr-3.0.0/patches + patch -N -Z -p1 < patches + or + curl http://www.mpfr.org/mpfr-3.0.0/patches | patch -N -Z -p1 + + (Those instructions are for the GNU patch command, for example + /usr/bin/gpatch on Solaris.) + +3. In the MPFR directory, to detect your system, type: + ./configure + possibly with options (see below, in particular if this step or + one of the following fails). + Note: paths provided in configure options must always be absolute + (relative paths are not supported). + +4. To build the library, type: + make + +5. To check the built library (runs the test files), type: + make check + +6. To install it (default "/usr/local" | see "--prefix" option), type: + make install + +If you installed MPFR (header and library) in directories that are +not searched by default by the compiler and/or linking tools, then, +like with other libraries, you may need to set up some environment +variables such as C_INCLUDE_PATH (to find the header mpfr.h), +LIBRARY_PATH (to find the library), and if the shared library has +been installed, LD_LIBRARY_PATH (before execution) or LD_RUN_PATH +(before linking); this list is not exhaustive and some environment +variables may be specific to your system. "make install" gives some +instructions; please read them. You can also find more information +in the manuals of your compiler and linker. The MPFR FAQ may also +give some information. + +Remember that if you have several MPFR (or GMP) versions installed +(e.g., one with the system, and one, newer, by you), you will not +necessarily get a compilation/linking error if a wrong library is +used (e.g., because LD_LIBRARY_PATH has not been set correctly). +But unexpected results may occur. + +Under Mac OS X, if the shared library was not installed and you use +Apple's linker (this is the default), you will also need to provide +the -search_paths_first linker flag ("-Wl,-search_paths_first" when +you link via gcc) to make sure that the right library is selected, +as by default, Apple's linker selects a shared library preferably, +even when it is farther in the library paths. We recall that if a +wrong library is selected due to this behavior, unexpected results +may occur. + + +Building the documentation ========================== - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: +To build the documentation in various formats, you may first need to +install recent versions of some utilities such as texinfo. - CPU-COMPANY-SYSTEM +* Type "make info" to produce the documentation in the info format. -where SYSTEM can have one of these forms: +* Type "make pdf" to produce the documentation in the PDF format. - OS - KERNEL-OS +* Type "make dvi" to produce the documentation in the DVI format. - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. +* Type "make ps" to produce the documentation in the Postscript format. - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. +* Type "make html" to produce the documentation in the HTML format + (in several pages); if you want only one output HTML file, then + type "makeinfo --html --no-split mpfr.texi" instead. - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. -Sharing Defaults -================ +Building MPFR with internal GMP header files +============================================ - 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. +MPFR built with internal GMP header files is a bit faster, so you may want +to build it with them. Just do this in step 1: -Defining Variables -================== + ./configure --with-gmp-build=GMPBUILD - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: +where GMPBUILD is the GMP build directory. The needed header files are: +gmp-impl.h, longlong.h and all the necessary headers to use them. - ./configure CC=/usr/local2/bin/gcc +Warning: the library obtained in this way may use some internal GMP +symbols, and thus dynamically linking your software with a different +version of GMP might fail, even though it is declared as compatible +by Libtool's versioning system. -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: +./configure options +=================== - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash +--prefix=DIR installs MPFR headers and library in DIR/include and + DIR/lib respectively (the default is "/usr/local"). -`configure' Invocation -====================== +--with-gmp-include=DIR assumes that DIR contains gmp.h +--with-gmp-lib=DIR assumes that DIR contains the GMP library +--with-gmp=DIR assumes that DIR is where you have installed GMP. + same as --with-gmp-lib=DIR/lib + and --with-gmp-include=DIR/include + (use either --with-gmp alone or one or both of + --with-gmp-lib/--with-gmp-include) + 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 + *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. - `configure' recognizes the following options to control how it -operates. +--with-gmp-build=DIR assumes that DIR contains the source of GMP and + enables the use of GMP internals. + Try to set CC/CFLAGS to GMP's ones. This is not + guaranteed to work as the configure script does + some compiler tests earlier, and the change may + be too late. + Warning! This option and the group of options + --with-gmp are mutually exclusive. -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. +--enable-assert build MPFR with assertions. -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. +--enable-thread-safe build MPFR as thread safe, using compiler-level + Thread Local Storage (TLS). Note: TLS support is + roughly tested by configure. If configure detects + that TLS does not work (because of the compiler, + linker or system libraries), it will output an + error message, telling you to build MPFR without + thread safe. For instance, though Mac OS X uses + GCC, it may not currently support GCC's __thread + storage class. -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. +Run "./configure --help" to see the other options (autoconf default options). -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). +In case of problem +================== -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. +First, look for any warning message in the configure output. + +Several documents may help you to solve the problem: + * this INSTALL file, in particular information given below; + * the FAQ (either the FAQ.html file distributed with MPFR, or the + on-line version <http://www.mpfr.org/faq.html>, which may be more + up-to-date); + * the MPFR web page for this version <http://www.mpfr.org/mpfr-3.0.0/>, + which lists bugs found in this version and provides some patches. + +If the "configure" fails, please check that the C compiler and its +options are the same as those for the GMP build (specially the ABI). +You can see the latter with the following command: + + grep "^CC\|^CFLAGS" GMPBUILD/Makefile + +if the GMP build directory is available. Then type: + + ./configure <configure options> CC=<C compiler> CFLAGS="<compiler options>" + +(quotes are needed when there are spaces or other special characters +in the CC/CFLAGS value) and continue the install. On some platforms, +you should provide further options to match those used by GMP, or set +some environment variables. For instance, see the "Notes on AIX/PowerPC" +section below. + +Warning! Do NOT use optimization options that can change the semantics +of math operations, such as GCC's -ffast-math or Sun CC's -fast. +Otherwise conversions from/to double's may be incorrect on infinities, +NaN's and signed zeros. Since native FP arithmetic is used in a few +places only, such options would not make MPFR faster anyway. + +On some platforms, try with "gmake" (GNU make) instead of "make". +Problems have been reported with the Tru64 make. + +If the configure script reports that gmp.h version and libgmp version +are different, or if the build was OK, but the tests failed to link +with GMP or gave an error like + + undefined reference to `__gmp_get_memory_functions' + +meaning that the GMP library was not found or a wrong GMP library was +selected by the linker, then your library search paths are probably +not correctly set (some paths are missing or they are specified in an +incorrect order). + +Such problems commonly occur under some GNU/Linux machines, where the +default header and library search paths may be inconsistent: GCC is +configured to search /usr/local/include and /usr/local/lib by default, +while the dynamic linker ignores /usr/local/lib. If you have a GMP +version installed in /usr (provided by the OS vendor) and a new one +installed in /usr/local, then the header of the new GMP version and +the library of the old GMP version will be used! The best solution +is to make sure that the dynamic linker configuration is consistent +with GCC's behavior, for instance by having /usr/local/lib in +/etc/ld.so.conf or in some file from /etc/ld.so.conf.d (as Debian +did: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395177). See +also http://gcc.gnu.org/ml/gcc-help/2010-01/msg00171.html for more +information. Alternatively you can use: + * environment variables. This may sometimes be necessary. If DIR + is the installation directory of GMP, add DIR/include to your + CPATH or C_INCLUDE_PATH (for compilers other than GCC, please + check the manual of your compiler), and add DIR/lib to your + LIBRARY_PATH and LD_LIBRARY_PATH (and/or LD_RUN_PATH); + * --with-gmp* configure options (described above), e.g. + --with-gmp=/opt/local (to use /opt/local/include for headers and + /opt/local/lib for libraries), but other software that uses GMP + and/or MPFR will need correct paths too, and environment variables + allow one to set such search paths in a global way. + Note about "--with-gmp=/usr/local". This option may appear to + solve the above inconsistency problem, but does not work as you + expect. Indeed it affects the library search path, in particular, + the one used by the dynamic linker (thus adding the missing + /usr/local/lib directory as wanted), but since /usr/local/include + is a "standard system include directory" for GCC, the include + search patch is not changed; this is often not a problem in this + particular case because usually, /usr/local/include is already + last in the include search patch, but this may fail under some + occasions and may trigger obscure errors. + +For instance, under Unix, where paths are separated by a colon: + + * With POSIX sh-compatible shells (e.g. sh, ksh, bash, zsh): + export C_INCLUDE_PATH="/usr/local/include:/other/path/include" + export LIBRARY_PATH="/usr/local/lib:/other/path/lib" + export LD_LIBRARY_PATH="$LIBRARY_PATH" + + * With csh or tcsh: + setenv C_INCLUDE_PATH "/usr/local/include:/other/path/include" + setenv LIBRARY_PATH "/usr/local/lib:/other/path/lib" + setenv LD_LIBRARY_PATH "$LIBRARY_PATH" + +If you can't solve your problem, you should contact us at <mpfr@loria.fr>, +indicating the machine and operating system used (uname -a), the compiler +and version used (gcc -v if you use gcc), the configure options used if +any (including variables such as CC and CFLAGS), the version of GMP and +MPFR used, and a description of the problem encountered. Please send us +also the log of the "configure" (config.log). + +Note that even if you can build MPFR with a C++ compiler, you can't run +the test suite: C and C++ are not the same language! You should use a C +compiler instead. + + +Notes on FreeBSD 4.3 +==================== + +FreeBSD 4.3 is provided with an incorrect <float.h> header file, and +MPFR tests related to long double's may fail. If you cannot upgrade +the system, you can still use MPFR with FreeBSD 4.3, but you should +not use conversions with the long double type. + + +Notes on AIX/PowerPC +==================== + +The following has been tested on AIX 5.3 (powerpc-ibm-aix5.3.0.0) with +gcc 3.3.2 and GMP 4.2.1. + +If GMP was built with the 64-bit ABI, before building and testing MPFR, +you should set the OBJECT_MODE environment variable to 64, e.g., with: + + export OBJECT_MODE=64 + +(in a sh-compatible shell). But you should also provide a correct CFLAGS +value to the "configure" script: using --with-gmp-build is not sufficient +due to the early compiler tests, as gcc will not compile any program if +OBJECT_MODE is 64 and the -maix64 option is not provided. + + +Notes on 32-bit Windows Applications (win32) +============================================ + +1 - We advise to use MinGW (http://www.mingw.org/), which is simpler and + less demanding than Cygwin. Contrary to Cygwin, it also provides native + Windows code. The binaries compiled with Cygwin require a dynamic + library (cygwin.dll) to work; there is a Cygwin option -mno-cygwin to + build native code, but it may require some non-portable tricks. + +2 - If you just want to make a binary with gcc, there is nothing to do: + GMP, MPFR and the program compile exactly as under Linux. + But if you want to generate a library for MinGW from a Cygwin + environment, you may need the -mno-cygwin gcc option (otherwise + a typical error is _P_WAIT being undeclared). + +3 - If you want to make libraries to work under another Windows compiler + like Visual C / C++, you have two options. Since the unix-like *.a + library files are compatible with Windows *.lib files, you can simply + rename all *.a libraries to *.lib. The second option is to build + MPFR with the Microsoft Visual Studio compiler to produce Windows + libraries directly (Visual Studio build projects for MPFR are + available at http://fp.gladman.plus.com/computing/gmp4win.htm). + + With gmp-4.1.3, the only remaining problem seems to be the "alloca" calls + in GMP. Configuring GMP and MPFR with --enable-alloca=malloc-reentrant + should work (if you build MPFR with GMP internal files). + + Or you could add the library + "$MINGWIN$/lib/gcc-lib/mingw32/$VERSION$/libgcc.a" + to your project: it contains all the extra-functions needed by a program + compiled by gcc (division of 64-bit integer, bcopy, alloca...). + Of course, include it if and only if your compiler is not gcc. + +4 - On Windows32 / MinGW, if all the tests fail, try to run the test suite + with "make check EXEEXT=". + +5 - To avoid using the Microsoft runtime (which might not be conform to ISO C), + you can use the MinGW runtime package (which is an integral part of MinGW). + For example, with MinGW versions 3.15 and later you can get an + ISO-compliant printf() if you compile your application with either + '-ansi', '-posix' or '-D__USE_MINGW_ANSI_STDIO'. For example, you can + compile and test MPFR with CC="gcc -D__USE_MINGW_ANSI_STDIO". + + For example under Win32, the following problem has been experienced with + MPFR 2.4.0 RC1 and the MSVC runtime (msvcrt.dll): + + Error in mpfr_vsprintf (s, "%.*Zi, %R*e, %Lf%n", ...); + expected: "00000010610209857723, -1.2345678875e+07, 0.032258" + got: "00000010610209857723, -1.2345678875e+07, -0.000000" + FAIL: tsprintf.exe + + This error is due to the MSVC runtime not supporting the L length modifier + for formatted output (e.g. printf with %Lf). You can check this with the + following program: + + #include <stdio.h> + int main (void) + { + long double d = 1. / 31.; + printf ("%Lf\n", d); + return 0; + } + + The expected output is 0.032258. -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. + Note: The L modifier has been standard for a long time (it was added + in ISO C89). -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. +Notes on 64-bit Windows Applications (x64) +========================================== -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. +[See the Notes on 32-bit Windows Applications, which might be relevant here, + in particular when running a 64-bit operating system] +Cygwin and MinGW do not yet offer support for native Windows 64 builds but +the 32-bit version of MPFR can be used to build 32-bit applications that +will run on 64-bit Windows systems (see above). MPFR can be built as a native +64-bit static or DLL library for Windows 64 using the Visual Studio build +projects at http://fp.gladman.plus.com/computing/gmp4win.htm. |