[PPL-devel] gmp-4.3.1 header and library version mismatch

Roberto Bagnara bagnara at cs.unipr.it
Wed Aug 26 08:11:34 CEST 2009


Karl-Werner Beszus wrote:
> When compiling (configuring) ppl-0.10.2, I get the error:
> "configure: error: Cannot find GMP version 4.1.3 or higher."
> 
> in config.log (short):
> g++ -o conftest conftest.cpp  /usr/lib/libgmpxx.so /usr/lib/libgmp.so 
> 
> Involved is "configure" from ppl-0.10.2:
> 
> ---codeschnipp
> #include <gmpxx.h>
> ....
> 
> #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3)
> #GMP version 4.1.3 or higher is required
> #endif
> 
> int
> main() {
>   std::string header_version;
>   {
>     std::ostringstream s(header_version);
>     s << __GNU_MP_VERSION << "." << __GNU_MP_VERSION_MINOR;
>     // Starting from GMP version 4.3.0, the gmp_version variable
>     // always contains three parts.  In previous versions the
>     // patchlevel was omitted if it was 0.
>     if (__GNU_MP_VERSION_PATCHLEVEL != 0
>         || __GNU_MP_VERSION > 4
>         || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR >= 3))
>       s << "." << __GNU_MP_VERSION_PATCHLEVEL;
>     header_version = s.str();
>   }
> 
>   std::string library_version = gmp_version;
> 
>   if (header_version != library_version) {
>     std::cerr
>       << "GMP header (gmp.h) and library (ligmp.*) version mismatch:\n"
>       << "header gives " << header_version << ";\n"
>       << "library gives " << library_version << "." << std::endl;
>     return 1;
>   }
> ....
> ---codeschnipp
> 
> 
> It looks like there's something wrong with "gmp_version", but I couldn't find, where/how this is defined in the code of gmp-4.3.1.
> The __GNU_MP_VERSION* ones are OK.

Hi Karl-Werner,

perhaps you have two installation of GMP in your system?  I would need to
see the config.log file to tell you better.  Please send it in compressed
form.

> I commented out the block with the comparing of header_version and library_version,
> and the configure && make && make check of ppl-0.10.2 runs without an error.

This is very dangerous.  Even though the PPL `make check' procedure is characterized
by an high coverage, there is no way you can trust the library you obtained that
way.  Let us see the config.log (obtained with the original configure, of course)
and we will find precisely what went wrong.
All the best,

    Roberto

P.S. I removed the CC to gmp-bugs because I am pretty sure this has nothing
      to do with GMP.

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list