-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Wikus Coetser edited this page Feb 9, 2016
·
6 revisions
#How to compile the GNU Multi Precision Arithmetic Library for Windows
- Download msys2 (https://msys2.github.io/)
- Update msys2 (http://sourceforge.net/p/msys2/wiki/MSYS2%20introduction/)
- Install compiler toolchain: (On the msys2 command line). Run "pacman -S mingw-w64-x86_64-gcc" and "pacman -S autoconf make automake"
- Download gmp and copy to C:\msys64\home\Administrator (Note: "Administrator" could be your Windows username.)
- Run C:\msys64\mingw64_shell
- cd to /home/Administrator/gmp-6.1.0
- Run: ./configure --disable-static --enable-shared (to make a DLL file)
- Run: make
- Watch C stuff scroll by.
- Run: "make check", to check that GMP has build as expected and all tests pass.
- Get the end-product libraries: copy them from C:\msys64\home\Administrator\gmp-6.1.0\.libs
- Check the export functions: run "dumpbin /exports .\GMP.libs\libgmp-10.dll" on the "visual studio" command prompt. This showed 620 exported functions with their actual names used in DllImport(EntryPoint=...)
- Get the config.h file generated in the compilation process to see that defines where used. (ex. C:\msys64\home\Administrator\gmp-6.1.0\config.h). This give the define statements used to compile GMP and can help with reading the compiled code in order to create structs etc. for PInvoke.