Upgrade gcc 2.96-98 to gcc 3.2-7 on Redhat 7.2

Upgrade gcc 2.96-98 to gcc 3.2-7 on Redhat 7.2

Post by delray » Sat, 28 Jun 2003 00:02:55



Hello All,

I have a problem that I am hoping someone out there has already
solved.  I need to upgrade gcc from 2.96-98 to 3.2-7 on Redhat 7.2.
My project has a requirement that we run on Redhat 7.2.  The problem
is, rpm reports that the upgrade also requires an upgrade to rpm.  The
rpm upgrade printout follows:

rpm -Uvh ./gcc-3.2-7.i386.rpm \
./glibc-2.3.2-4.80.6.i386.rpm \
./glibc-common-2.3.2-4.80.6.i386.rpm \
./glibc-debug-2.3.2-4.80.6.i386.rpm \
./glibc-devel-2.3.2-4.80.6.i386.rpm \
./libgcc-3.2-7.i386.rpm

error: failed dependencies:
        cpp = 3.2-7 is needed by gcc-3.2-7
        rpmlib(PartialHardlinkSets) <= 4.0.4-1 is needed by gcc-3.2-7
        gdb < 5.1-2 conflicts with gcc-3.2-7
        rpmlib(PartialHardlinkSets) <= 4.0.4-1 is needed by
glibc-common-2.3.2-4.80.6
        gcc = 2.96-98 is needed by gcc-g77-2.96-98
        gcc = 2.96-98 is needed by gcc-objc-2.96-98
        gcc = 2.96-98 is needed by gcc-c++-2.96-98

I think I know how to upgrade everything but the rpmlib (get all
packages and do an rpm -U followed by all the package names).

But, I can't find out how to upgrade rpmlib.  I assume that most
people just upgrade the OS when they want a new compiler, that is why
I can't find much information on this problem.

Any information you can give me would be greatly appreciated.  Thanks
in advance.

Scott

 
 
 

Upgrade gcc 2.96-98 to gcc 3.2-7 on Redhat 7.2

Post by R Smit » Sat, 28 Jun 2003 09:47:14



> Hello All,

> I have a problem that I am hoping someone out there has already
> solved.  I need to upgrade gcc from 2.96-98 to 3.2-7 on Redhat 7.2.
> My project has a requirement that we run on Redhat 7.2.  The problem
> is, rpm reports that the upgrade also requires an upgrade to rpm.  The
> rpm upgrade printout follows:

> rpm -Uvh ./gcc-3.2-7.i386.rpm \
> ./glibc-2.3.2-4.80.6.i386.rpm \
> ./glibc-common-2.3.2-4.80.6.i386.rpm \
> ./glibc-debug-2.3.2-4.80.6.i386.rpm \
> ./glibc-devel-2.3.2-4.80.6.i386.rpm \
> ./libgcc-3.2-7.i386.rpm

> error: failed dependencies:
>         cpp = 3.2-7 is needed by gcc-3.2-7
>         rpmlib(PartialHardlinkSets) <= 4.0.4-1 is needed by gcc-3.2-7
>         gdb < 5.1-2 conflicts with gcc-3.2-7
>         rpmlib(PartialHardlinkSets) <= 4.0.4-1 is needed by
> glibc-common-2.3.2-4.80.6
>         gcc = 2.96-98 is needed by gcc-g77-2.96-98
>         gcc = 2.96-98 is needed by gcc-objc-2.96-98
>         gcc = 2.96-98 is needed by gcc-c++-2.96-98

> I think I know how to upgrade everything but the rpmlib (get all
> packages and do an rpm -U followed by all the package names).

> But, I can't find out how to upgrade rpmlib.  I assume that most
> people just upgrade the OS when they want a new compiler, that is why
> I can't find much information on this problem.

> Any information you can give me would be greatly appreciated.  Thanks
> in advance.

> Scott

You're upgrading gcc, rpm, and glibc... there won't be much of 7.2 left!
I personally like to leave glibc alone, lest it become angry. Most humbly
recommend you can install gcc-3.2 from source into /usr/local area.
Thus you build it with 2.96 (which you should keep around for fun).
Then 'export PATH=/usr/local/gcc-3.2/bin:$PATH' to use it. I built
gcc-3.1 in /usr/local (RH7.2), so it's not a wild guess for you to try,
it might actually work.  The ABI is different for those two compilers,
possibly a problem if you use C++. librpm is part of rpm-devel package.

Good luck.

 
 
 

1. gcc 2.96 vs. gcc 3.2: namespace, template incompatability

The old code I once wrote in redhat 7.3(gcc 2.96) are no longer
compiled without errors in gcc 3.2 after I upgrade to redhat 8.0.

In gcc 3.2, the compiler always complain that 'cin', 'endl' etc. are
undefined unless I add the line "using namespace std".

In addition, there is also some problem in template, for example, the
code segment below is compiled OK in gcc 2.96, but there are a lot of
errors given by gcc 3.2. And there is still a error after I add "using
namespace std"

$ g++ -o max_string max_string.C
max_string.C: In function `int main()':
max_string.C:37: cannot convert
`__gnu_cxx::__normal_iterator<std::string*,
   std::vector<std::string, std::allocator<std::string> > >' to
`std::string*'
   in initialization
$

// code segment in "C++ Primer" chapter 20 iostream library
#include <string>
#include <algorithm>
#include <iterator>
#include <vector>
#include <iostream>

using namespace std;

bool length_less( string s1, string s2 )
    { return s1.size() < s2.size(); }

template <class InputIterator>
void filter_string( InputIterator first, InputIterator last,
                    string filt_elems = string( "\",?." ))
{
    for (; first != last; first++) {
        string::size_type pos = 0;
        while ( (pos = (*first).find_first_of(filt_elems, pos))
                != string::npos )
            (*first).erase( pos, 1 );
    }

int main()
{
    istream_iterator<string> input( cin ), eos;

    vector<string> text;
    // copy is a generic algorithm
    // copy from standard input to text
    copy( input, eos, back_inserter( text ));
    string filt_elems( "\",.?;:" );
    filter_string( text.begin(), text.end(), filt_elems );

    int cnt = text.size();
    // max_element is a generic algorithm
    string *max = max_element( text.begin(), text.end(), length_less
);
    int len = max->size();

    cout << "The number of words read is " << cnt << endl;
    cout << "The longest word has a length of " << len << endl;
    cout << "The longest word is " << *max << endl;

2. about shutdown dhcp server!!

3. EPIC100 problems with RH9 gcc 3.2.2-5 and not with RH8.0 3.2-7?

4. netscape-4.5-preferences

5. upgrading gcc from 2.96 (yuk) to 3.x in RedHat 7.3

6. TOKEN_NF:dos:ERROR

7. HOWTO build/install GCC 3.1 from SRPM w/o replacing GCC 2.96 ?

8. getopts command please

9. How to upgrade from gcc-2.7.0 to gcc-2.7.2 ?

10. math.h of gcc 2.95/2.96 on redhat 7.3 platform

11. RedHat trademark. First gcc 2.96 now this

12. Compiling gcc 2.7.2.1 with gcc 3.2 on redhat 8.0

13. Shared Libraries - Exceptions - GCC 2.96 - Redhat 8.0