Disable "Word Wrap" in Notepad under "Format" to make sure you copy the full (long) configure lines below. Compiling GMP 6.1.0: Run the following commands in MSYS2: step1) cd .. step2) cd gmp-6.1.0 Choose the configure line based on your processor architecture/generation. If you are unsure which one to use, then use the first generic one: Generic: step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -march=native -mtune=native" --enable-static --disable-shared Intel Skylake: https://en.wikipedia.org/wiki/Skylake_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -march=native -mtune=native" --build=skylake-w64-mingw32 --enable-static --disable-shared Intel Broadwell: https://en.wikipedia.org/wiki/Broadwell_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -march=broadwell -mtune=broadwell" --build=broadwell-w64-mingw32 --enable-static --disable-shared Intel Haswell: https://en.wikipedia.org/wiki/Haswell_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -march=haswell -mtune=haswell" --build=haswell-w64-mingw32 --enable-static --disable-shared Intel Ivy Bridge: https://en.wikipedia.org/wiki/Ivy_Bridge_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -march=ivybridge -mtune=ivybridge" --build=ivybridge-w64-mingw32 --enable-static --disable-shared Intel Sandy Bridge: https://en.wikipedia.org/wiki/Sandy_Bridge step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -march=sandybridge -mtune=sandybridge" --build=sandybridge-w64-mingw32 --enable-static --disable-shared Intel Westmere: https://en.wikipedia.org/wiki/Westmere_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -march=westmere -mtune=westmere" --build=westmere-w64-mingw32 --enable-static --disable-shared Intel Nehalem: https://en.wikipedia.org/wiki/Nehalem_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -march=nehalem -mtune=nehalem" --build=nehalem-w64-mingw32 --enable-static --disable-shared Intel Core2: https://en.wikipedia.org/wiki/Intel_Core_2 step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -march=core2 -mtune=core2" --build=core2-w64-mingw32 --enable-static --disable-shared AMD Excavator Family 15h: https://en.wikipedia.org/wiki/Excavator_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -mfma4 -march=bdver4 -mtune=bdver4" --build=excavator-w64-mingw32 --enable-static --disable-shared AMD Steamroller Family 15h: https://en.wikipedia.org/wiki/Steamroller_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma -mfma4 -march=bdver3 -mtune=bdver3" --build=steamroller-w64-mingw32 --enable-static --disable-shared AMD Piledriver Family 15h: https://en.wikipedia.org/wiki/Piledriver_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma -mfma4 -march=bdver2 -mtune=bdver2" --build=piledriver-w64-mingw32 --enable-static --disable-shared AMD Bulldozer Family 15h: https://en.wikipedia.org/wiki/Bulldozer_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma4 -march=bdver1 -mtune=bdver1" --build=bulldozer-w64-mingw32 --enable-static --disable-shared AMD Barcelona K10 Family 10h: https://en.wikipedia.org/wiki/AMD_10h step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma4 -march=barcelona -mtune=barcelona" --build=k10-w64-mingw32 --enable-static --disable-shared AMD (SoC) Puma + Jaguar Family 16h: https://en.wikipedia.org/wiki/Puma_(microarchitecture) https://en.wikipedia.org/wiki/Jaguar_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse4a -msse4.1 -msse4.2 -mavx -march=btver2 -mtune=btver2" --build=jaguar-w64-mingw32 --enable-static --disable-shared AMD (SoC) Bobcat Family 14h: https://en.wikipedia.org/wiki/Bobcat_(microarchitecture) step3) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -msse4a -march=btver1 -mtune=btver1" --build=bobcat-w64-mingw32 --enable-static --disable-shared step4) make step5) make install step6) make check step7) cd .. Compiling GMP-ECM latest svn: Run the following commands in MSYS2: step1) cd gmpecm step2) ./svn.bat (This will download the latest svn of GMPECM. If this fails extract "c:\msys64\home\gmpecm-svn2916.7z" to the folder "c:\msys64\home" folder using 7-zip. it will extract the subfolder "gmpecm". Make sure you are still in the /home/gmpecm folder in MSYS2.) step3) autoreconf -i Choose the configure line based on your processor architecture/generation. If you are unsure which one to use, then use the first generic one: Generic: step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -march=native -mtune=native" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Skylake(No AVX512): https://en.wikipedia.org/wiki/Skylake_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -march=native -mtune=native" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Broadwell: https://en.wikipedia.org/wiki/Broadwell_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -march=broadwell -mtune=broadwell" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Haswell: https://en.wikipedia.org/wiki/Haswell_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -march=haswell -mtune=haswell" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Ivy Bridge: https://en.wikipedia.org/wiki/Ivy_Bridge_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -march=ivybridge -mtune=ivybridge" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Sandy Bridge: https://en.wikipedia.org/wiki/Sandy_Bridge step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -march=sandybridge -mtune=sandybridge" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Westmere: https://en.wikipedia.org/wiki/Westmere_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -march=westmere -mtune=westmere" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Nehalem: https://en.wikipedia.org/wiki/Nehalem_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -march=nehalem -mtune=nehalem" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert Intel Core2: Intel Core2: https://en.wikipedia.org/wiki/Intel_Core_2 step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -march=core2 -mtune=core2" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert AMD Excavator Family 15h: https://en.wikipedia.org/wiki/Excavator_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mavx2 -mfma -mfma4 -march=bdver4 -mtune=bdver4" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert AMD Steamroller Family 15h: https://en.wikipedia.org/wiki/Steamroller_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma -mfma4 -march=bdver3 -mtune=bdver3" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert AMD Piledriver Family 15h: https://en.wikipedia.org/wiki/Piledriver_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma -mfma4 -march=bdver2 -mtune=bdver2" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert AMD Bulldozer Family 15h: https://en.wikipedia.org/wiki/Bulldozer_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma4 -march=bdver1 -mtune=bdver1" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert AMD Barcelona K10 Family 10h: https://en.wikipedia.org/wiki/AMD_10h step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -mavx -mfma4 -march=barcelona -mtune=barcelona" CPPFLAGS="-I/usr/local/include" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert AMD (SoC) Puma + Jaguar Family 16h: https://en.wikipedia.org/wiki/Puma_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse4a -msse4.1 -msse4.2 -mavx -march=btver2 -mtune=btver2" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert AMD (SoC) Bobcat Family 14h: https://en.wikipedia.org/wiki/Bobcat_(microarchitecture) step4) ./configure ABI=64 CC=gcc CFLAGS="-O3 -m64 -msse2 -msse3 -mssse3 -msse4a -march=btver1 -mtune=btver1" LDFLAGS="-Wl,--stack,16777216 -L/usr/local/lib" --build=x86_64-w64-mingw32 --disable-assert step5) make Tuning parameters in step6, shut down other processes with significant cpu usage step6) make ecm-params Extra tuning steps 6a-6c (Optional). step6a) make bench_mulredc Tuning parameters in step6b, shut down other processes with significant cpu usage step6b) ./bench_mulredc.exe >> ecm-params.h step6c) notepad ecm-params.h Mark the last 4 lines in "ecm-params.h" and cut (CTRL+X) and then mark the first 4 lines and paste (CTRL+V), and then save (CTRL+S). You are replacing the preexisting tuning parameters in the first 4 lines with the last 4 lines just created by "bench_mulredc.exe". The 4 lines in question are those starting with: /* 0:mulredc 1:mul+redc_1 ..... #define TUNE_MULREDC_TABLE ..... /* 0:mulredc 1:sqr+redc_1 ..... #define TUNE_SQRREDC_TABLE ..... step7) make check step8) make install The compiled GMP-ECM "ecm.exe" is now in the "C:\msys64\home\gmpecm" folder.