Re: Cannot compile GIAC 0.4.0
Bernard Parisse wrote:
I have some hints that could fix the problem, but I can not test them since I don't have gcc 3.4 installed.
Dear Bernard, please let me know if I can help (e.g., by giving you access to a machine with gcc 3.4.1).
The template code for Normalrref is never instantiated, that's why the error does not appear with previous versions of gcc. Declaring temp and newcoord as vector< monomial<T> > should fix the compilation error.
OK.
zero is assumed to be declared of type T when these functions are instantiated. I don't know how to declare zero as a template variable (would extern T zero; work inside a function?)
Yes, if this is what you want. However, this conflicts with the declaration extern gen zero; in gen.h.
gcc is correct, f. should be removed (twice)
OK. We still have the following problems (apart from the conflicting declarations for zero): c++ -DHAVE_CONFIG_H -I. -I. -I.. -I. -I.. -g -O2 -c gausspol.cc -fPIC -DPIC -o .libs/gausspol.lo gausspol.cc: In function `bool giac::gcd_modular_algo(giac::polynome&, giac::polynome&, giac::polynome&)': gausspol.cc:982: error: no match for call to `(giac::polynome) (giac::polynome&, giac::polynome&, giac::gen&)' poly.h:385: note: candidates are: giac::tensor<T> giac::tensor<T>::operator()(const T&) const [with T = giac::gen] poly.h:266: note: T& giac::tensor<T>::operator()(const giac::index_m&) [with T = giac::gen] poly.h:277: note: const T& giac::tensor<T>::operator()(const giac::index_m&) const [with T = giac::gen] The following is cured by adding an include of <iostream> in global.h c++ -DHAVE_CONFIG_H -I. -I. -I.. -I. -I.. -g -O2 -c ti89.cc -fPIC -DPIC -o .libs/ti89.lo In file included from misc.h:23, from ti89.cc:25: global.h: In member function `void giac::dbgprint_vector<T>::dbgprint()': global.h:130: error: `cout' is not a member of `std' A similar problem with cerr is in monomial.h. The nastier seems to be this one: monomial.h: In function `std::vector<giac::monomial<T>, std::allocator<giac::monomial<T> > > giac::operator+(const std::vector<giac::monomial<T>, std::allocator<giac::monomial<T> > >&, const std::vector<giac::monomial<T>, std::allocator<giac::monomial<T> > >&)': monomial.h:302: error: there are no arguments to `ptr_fun' that depend on a template parameter, so a declaration of `ptr_fun' must be available monomial.h:302: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) monomial.h: In function `std::vector<giac::monomial<T>, std::allocator<giac::monomial<T> > > giac::operator-(const std::vector<giac::monomial<T>, std::allocator<giac::monomial<T> > >&, const std::vector<giac::monomial<T>, std::allocator<giac::monomial<T> > >&)': monomial.h:364: error: there are no arguments to `ptr_fun' that depend on a template parameter, so a declaration of `ptr_fun' must be available In file included from sym2poly.h:23, from input_lexer.ll:44: poly.h: In constructor `giac::tensor<T>::tensor()': poly.h:47: error: there are no arguments to `ptr_fun' that depend on a template parameter, so a declaration of `ptr_fun' must be available poly.h: In constructor `giac::tensor<T>::tensor(int)': poly.h:48: error: there are no arguments to `ptr_fun' that depend on a template parameter, so a declaration of `ptr_fun' must be available poly.h: In constructor `giac::tensor<T>::tensor(const giac::monomial<T>&)': poly.h:49: error: there are no arguments to `ptr_fun' that depend on a template parameter, so a declaration of `ptr_fun' must be available poly.h: In constructor `giac::tensor<T>::tensor(const T&, int)': poly.h:52: error: there are no arguments to `ptr_fun' that depend on a template parameter, so a declaration of `ptr_fun' must be available poly.h: In constructor `giac::tensor<T>::tensor(int, const std::vector<giac::monomial<T>, std::allocator<giac::monomial<T> > >&)': poly.h:56: error: there are no arguments to `ptr_fun' that depend on a template parameter, so a declaration of `ptr_fun' must be available I attach the patch file containing my changes up to now. I would be grateful if you could tell me how to procees. 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@cs.unipr.it diff -rcp2N --exclude-from=exclude /usr/local/distrib/giac-0.4.0/src/fraction.h giac-0.4.0/src/fraction.h *** /usr/local/distrib/giac-0.4.0/src/fraction.h Sat Jul 3 21:51:52 2004 --- giac-0.4.0/src/fraction.h Thu Feb 12 10:22:04 2004 *************** std::ostream & operator << (std::ostream *** 183,187 **** template <class T> void Tfraction<T>::dbgprint() { ! std::cout << num << "/" << den << " " ; } --- 183,187 ---- template <class T> void Tfraction<T>::dbgprint() { ! std::cout << f.num << "/" << f.den << " " ; } diff -rcp2N --exclude-from=exclude /usr/local/distrib/giac-0.4.0/src/global.h giac-0.4.0/src/global.h *** /usr/local/distrib/giac-0.4.0/src/global.h Sat Jul 3 22:00:15 2004 --- giac-0.4.0/src/global.h Wed Jun 23 13:27:24 2004 *************** inline double giac_log(double d){ *** 73,77 **** #include <signal.h> #include <stdexcept> - #include <iostream> #include "help.h" --- 73,76 ---- diff -rcp2N --exclude-from=exclude /usr/local/distrib/giac-0.4.0/src/monomial.h giac-0.4.0/src/monomial.h *** /usr/local/distrib/giac-0.4.0/src/monomial.h Sat Jul 3 22:03:33 2004 --- giac-0.4.0/src/monomial.h Wed May 5 20:52:22 2004 *************** void Add ( typename std::vector< monomia *** 292,296 **** } if (log) ! std::cerr << "+ end " << clock() << endl; } --- 292,296 ---- } if (log) ! cerr << "+ end " << clock() << endl; } *************** template <class T> *** 765,770 **** void Normalrref (std::vector< monomial<T> > & v,int rows,int cols, index_t & permut, bool dobareiss=true){ Rref(v,rows,cols,permut,dobareiss); - std::vector< monomial<T> > temp; - std::vector< monomial<T> > newcoord; // divide each non-zero row by leading coeff and order typename std::vector< monomial<T> >::const_iterator it=v.begin(),itend=v.end(); --- 765,768 ---- diff -rcp2N --exclude-from=exclude /usr/local/distrib/giac-0.4.0/src/poly.h giac-0.4.0/src/poly.h *** /usr/local/distrib/giac-0.4.0/src/poly.h Sat Jul 3 21:56:39 2004 --- giac-0.4.0/src/poly.h Mon Mar 8 13:29:50 2004 *************** index_m tensor<T>::vector_int(int positi *** 265,269 **** template <class T> T & tensor<T>::operator () ( const index_m & v) { - extern T zero; int p=position(v); if (p!=-1) --- 265,268 ---- *************** T & tensor<T>::operator () ( const index *** 276,280 **** template<class T> const T & tensor<T>::operator () ( const index_m & v) const{ - extern T zero; int p=position(v); if (p==-1) { --- 275,278 ---- *************** bool tensor<T>::TPseudoDivRem (const ten *** 784,788 **** template <class T> T tensor<T>::constant_term () const { - extern T zero; if (!((*this).coord.size())) return zero; --- 782,785 ----
participants (1)
-
Roberto Bagnara