[PPL-devel] ppl fails to complete configure ...

Roberto Bagnara bagnara at cs.unipr.it
Wed Aug 5 19:49:49 CEST 2009


Tovrea, George W (US SSA) wrote:
> Same old problem - configure fails due to (finds libs ok, why not
> includes?)
> 
> checking how to link with libgmp...
> /net/whistler/auto/users/tovrea/local/sol2/lib/libgmp.a
> checking how to link with libgmpxx...
> /net/whistler/auto/users/tovrea/local/sol2/lib/libgmpxx.a -L/usr/sfw/lib
> /net/whistler/auto/users/tovrea/local/sol2/lib/libgmp.a
> checking for the GMP library version 4.1.3 or above... no
> configure: error: Cannot find GMP version 4.1.3 or higher.
> GMP is the GNU Multi-Precision library:
> see http://www.swox.com/gmp/ for more information.
> When compiling the GMP library, do not forget to enable the C++
> interface:
> add --enable-cxx to the configuration options.
> 
> tovrea at siamese%printenv CPPFLAGS
> -I/net/whistler/auto/users/tovrea/local/sol2/include
> 
> tovrea at siamese%ll /net/whistler/auto/users/tovrea/local/sol2/include
> total 448
> drwxrwxr-x   2 tovrea   mintdev       32 Aug  5 09:01 .
> drwxrwxr-x   9 tovrea   mintdev       87 Aug  5 08:34 ..
> -rw-r--r--   1 tovrea   mintdev    84317 Aug  5 09:01 gmp.h
> -rw-r--r--   1 tovrea   mintdev   114898 Aug  5 09:01 gmpxx.h
> 
> config.log attached.

Hi Bill,

here is the relevant part of your config.txt:

/net/whistler/auto/users/tovrea/local/sol2/bin/g++ -o conftest  -g -O2 -frounding-math  -I/net/whistler/auto/users/tovrea/local/sol2/include  conftest.cpp  /net/whistler/auto/users/tovrea/local/sol2/lib/libgmpxx.a -L/usr/sfw/lib /net/whistler/auto/users/tovrea/local/sol2/lib/libgmp.a >&5
/tmp/cc4jXfgy.o(.text+0x230): In function `main':
/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x24c):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x37c):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x390):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x3a0): In function `main':
/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/bits/basic_string.h:2506: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x3b4):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: more undefined references to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)' follow
/tmp/cc4jXfgy.o(.text+0x4ec): In function `main':
/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/bits/locale_facets.h:869: undefined reference to `std::ctype<char>::_M_widen_init() const'
/tmp/cc4jXfgy.o(.text+0x540): In function `main':
/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x554):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x574):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x588):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x5a8):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/tmp/cc4jXfgy.o(.text+0x5bc):/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0/include/c++/ostream:510: more undefined references to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)' follow
collect2: ld returned 1 exit status

As you can see, your C++ compiler (/net/whistler/auto/users/tovrea/local/sol2/bin/g++)
is not finding symbols that belong to the standard library (libstdc++).
This might mean the compiler has not been properly installed.

What happens if you try to compile and link by hand the program that configure
is using, that is:

#include <gmpxx.h>
#include <climits>
#include <string>
#include <sstream>
#include <iostream>

#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;
   }

   if (sizeof(mp_limb_t)*CHAR_BIT != GMP_LIMB_BITS
       || GMP_LIMB_BITS != mp_bits_per_limb) {
     std::cerr
       << "GMP header (gmp.h) and library (ligmp.*) bits-per-limb mismatch:\n"
       << "header gives " << __GMP_BITS_PER_MP_LIMB << ";\n"
       << "library gives " << mp_bits_per_limb << ".\n"
       << "This probably means you are on a bi-arch system and\n"
       << "you are compiling with the wrong header or linking with\n"
       << "the wrong library." << std::endl;
     return 1;
   }

   mpz_class n("3141592653589793238462643383279502884");
   return 0;
}

And, if that fails, what happens if you compile and link
by hand a simple "Hello world!" C++ program, like

#include <iostream>

int
main() {
   std::cout << "Hello world!" << std::endl;
}

All the best,

     Roberto

-- 
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