From f96de3e79ebab0646f197125d20db3bb43550ad8 Mon Sep 17 00:00:00 2001
From: bangerth
- You can't, this version of gcc simply does not work with - deal.II, or at least did not. deal.II - version 4.0 will contain fixes to allow compilation, but versions - up to and including 3.4 cannot be compiled with gcc 2.96. Furthermore, later - versions don't support this compiler any more at all, and will tell you so - during configuration. -
- -- gcc 2.96 was created by - RedHat from a snapshot somewhere between 2.95 and 3.0; it contained a large - number of compiler bugs, which have partly been fixed, but too many remain as - that we were able to make the library work with this compiler until we could - get hold of such a system (initially, the main development of - deal.II was done in Germany, which is SuSE country, not - Red Hat). Also note that version 2.96 is not an officially - released version of gcc. Simply use either gcc 2.95 or 3.X. The reason we - finally decided not to support this compiler is that we - have reports that gcc 2.96 may miscompile parts of the library, see for - example - this - message. We have also found that some of the example programs return - wrong values or go into infinite loops if compiled with this version of gcc. -
- -- RedHat provides updates to gcc version 3.0 or later, and downgrades - to gcc version 2.95, all of which work with deal.II. Red - Hat releases starting with version 8.0 will also be based on a different - compiler, so the problem does not exist there any more. -
- -- However, there are more problems lurking around the corner: even though we - have included patches so that the library can be compiled, presently not all - of the examples can. There is at least one problem in the compiler which we - could not work around (I reported this to the gcc bug tracking system as - c++/616 in October 2000, and it was fixed a few weeks later, but apparently - did not make it to Red Hat's version). The problem manifests itself in - situations like this: -
-- template <int dim> struct Function {}; - template <int dim> struct RHS : Function<dim> { RHS() {}; }; - - template <int dim> void f () - { - const RHS<dim> rhs; - }; - template void f<1> (); -- -
Here, the compiler reports
-- x.cc: In function `void f () [with int dim = 1]': - x.cc:7: instantiated from here - x.cc:5: uninitialized const `rhs' --
- which is clearly bogus since rhs
uses the default constructor of
- the class. Unfortunately, there is no way of working around the bug short of
- removing the constness of the variable. We did not want to do this, since
- this changes the semantics of the programs and is promoting bad style which
- we do not want to do in example programs. Furthermore, since gcc 2.96 is
- being phased out at the time of this writing, there is no point in doing this
- any more. Therefore, we advise you to remove the constness of these variables
- if you are forced to use this compiler and want to use the example programs,
- or use them as the basis for your own
- project. You can either do this by hand, or by using
- this
- patch that is archived in out mailing list
- archives. A better way is probably to up- or downgrade your compiler, if
- this is possible for your machine.
-