I am trying to compile Sage's LinBox package (pretty much 1.1.3-r2785
with my build fixes posted in this google group) with gcc 4.3 20070824
(which is a stage 2 prerelease). There are two problems:
checking for NTL >= 5.0... problem
Sorry, your NTL version is too old. Disabling.
Sage includes NTL 5.4.1, so I am fairly certain that the AC_CHECK test
just somehow miscompiles.
The other problem is the following:
g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../../gmp++ -
I../../../linbox -I/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/local/
include/linbox -I/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/local/include
-fPIC -I/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/local/include -I/tmp/
Work2/sage-2.8.2-gcc4.3/sage-2.8.2/local/include/linbox -L/tmp/Work2/
sage-2.8.2-gcc4.3/sage-2.8.2/local/lib -Wp,-MD,.deps/gmp++_int_misc.pp
-c gmp++_int_misc.C -o gmp++_int_misc.o
gmp++_int_misc.C: In member function 'Integer::operator long long
unsigned int() const':
gmp++_int_misc.C:248: error: 'CHAR_BIT' was not declared in this scope
make[5]: *** [gmp++_int_misc.lo] Error 1
make[5]: Leaving directory `/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/
spkg/build/linbox-20070814/linbox/linbox/util/gmp++'
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory `/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/
spkg/build/linbox-20070814/linbox/linbox/util'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/
spkg/build/linbox-20070814/linbox/linbox'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/
spkg/build/linbox-20070814/linbox'
Error installing linbox
I am not certain if LinBox is to blame for the problem, because I
already fixed one issue with the current gmp.h when compiling with gcc
4.3.
I don't have time to investigate and hopefully fix those two problems
- if nobody picks up from here I will hopefully get around to them
next weekend.
Cheers,
Michael
If that does it, please send me a patch with two items fixed. Thanks!
-dave
--
David Saunders, Professor and Chair
Dept. of Computer and Information Sciences, Univ. of Delaware
email: saun...@cis.udel.edu Phone: 302-831-6238
Hello Dave,
the problem with NTL just went away. Upon closer investigation I
believe that a patch in LinBox is at fault that puts in an outdated gmp
++.h which then in turn cannot find linbox-config.h. Very odd, but I
will clean up the LinBox package in Sage soon. But what is quite
interesting is that givaro and LinBox have different, potentially
incompatible versions of gmp++.h, so installing in the same directory
(as Sage does) may lead to unexpected results. As a result the test
whether the givaro release is greater than version 3 always seems to
fail. This is quite odd, so stay tuned.
Back to the build:
make[4]: Entering directory `/tmp/Work2/linbox/linbox-r2798/linbox/
util/gmp++'
if /bin/sh ../../../libtool --tag=CXX --mode=compile g++ -
DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../../gmp++ -
I../../../linbox -MT gmp++_int_mul.lo -MD -MP -MF ".deps/gmp+
+_int_mul.Tpo" -c -o gmp++_int_mul.lo gmp++_int_mul.C; \
then mv -f ".deps/gmp++_int_mul.Tpo" ".deps/gmp+
+_int_mul.Plo"; else rm -f ".deps/gmp++_int_mul.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../../gmp++ -
I../../../linbox -MT gmp++_int_mul.lo -MD -MP -MF .deps/gmp+
+_int_mul.Tpo -c gmp++_int_mul.C -o gmp++_int_mul.o
In file included from ../../../gmp++/gmp++.h:15,
from gmp++_int_mul.C:9:
/usr/include/gmpxx.h: In destructor
'__gmp_alloc_cstring::~__gmp_alloc_cstring()':
/usr/include/gmpxx.h:2096: error: 'strlen' was not declared in this
scope
make[4]: *** [gmp++_int_mul.lo] Error 1
make[4]: Leaving directory `/tmp/Work2/linbox/linbox-r2798/linbox/util/
gmp++'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/Work2/linbox/linbox-r2798/linbox/
util'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/Work2/linbox/linbox-r2798/linbox'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/Work2/linbox/linbox-r2798'
make: *** [all] Error 2
Solution: add #include <string.h> to gmp++/gmp++.h
#######################################################
g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../../gmp++ -
I../../../linbox -MT gmp++_int_misc.lo -MD -MP -MF .deps/gmp+
+_int_misc.Tpo -c gmp++_int_misc.C -o gmp++_int_misc.o
gmp++_int_misc.C: In member function 'Integer::operator long long
unsigned int() const':
gmp++_int_misc.C:248: error: 'CHAR_BIT' was not declared in this scope
make[4]: *** [gmp++_int_misc.lo] Error 1
make[4]: Leaving directory `/tmp/Work2/linbox/linbox-r2798/linbox/util/
gmp++'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/Work2/linbox/linbox-r2798/linbox/
util'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/Work2/linbox/linbox-r2798/linbox'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/Work2/linbox/linbox-r2798'
make: *** [all] Error 2
You were right on that one. Just add "#include limits.h"
#######################################################
Since both fixes are so trivial I figure it is pointless to provide
patches, especially because the credit for the second fix is yours.
I gave up after I got the following because I need to catch up on some
sleep:
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I. -O2 -
DDISABLE_COMMENTATOR -I/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/local//
include -I/tmp/Work2/sage-2.8.2-gcc4.3/sage-2.8.2/local//include -MT
lb-element.lo -MD -MP -MF .deps/lb-element.Tpo -c lb-element.C -o lb-
element.o
In file included from ./lb-domain-type.h:27,
from ./lb-domain-functor.h:28,
from ./lb-domain-function.h:28,
from ./lb-element-data.h:31,
from lb-element.C:28:
../../linbox/field/PID-integer.h: In member function 'void
LinBox::PID_integer::RationalReconstruction(LinBox::integer&,
LinBox::integer&, const LinBox::integer&, const LinBox::integer&,
const LinBox::integer&, bool, bool) const':
../../linbox/field/PID-integer.h:279: error: ISO C++ says that these
are ambiguous, even though the worst conversion for the first is
better than the worst conversion for the second:
../../gmp++/gmp++_int.inl:148: note: candidate 1: int operator>(const
Integer&, const Integer&)
../../gmp++/gmp++_int.h:126: note: candidate 2: int
Integer::operator>(long unsigned int) const
../../linbox/field/PID-integer.h:279: error: ISO C++ says that these
are ambiguous, even though the worst conversion for the first is
better than the worst conversion for the second:
../../gmp++/gmp++_int.inl:148: note: candidate 1: int operator>(const
Integer&, const Integer&)
../../gmp++/gmp++_int.h:125: note: candidate 2: int
Integer::operator>(long int) const
../../linbox/field/PID-integer.h:279: error: ISO C++ says that these
are ambiguous, even though the worst conversion for the first is
better than the worst conversion for the second:
../../gmp++/gmp++_int.inl:148: note: candidate 1: int operator>(const
Integer&, const Integer&)
../../gmp++/gmp++_int.h:124: note: candidate 2: int
Integer::operator>(int) const
make[3]: *** [lb-element.lo] Error 1
make[3]: Leaving directory `/tmp/Work2/linbox/linbox-r2798/interfaces/
driver'
One last thing: I have about 8 or so other patches outstanding. Has
anybody taken a look at them? I would prefer for them not to bitrot
and a couple hundred Sage users have used them to compile LinBox, so
they should be on the safe side :)
Cheers,
Michael
CFLAGS="$CFLAGS -fPIC -I\"$SAGE_LOCAL/include\" -I\"$SAGE_LOCAL/
include/linbox\"-L\"$SAGE_LOCAL/lib\""
CXXFLAGS="$CXXFLAGS -fPIC -I\"$SAGE_LOCAL/include\" -I\"$SAGE_LOCAL/
include/linbox\" -L\"$SAGE_LOCAL/lib\""
CPPFLAGS="$CPPFLAGS -I\"$SAGE_LOCAL/include/linbox\" -I\"$SAGE_LOCAL
\"/include"
This is due to a bug in several of LinBox's Makefile.am files. The
situation is as follows: During the configure check you add the right
directories for includes and search directories for the linker to
GMP_CFLAGS, i.e. --with-gmp=/usr/local/gmp-4.2.1-static GMP_CFLAGS is
set to "-I /usr/local/gmp-4.2.1-static/include -L /usr/local/gmp-4.2.1-
static/lib" and therefore the compile tests succeeds. But when
building the bits of LinBox that depend on gmp.h GMP_CFLAGS has not
been added to the local Makefile.am and therefore picks up a gmp.h
from the usual suspects (/usr/include for example). The patch at
fixes that. I discovered the issue because I have no gmp installed in
the standard places and consequently the compile fails with a missing
gmp.h. The same structural problem in the Makefile.am files exists
also for NTL and givaro. I will have patches for that around the
weekend.
Cheers,
Michael
The 8 patches that you were referring to have been applied this
morning.
Clement
On Aug 26, 3:27 pm, mabshoff <Michael.Absh...@fsmath.mathematik.uni-
dortmund.de> wrote:
> Sorry to reply to myself so quickly, but I forgot to mention one
> issue: Sage abuses LinBox's CFLAGS, CXXFLAGS and CPPFLAGS as follows:
>
> CFLAGS="$CFLAGS -fPIC -I\"$SAGE_LOCAL/include\" -I\"$SAGE_LOCAL/
> include/linbox\"-L\"$SAGE_LOCAL/lib\""
> CXXFLAGS="$CXXFLAGS -fPIC -I\"$SAGE_LOCAL/include\" -I\"$SAGE_LOCAL/
> include/linbox\" -L\"$SAGE_LOCAL/lib\""
> CPPFLAGS="$CPPFLAGS -I\"$SAGE_LOCAL/include/linbox\" -I\"$SAGE_LOCAL
> \"/include"
>
> This is due to a bug in several of LinBox's Makefile.am files. The
> situation is as follows: During the configure check you add the right
> directories for includes and search directories for the linker to
> GMP_CFLAGS, i.e. --with-gmp=/usr/local/gmp-4.2.1-static GMP_CFLAGS is
> set to "-I /usr/local/gmp-4.2.1-static/include -L /usr/local/gmp-4.2.1-
> static/lib" and therefore the compile tests succeeds. But when
> building the bits of LinBox that depend on gmp.h GMP_CFLAGS has not
> been added to the local Makefile.am and therefore picks up a gmp.h
> from the usual suspects (/usr/include for example). The patch at
>
> http://fsmath.mathematik.uni-dortmund.de/~mabshoff/patches/linbox-1.1...
On Sep 4, 8:22 pm, Clement Pernet <clement.per...@gmail.com> wrote:
> Modifications to gmp++/gmp++.h applied (string.h and limits.h).
>
> The 8 patches that you were referring to have been applied this
> morning.
>
> Clement
Hello Clemet,
I saw the svn log. Thanks, I was starting to curse because I had to
apply too many patches every time I rebuild svn ;)
The fixes for gmp.h to make it compile with gcc 4.3 have been merged
in gmp-4.2.2rc3, the final gmp-4.2.2 will be out some time this week.
I will retry with gcc with the current LinBox-svn some time next week.
Cheers,
Michael