11

Is there an easy way to build the GMP (GNU Multiple Precision Arithmetic Library, http://gmplib.org) under Windows, using Visual Studio 2005? I tried to find information about building the library myself, but could not find anything that really helped me. I'm not very experienced with building libraries myself (I've managed to build boost, but that's about it).

Or is there a stable (pre-built) GMP distribution that I'm unaware of?

Is MPIR a valid alternative (http://www.mpir.org)? Comment about MPIR on the GMP site: This "angry GMP fork" might be an alternative to the real GMP for some Windows users, but they'll have to deal with lots of anti-GMP sentiments.

Edit: The MPFR C++ wrapper page contains information/links to GMP/MPFR solutions for Visual Studio and compiled gmp/mpfr libraries as well: http://www.holoborodko.com/pavel/mpfr/

asked Jun 19, 2009 at 9:20
2
  • This question is old and already answered, but I have recently written an article that may be of use -- it shows how to install and use MPIR in Visual C++: exploringbinary.com/… . Commented Mar 5, 2010 at 15:01
  • Please put a look at my answer, just wrote it now, it describes in very details 3 ways of compiling GMP and MPIR under Windows VisualStudio. Commented Sep 26, 2022 at 9:53

2 Answers 2

9

MPIR is a valid alternative. Basically, the GMP folk didn't want to support building on Windows at all. Brian Gladman, as you can see, supported GMP building on Windows for a while. However, eventually he and others forked GMP and created MPIR. That wasn't the sole reason but it was a large driving factor and one of the key development principles of MPIR is it must build on Windows (as well as Linux and Mac).

answered Jan 24, 2010 at 1:28
Sign up to request clarification or add additional context in comments.

1 Comment

I just tried MPIR on Visual Studio Community 2017 and it works. Also tested a tutorial example from here: cs.colorado.edu/~srirams/courses/csci2824-spr14/… . Just follow the instructions in the documentation to build on Visual Studio. This should be the accepted answer.
1

If you want to quickly get started with GMP on windows, I've shared a my Visual Studio project which uses prebuilt GMP: https://stackoverflow.com/a/38176221/1327178.

answered Jul 4, 2016 at 2:43

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.