MinGW, gmp, mpfr (Wolfgang0815 at gmx.de)

Jim White mathimagics at yahoo.co.uk
Wed Sep 27 13:40:17 CEST 2006

> It seems to work now. With your hints, I found two
> solutions:
> 1. Copy the content of "C:\msys\1.0\local" to
> "C:\MinGW"
>  or
> 2. Execute "./configure  --with-gmp=/local"

Number 2 is in fact the recommended aproach  ;-)

> I'm still wondering: What is the 'standard' way of
> installing a package like gmp (or mpfr or similar)?

The "Make" and "Configure" subsystems are standard
Unix tools for assisting with configuration management
(software system generation).

Building any piece of software is ultimately the
simple task of compiling the appropriate source code
elements, then linking them together.

This can be done in one command line for a simple
application, but for a large package with many
different configuration options, it's usually wise to
employ some system, and "Make/Configure" do just that.

They are basically just scripting tools - Configure
does the preprocessing - selection of source files,
tweaking of settings in source files, etc, and it
generates a script that the Make  system uses to
perform the actual compilation and linking.

GMP's configure script was, when I last looked, many
thousands of lines (12+).  But what it delivers is a
reasonably simple way of building GMP.  Select the
target architecture and other relevant options
(gleaned from a careful reading of the first chapter
of The Fine Manual) and in most cases, everything is
done for you (and, what a relief that is!)

In large organisations, there is often a similar
problem with Version Control.  This roughly
corresponds to the "Configure" phase, but in addition
provides assistance with managing version control when
there is a large development team, with various
members working on different  components at different
times.  Sophisticated OS-independent commercial
packages for config management and version control
(like PVCS) are used by many large organisations.

If you're a private individual, building these systems
can be tough work, unless you have some sort of large
system generating experience (ie, worked as a systems
programmer), in which case, despite having little
experience with Unix at this (muddy) level, one can
generally work out what's going on.

> How do I get the compiler to find the header and lib
> files by itself? Is it standard procedure to copy
> the "local" directory to "MinGW" (which is the root
> directory inside MSys). Or can I tell "make install"
> to do so? I'd like to use gmp without telling the
> compiler where to find gmp.h and the libs each time
> I compile or link something with gmp.

The physical location of the various source components
is of course a fundamental issue when building
systems. If everything is located below the make
directory, there are no problems.

If one is linking two packages together, however, it
can become a hassle.  The Configure scripts here are
customised to allow you to avoid having to copy and
assemble all required files.  You can distinguish
between "generic" Make/Configure options (they have a
single "-" prefix) and options placed in there by the
creators "--" to help with specific package-related

The good folk at MPFR have provided the --with-gmp
option for this reason, to allow you to inform its
script of the actual location where you built gmp, on
which it relies.  

Working that out, and setting the parameter correctly,
was, if I remember my first MPFFR build, the key to
the kingdom ...  I got my DLL!

Keep at it ...

Jim White
ANU, canberra

More information about the gmp-discuss mailing list