Why is it compiling GMP so hard?

Sisyphus kalinabears at iinet.net.au
Wed Mar 9 23:54:28 CET 2005


Fausto Arinos Barbuto wrote:
>    
> Hi All;
> 
>     I got interested in GMP very recently -- yesterday, to be precise ;-) --
>     and downloaded the tarball for compilation of the sources. Sweet
>     illusion, it seemed to having started well but nothing worked. I
>     have W2000 and cygwin; 

Aaah, yes - the problem is that you've placed Cygwin in the wrong 
location. Try moving it to the Recycle Bin ;-)

Building GMP on Win32 is dead easy. First download MinGW:

http://prdownloads.sf.net/mingw/MinGW-3.1.0-1.exe?download

Then double click the executable and let the Wizard install MinGW (which 
includes a Win32 port of the gcc compiler) to the location of your choice.

Second download:

http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download

Then double click the executable and let the Wizard install the MSYS 
shell to the location of your choice. There's a short post-installation 
procedure that you have to go through to tell the MSYS shell where it 
can find the gcc compiler (it comes up automatically, too).

Then in the MSYS shell, cd to the top-level folder of the GMP source and 
run:

./configure

You can provide the documented configure options, too, if you want - all 
the ones that I have tried have worked.

Then run:

make

Then run:

make check

All of the tests should pass.

I have never been able to get 'make install' to do anything useful - 
though I haven't tried very hard for a while. Instead I just manually 
copy 'gmp.h' to my MinGW\include folder, and 'libgmp.a' to my MinGW\lib 
folder. If I've built a dll, I copy libgmp-3.dll to a location in my path.

I don't know why building GMP on Cygwin is troublesome for you - and I 
don't really care - but I *do* agree that building GMP on Cygwin *ought* 
to be straightforward. Perhaps it's the fault of the GMP developers, or 
perhaps it's the fault of the Cygwin developers, or perhaps it's your 
fault .... dunno :-)

I don't know if a GMP built using the procedure I've outlined will work 
under Cygwin - as you would normally be using it in a plain native Win32 
environment. If you positively, definitely have to have GMP working in a 
Cygwin environment it's probably best that you post a copy'n'paste of 
that 'm4' error message. Then someone might be able to help. Perhaps 
there's an m4 Cygwin package that you need to install ?? When I look 
inside my MSYS\bin I find a file called m4.exe. Is there an m4 
executable somewhere inside your Cygwin installation ??

Btw, I thought it quite ironic that a *Cygwin* user would complain about 
Unix crap .... I mean the whole *point* of Cygwin is to *bring* Unix 
"crap" to the Win32 environment :-)

Cheers,
Rob



More information about the gmp-discuss mailing list