{"id":249,"date":"2012-03-24T01:02:54","date_gmt":"2012-03-23T17:02:54","guid":{"rendered":"http:\/\/newbiecoder.0ginr.com\/blog\/?p=249"},"modified":"2012-03-24T04:21:39","modified_gmt":"2012-03-23T20:21:39","slug":"mingw%e8%87%aa%e5%b8%a6%e7%9a%84msys%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%96%b0%e7%89%88%e6%9c%acgmp%e7%bc%96%e8%af%91ppl","status":"publish","type":"post","link":"https:\/\/newbiecoder.0ginr.com\/blog\/?p=249","title":{"rendered":"MinGW\u81ea\u5e26\u7684MSYS\u4e2d\u4f7f\u7528\u65b0\u7248\u672cGMP\u7f16\u8bd1PPL"},"content":{"rendered":"<p>\u5728MinGW\u81ea\u5e26\u7684MSYS\uff08\u7406\u8bba\u4e0a\u6765\u8bb2\u5355\u72ec\u914d\u7f6e\u7684MSYS\u6574\u5408MinGW\u4e5f\u53ef\u80fd\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\u3002\uff09\u4e2d\u4f7f\u7528\u65b0\u7248\u672cGMP\u7f16\u8bd1PPL\uff08\u52a8\u6001\u94fe\u63a5\uff09\u53ef\u80fd\u4f1a\u51fa\u73b0\u4ee5\u4e0b\u9519\u8bef\uff1a<\/p>\n<p><code>checking for the GMP library version 4.1.3 or above... no<br \/>\nconfigure: error: Cannot find GMP version 4.1.3 or higher.<br \/>\nGMP is the GNU Multi-Precision library:<br \/>\nsee http:\/\/www.swox.com\/gmp\/ for more information.<br \/>\nWhen compiling the GMP library, do not forget to enable the C++ interface:<br \/>\nadd --enable-cxx to the configuration options.<\/code><\/p>\n<p>\u5728config.log\u91cc\u9762\u53ef\u4ee5\u67e5\u5230\u5982\u4e0b\u9519\u8bef\u7ec6\u8282\uff1a<\/p>\n<p><code>configure:10021: checking for the GMP library version 4.1.3 or above<br \/>\nconfigure:10110: g++ -o conftest.exe  -g -O2 -frounding-math   -I\/mingwlibs\/include  conftest.cpp  -L\/mingwlibs\/lib -lgmpxx -lgmp >&5<br \/>\nconfigure:10110: $? = 0<br \/>\nconfigure:10110: .\/conftest.exe<br \/>\nGMP header (gmpxx.h) and library (ligmpxx.*) version mismatch:<br \/>\nheader gives 5.0.4;<br \/>\nlibrary gives 5.0.1.<br \/>\nconfigure:10110: $? = 1<br \/>\nconfigure: program exited with status 1<br \/>\nconfigure: failed program was:<br \/>\n| \/* confdefs.h *\/<br \/>\n| #define PACKAGE_NAME \"the Parma Polyhedra Library\"<br \/>\n| #define PACKAGE_TARNAME \"ppl\"<br \/>\n| #define PACKAGE_VERSION \"0.12\"<br \/>\n| #define PACKAGE_STRING \"the Parma Polyhedra Library 0.12\"<br \/>\n| #define PACKAGE_BUGREPORT \"ppl-devel@cs.unipr.it\"<br \/>\n| #define PACKAGE_URL \"\"<br \/>\n| #define PPL_CONFIGURE_OPTIONS \" '--disable-static' '--enable-shared' '--with-gmp=\/mingwlibs' '--prefix=\/mingwlibs' '--host=i686-pc-mingw32' 'host_alias=i686-pc-mingw32'\"<br \/>\n| #define PPL_NDEBUG 1<br \/>\n| #define PPL_FPMATH_MAY_USE_387 1<br \/>\n| #define PPL_FPMATH_MAY_USE_SSE 1<br \/>\n| #define PPL_COEFFICIENT_TYPE mpz_class<br \/>\n| #define PPL_COEFFICIENT_BITS 0<br \/>\n| #define PPL_GMP_INTEGERS 1<br \/>\n| #define STDC_HEADERS 1<br \/>\n| #define HAVE_SYS_TYPES_H 1<br \/>\n| #define HAVE_SYS_STAT_H 1<br \/>\n| #define HAVE_STDLIB_H 1<br \/>\n| #define HAVE_STRING_H 1<br \/>\n| #define HAVE_MEMORY_H 1<br \/>\n| #define HAVE_STRINGS_H 1<br \/>\n| #define HAVE_INTTYPES_H 1<br \/>\n| #define HAVE_STDINT_H 1<br \/>\n| #define HAVE_UNISTD_H 1<br \/>\n| #define HAVE_TYPEOF 1<br \/>\n| #define SIZEOF_CHAR 1<br \/>\n| #define SIZEOF_SHORT 2<br \/>\n| #define SIZEOF_INT 4<br \/>\n| #define SIZEOF_LONG 4<br \/>\n| #define SIZEOF_LONG_LONG 8<br \/>\n| #define SIZEOF_SIZE_T 4<br \/>\n| #define SIZEOF_FLOAT 4<br \/>\n| #define SIZEOF_DOUBLE 8<br \/>\n| #define SIZEOF_LONG_DOUBLE 12<br \/>\n| #define SIZEOF_INTP 4<br \/>\n| #define SIZEOF_FP 4<br \/>\n| #define HAVE_FENV_H 1<br \/>\n| #define PPL_CAN_CONTROL_FPU 1<br \/>\n| #define PPL_CXX_PLAIN_CHAR_IS_SIGNED 1<br \/>\n| #define PPL_CXX_PROVIDES_PROPER_LONG_DOUBLE 1<br \/>\n| #define PPL_CXX_FLOAT_BINARY_FORMAT PPL_FLOAT_IEEE754_SINGLE<br \/>\n| #define PPL_CXX_FLOAT_EXACT_OUTPUT 0<br \/>\n| #define PPL_SUPPORTED_FLOAT 0<br \/>\n| #define PPL_CXX_DOUBLE_BINARY_FORMAT PPL_FLOAT_IEEE754_DOUBLE<br \/>\n| #define PPL_CXX_DOUBLE_EXACT_OUTPUT 1<br \/>\n| #define PPL_SUPPORTED_DOUBLE 1<br \/>\n| #define PPL_CXX_LONG_DOUBLE_BINARY_FORMAT PPL_FLOAT_INTEL_DOUBLE_EXTENDED<br \/>\n| #define PPL_CXX_LONG_DOUBLE_EXACT_OUTPUT 1<br \/>\n| #define PPL_SUPPORTED_LONG_DOUBLE 1<br \/>\n| #define PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS 1<br \/>\n| #define PPL_CXX_SUPPORTS_IEEE_INEXACT_FLAG 1<br \/>\n| #define PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK 1<br \/>\n| #define HAVE_FENV_H 1<br \/>\n| #define HAVE_GETOPT_H 1<br \/>\n| #define HAVE_SIGNAL_H 1<br \/>\n| #define HAVE_STRING_H 1<br \/>\n| #define HAVE_STRINGS_H 1<br \/>\n| #define HAVE_SYS_TIME_H 1<br \/>\n| #define HAVE_SYS_TYPES_H 1<br \/>\n| #define HAVE_UNISTD_H 1<br \/>\n| #define HAVE_DECL_FFS 0<br \/>\n| #define HAVE_DECL_GETENV 1<br \/>\n| #define HAVE_DECL_STRTOF 1<br \/>\n| #define HAVE_DECL_STRTOD 1<br \/>\n| #define HAVE_DECL_STRTOLD 1<br \/>\n| #define HAVE_DECL_STRTOLL 1<br \/>\n| #define HAVE_DECL_STRTOULL 1<br \/>\n| #define HAVE_DECL_FMA 1<br \/>\n| #define HAVE_DECL_FMAF 1<br \/>\n| #define HAVE_DECL_FMAL 1<br \/>\n| #define HAVE_DECL_RINTF 1<br \/>\n| #define HAVE_DECL_RINTL 1<br \/>\n| #define HAVE_INT_FAST16_T 1<br \/>\n| #define HAVE_INT_FAST32_T 1<br \/>\n| #define HAVE_INT_FAST64_T 1<br \/>\n| #define HAVE_UINT_FAST16_T 1<br \/>\n| #define HAVE_UINT_FAST32_T 1<br \/>\n| #define HAVE_UINT_FAST64_T 1<br \/>\n| #define HAVE_UINTPTR_T 1<br \/>\n| \/* end confdefs.h.  *\/<br \/>\n|<br \/>\n| #include <gmpxx.h><br \/>\n| #include <climits><br \/>\n| #include <string><br \/>\n| #include <sstream><br \/>\n| #include <iostream><br \/>\n|<br \/>\n| #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 &#038;&#038; __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 &#038;&#038; __GNU_MP_VERSION_MINOR == 1 &#038;&#038; __GNU_MP_VERSION_PATCHLEVEL < 3)\n| #GMP version 4.1.3 or higher is required\n| #endif\n| \n| #ifndef BITS_PER_MP_LIMB\n| #define BITS_PER_MP_LIMB GMP_LIMB_BITS\n| #endif\n| \n| int\n| main() {\n|   std::string header_version;\n|   {\n|     std::ostringstream s(header_version);\n|     s << __GNU_MP_VERSION << \".\" << __GNU_MP_VERSION_MINOR;\n|     \/\/ Starting from GMP version 4.3.0, the gmp_version variable\n|     \/\/ always contains three parts.  In previous versions the\n|     \/\/ patchlevel was omitted if it was 0.\n|     if (__GNU_MP_VERSION_PATCHLEVEL != 0\n|         || __GNU_MP_VERSION > 4<br \/>\n|         || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR >= 3))<br \/>\n|       s << \".\" << __GNU_MP_VERSION_PATCHLEVEL;\n|     header_version = s.str();\n|   }\n| \n|   std::string library_version = gmp_version;\n| \n|   if (header_version != library_version) {\n|     std::cerr\n|       << \"GMP header (gmpxx.h) and library (ligmpxx.*) version mismatch:\\n\"\n|       << \"header gives \" << header_version << \";\\n\"\n|       << \"library gives \" << library_version << \".\" << std::endl;\n|     return 1;\n|   }\n| \n|   if (sizeof(mp_limb_t)*CHAR_BIT != BITS_PER_MP_LIMB\n|       || BITS_PER_MP_LIMB != mp_bits_per_limb) {\n|     std::cerr\n|       << \"GMP header (gmpxx.h) and library (ligmpxx.*) bits-per-limb mismatch:\\n\"\n|       << \"header gives \" << BITS_PER_MP_LIMB << \";\\n\"\n|       << \"library gives \" << mp_bits_per_limb << \".\\n\"\n|       << \"This probably means you are on a bi-arch system and\\n\"\n|       << \"you are compiling with the wrong header or linking with\\n\"\n|       << \"the wrong library.\" << std::endl;\n|     return 1;\n|   }\n| \n|   mpz_class n(\"3141592653589793238462643383279502884\");\n|   return 0;\n| }\n| \nconfigure:10115: result: no\nconfigure:10250: error: Cannot find GMP version 4.1.3 or higher.\n<\/code><\/p>\n<p>\u8fd9\u4e2a\u4e3b\u8981\u539f\u56e0\u662f\u56e0\u4e3a\u6240\u4f7f\u7528\u7684MinGW\u5305\u542b\u4e86gmp\u7684\u52a8\u6001\u94fe\u63a5\u5e93\uff0c\u540c\u65f6MinGW\u81ea\u5e26\u7684gmp\u7684\u7248\u672c\u8f83\u4f4e\uff08\u6839\u636econfig.log\u53ef\u4ee5\u770b\u51faMinGW\u81ea\u5e26\u7684\u7248\u672c\u662f5.0.1\uff09\uff0c\u800c\u94fe\u63a5\u5230\u7684\u5934\u6587\u4ef6\u5374\u662f\u65b0\u7248\u672c\u7684\uff085.0.4\uff09\uff0c\u540c\u65f6\u7528\u6765\u6d4b\u8bd5gmp\u7248\u672c\u7684\u7a0b\u5e8f\u52a0\u8f7d\u4e86MinGW\u81ea\u5e26\u7684gmp\u7684\u5e93\uff0c\u8fdb\u800c\u9020\u6210\u4e86\u4e0d\u4e00\u81f4\u6027\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u628a\u65b0\u7f16\u8bd1\u51fa\u6765\u7684\u65b0\u7248libgmp-10.dll\u590d\u5236\u5230MinGW\\bin\u66ff\u6362MinGW\u81ea\u5e26\u7684gmp\u5e93\u5373\u53ef\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u4ece\u7406\u8bba\u4e0a\u6765\u8bb2\uff0c\u4fee\u6539PATH\u5e94\u8be5\u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728MinGW\u81ea\u5e26\u7684MSYS\uff08\u7406\u8bba\u4e0a\u6765\u8bb2\u5355\u72ec\u914d\u7f6e\u7684MSYS\u6574\u5408MinGW\u4e5f\u53ef\u80fd\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\u3002\uff09\u4e2d\u4f7f\u7528\u65b0\u7248\u672cGMP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-249","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=249"}],"version-history":[{"count":3,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}