<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
I experienced a configuration failure using PPL 0.12 complaining
that the GMP <i>"header version didn't match the library version"</i>.
Searching the web, I found an old 2009 post:
<a class="moz-txt-link-freetext" href="http://www.cs.unipr.it/pipermail/ppl-devel/2009-August/015227.html">http://www.cs.unipr.it/pipermail/ppl-devel/2009-August/015227.html</a>
with a very similar problem some time ago - the conclusion was
murky.<br>
<br>
I do not have multiple copies of GMP on my system. In fact, I built
GMP v5.0.2 and PPL 0.12 from source using --disable-shared
--enable-static and had no problems. However, when I compile the
same GMP and PPL source using --enable-shared --disable-static, the
problem pops up.<br>
<br>
I acknowledge that there could be a problem with the GMP versioning
when configured for shared libraries. Having said that, is it
possible that the PPL configuration test is at fault? Specifically,
how is the library version determined?<br>
<br>
Looking at the source code for the configure script, I could not
determine where the value was assigned to gmp_version (annotated
line 10083 below) nor did I find gmp_version set as a configuration
script variable. <br>
<blockquote><tt>10050 cat confdefs.h - <<_ACEOF
>conftest.$ac_ext<big><br>
</big> /* end confdefs.h. */<big><br>
<br>
</big> #include <gmpxx.h><big><br>
</big> #include <climits><big><br>
</big> #include <string><big><br>
</big> #include <sstream><big><br>
</big> #include <iostream><big><br>
<br>
</big> #if __GNU_MP_VERSION < 4 ||
(__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1)
|| (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1
&&<big><br>
</big> MP_VERSION_PATCHLEVEL < 3)<big><br>
</big> #GMP version 4.1.3 or higher is required<big><br>
</big> #endif<big><br>
</big> <big><br>
</big> <SNIP><big><br>
<br>
</big>10083 <b><font color="#990000"><big>std::string
library_version = gmp_version;</big></font></b><big><br>
<br>
</big> if (header_version != library_version) {<big><br>
</big> std::cerr<big><br>
</big> << "GMP header (gmpxx.h) and library
(ligmpxx.*) version mismatch:\n"<big><br>
</big> << "header gives " <<
header_version << ";\n"<big><br>
</big> << "library gives " <<
library_version << "." << std::endl;<big><br>
</big> return 1;<big><br>
</big> }<big><br>
<br>
</big> <SNIP><big><br>
</big>
}</tt><br>
</blockquote>
Simply updating the installed gmp.h file (attached) as shown below
allows me to bypass the configuration test to assess the build, but
clearly this is not a production solution. <br>
<blockquote><big><tt><small> /* Major version number is the value of
__GNU_MP__ too, above and in mp.h. */<br>
#define __GNU_MP_VERSION 5<br>
#define __GNU_MP_VERSION_MINOR 0<br>
#define <b><font color="#990000">__GNU_MP_VERSION_PATCHLEVEL
1</font></b></small></tt></big><br>
</blockquote>
My configuration settings (taken from the respective config.log
files) are:<br>
<big><tt><small><br>
</small></tt></big>
<blockquote><big><tt><small>GMP: $
../../../src/gmp/gmp-5.0.2/configure
--prefix=/third_party/spt/i686-w64-mingw32 <br>
--build=i686-w64-mingw32 --host=i686-w64-mingw32 </small><br>
<small>
--enable-shared --disable-static --enable-cxx</small><br>
</tt></big>
<blockquote><big><tt><small>Environment:<br>
CFLAGS='-g0 -O2 -pipe -Wl,-S -isystem /mingw/include'<br>
CPPFLAGS='-g0 -O2 -pipe -Wl,-S -isystem /mingw/include
-fexceptions'<br>
CXXFLAGS='-g0 -O2 -pipe -Wl,-S -isystem /mingw/include'</small><br>
</tt></big></blockquote>
<big><tt><br>
<small>PPL: $ ../../../src/ppl/ppl-0.12/configure
--prefix=/third_party/spt/i686-w64-mingw32 <br>
--build=i686-w64-mingw32 --host=i686-w64-mingw32 </small><br>
<small>
--enable-shared --disable-static <br>
--with-gmp=/third_party/spt/i686-w64-mingw32</small><br>
</tt></big>
<blockquote><big><tt><small>Environment:<br>
CFLAGS='-g0 -O2 -pipe -Wl,-S -isystem /mingw/include'<br>
CPPFLAGS='-g0 -O2 -pipe -Wl,-S -isystem /mingw/include'<br>
CXXFLAGS='-g0 -O2 -pipe -Wl,-S -isystem /mingw/include'</small></tt></big><br>
</blockquote>
</blockquote>
Thanks in advance for your time and consideration,<br>
<br>
Anil E. Sahukar<br>
<br>
<br>
<br>
</body>
</html>