Hi,

  I am trying to update my Mandriva package of sagemath to 4.3.1, but
I am having serious issues with givaro/linbox.

  For some reason, only --enable-sage appears to break linbox, but,
for some reason, with gcc 4.4.3 (the one in
Mandriva cooker), it will not build liblinboxsage.so.

  I tried:
o linbox 1.1.6 + givaro 3.2.13, matching sagemath spkgs
o linbox 1.1.6 + givaro 3.3.1
o linbox 1.1.7 + givaro 3.3.1
o todays linbox svn + givaro 3.3.1

sagemath interface to givaro should work correctly with a small patch
for the "minor" changes, e.g. s/amxy/maxpy/,
but no matter what, I am getting several missing symbols.

  I am somewhat lost as I am not experienced with C++ templates, but
after making several changes last night
to get linbox 1.1.6 to work with givaro 3.3.1, I ended up with the
same errors I get with linbox 1.1.7 and svn linbox
plus givaro 3.3.1. I stopped last night when I needed:

--- linbox-1.1.6/linbox/util/timer.C.orig       2010-01-27 21:50:11.042264712 
-0200
+++ linbox-1.1.6/linbox/util/timer.C    2010-01-27 21:51:40.641339799 -0200
@@ -28,14 +28,6 @@ extern "C" {
 namespace LinBox
 {

-// Return a value to initialize random generator
-long BaseTimer::seed()
-{
-       struct timeval tp;
-       gettimeofday(&tp, 0) ;
-       return(tp.tv_usec);
-}
-
 // Output the value of the timer :
 std::ostream& BaseTimer::print( std::ostream& o ) const
 { return o << _t ; }
--- linbox-1.1.6/linbox/util/timer.h.orig       2010-01-27 21:49:54.870263887 
-0200
+++ linbox-1.1.6/linbox/util/timer.h    2010-01-27 21:51:33.168404026 -0200
@@ -20,6 +20,10 @@
 #ifndef __LINBOX_TIMER_H
 #define __LINBOX_TIMER_H

+extern "C" {
+# include <sys/time.h>
+}
+
 #include <iostream>

 namespace LinBox
@@ -44,7 +48,11 @@ class BaseTimer {
        inline double time() const { return _t; }

        // -- Return a value to initialize random generator
-       static long seed();
+       static long seed() {
+           struct timeval tp;
+           gettimeofday(&tp, 0) ;
+           return(tp.tv_usec);
+       }

        // -- basic methods:
        std::ostream &print (std::ostream &) const;
-%<-

to not get an unresolved symbol for LinBox::BaseTimer::seed(), but, not using
this patch for linbox newer than 1.1.6, that is exactly the first error:
...
 g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I. -I../../linbox -O2
-DDISABLE_COMMENTATOR -O2 -g -pipe -Wformat -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4
-I/home/pcpa/mandriva/svn/linalg-linbox/BUILD/linbox-1.1.6
-I/home/pcpa/mandriva/svn/linalg-linbox/BUILD/linbox-1.1.6/linbox -c
linbox-sage.C  -fPIC -DPIC -o .libs/linbox-sage.o
/bin/sh ../../libtool --tag=CXX   --mode=link g++ -O2
-DDISABLE_COMMENTATOR     -O2 -g -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4
-I/home/pcpa/mandriva/svn/linalg-linbox/BUILD/linbox-1.1.6
-I/home/pcpa/mandriva/svn/linalg-linbox/BUILD/linbox-1.1.6/linbox
-lgivaro -lgmpxx -lgmp -lntl -L/usr/lib64  -lblas   -version-info
0:0:0  -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -o
liblinboxsage.la -rpath /usr/lib64 linbox-sage.lo  -L/usr/lib64
-lblas -lgmpxx -lgmp -lgivaro
g++ -shared -nostdlib
/usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.3/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.3/crtbeginS.o
.libs/linbox-sage.o  -Wl,--as-needed -Wl,--no-undefined -Wl,-z
-Wl,relro -Wl,-O1  -lntl -L/usr/lib64 -lblas /usr/lib64/libgmpxx.so
/usr/lib64/libgmp.so /usr/lib64/libgivaro.so
-L/usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.3
-L/usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.3/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.3/../../.. -lstdc++ -lm -lc
-lgcc_s /usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.3/crtendS.o
/usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.3/../../../../lib64/crtn.o
-Wl,-soname -Wl,liblinboxsage.so.0 -o .libs/liblinboxsage.so.0.0.0
.libs/linbox-sage.o: In function `RandomPrimeIterator':
/home/pcpa/mandriva/svn/linalg-linbox/BUILD/linbox-1.1.6/interfaces/sage/../../linbox/randiter/random-prime.h:24:
undefined reference to `LinBox::BaseTimer::seed()'
.libs/linbox-sage.o: In function `MultiModRandomPrime':
/home/pcpa/mandriva/svn/linalg-linbox/BUILD/linbox-1.1.6/interfaces/sage/../../linbox/randiter/multimod-randomprime.h:39:
undefined reference to `LinBox::BaseTimer::seed()'
.libs/linbox-sage.o: In function
`LinBox::Timer::operator+=(LinBox::Timer const&)':
...

  Sorry for the long email.

  Any ideias of how to get this to work, with any linbox version,
preferably givaro 3.3.1 as someone already
updated mandriva package..., and gcc 4.4.3 is welcome.

Thanks,
Paulo

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to