Next: MPIR.Net Integers, Previous: MPIR.Net Feature Overview, Up: .Net Interface [Index]
To build MPIR.Net, follow the steps below:
Get the sources: Clone the MPIR repository on GitHub to get the latest stable MPIR release. This repository includes MPIR.Net. Or you can clone the MPIR.Net fork, which will get you the development repository.
Build MPIR: Once you have the sources, you will need to build MPIR first. Read the MPIR manual, available as a Documentation link on the MPIR page, for full details. Since MPIR.Net currently requires Windows, you will need to build MPIR for Windows using Microsoft Visual Studio. MPIR provides solutions for the three latest versions of Visual Studio, and includes full build instructions. You can select either a generic C build or an optimized build for a specific processor. You must also select the Windows architecture desired (32-bit or 64-bit), and build configuration (debug/release). You will need to build MPIR as Lib, not DLL, to use it with MPIR.Net.
Run MPIR unit tests: MPIR contains a full suite of unit tests that you can (and should) execute to validate your build. It is a large and complex project, and many things can go wrong while building from sources. Building and running the tests only takes a few of minutes and might save you a lot of headache. Note that you must also build MPIR’s C++ interface to run unit tests, however it is not a dependency for MPIR.Net.
Build MPIR.Net: Next, load the MPIR.Net solution in Visual Studio. It is located in the MPIR.Net folder, under which there are folders for the different supported Visual Studio versions. The projects are set up to look for the previously built MPIR library in its normal location in the Lib folder. You will need to select the same architecture (x64 or x86) and configuration (debug/release) as when you built MPIR. Then simply build the solution, and you are good to go.
Run MPIR.Net unit tests: MPIR.Net includes its own suite of unit tests. Because MPIR.Net is a wrapper around MPIR, these tests simply ensure that the right routines in MPIR are being called, but do not validate the robustness of the MPIR build itself. Thus, it is necessary to run both MPIR tests and MPIR.Net tests. MPIR.Net tests, though, are easier to run because they are included right in the MPIR.Net solution.
Through binary compatibility with GMP 5.x, MPIR 2.x inherits a known issue that causes a few MPIR.Net tests (2 for x86, 3 for x64) to fail. The issue has been corrected in GMP 6.x, and is expected to be corrected correspondingly in MPIR 3.x. Because this behavior is not intuitive, these tests remain in their current failing state until this is resolved.
Reference MPIR.Net: With the MPIR.Net assembly built, you’re ready to create your own project in a .Net language of your choice, add a reference to MPIR.Net, and take advantage of the great mathematical powers of MPIR!
Next: MPIR.Net Integers, Previous: MPIR.Net Feature Overview, Up: .Net Interface [Index]