I notice there is a whole directory near the normal one
(/usr/lib/gcc-lib/i386-redhat-linux/3.2.3) that is called
/usr/lib/gcc-lib/i386-redhat-linux7/2.96 that contains much of the same
stuff (but far less). They seem to come with packages:

compat-gcc-7.3-2.96.123
compat-gcc-c++-7.3-2.96.123

Is there a way I can make the gcc and g++ compilers use this? I assume
there is. Do I invoke a different compiler, or put some different flags on
the command line? How? I cannot find the documentation for it. I would be
quite willing to RTFM if I could find it.

In article <109bbc6841shg2a@corp.supernews.com>, Jean-David Beyer wrote:[color=blue]
> I cannot compile for IBM's DB2 dbms when programs contain embedded SQL on
> my RHEL 3 ES system. This system invokes compiler version 3.2.3 by
> default, whereas IBM wants 2.96.
>
> I notice there is a whole directory near the normal one
> (/usr/lib/gcc-lib/i386-redhat-linux/3.2.3) that is called
> /usr/lib/gcc-lib/i386-redhat-linux7/2.96 that contains much of the same
> stuff (but far less). They seem to come with packages:
>
> compat-gcc-7.3-2.96.123
> compat-gcc-c++-7.3-2.96.123
>
> Is there a way I can make the gcc and g++ compilers use this? I assume
> there is. Do I invoke a different compiler, or put some different flags on
> the command line? How? I cannot find the documentation for it. I would be
> quite willing to RTFM if I could find it.[/color]

Try

locate bin/gcc

in Fedora Core1 I find:

/usr/bin/gcc
/usr/bin/gcc32
/usr/bin/gcc296

(gcc is the default, version 3.3.2)

It is not a good idea to compile things (libraries, kernel,
etc.) with a (very) different version of the compiler,
so I tend to use gcc whenever I can.

However, gcc32 and gcc296 are there if I need them.

Most often, the easiest thing to do is to sent
the enviornment variable CC to gcc296, for example,
before running ./configure to compile.

I have seen some packages which don't have a configure
script where one might have to modify the Makefile to
get it to use a particular version.

There are also C++ compilers for backwards compatibility
/usr/bin/g++296
in Fedora Core1.

So, check your system and see what you have.

10-07-2007, 11:15 AM

unix

Re: How to use 2.96 version of C and C++ compile with RHEL 3 ESr?

Spamless wrote:[color=blue]
> In article <109bbc6841shg2a@corp.supernews.com>, Jean-David Beyer wrote:
>[color=green]
>>I cannot compile for IBM's DB2 dbms when programs contain embedded SQL on
>>my RHEL 3 ES system. This system invokes compiler version 3.2.3 by
>>default, whereas IBM wants 2.96.
>>
>>I notice there is a whole directory near the normal one
>>(/usr/lib/gcc-lib/i386-redhat-linux/3.2.3) that is called
>>/usr/lib/gcc-lib/i386-redhat-linux7/2.96 that contains much of the same
>>stuff (but far less). They seem to come with packages:
>>
>>compat-gcc-7.3-2.96.123
>>compat-gcc-c++-7.3-2.96.123
>>
>>Is there a way I can make the gcc and g++ compilers use this? I assume
>>there is. Do I invoke a different compiler, or put some different flags on
>>the command line? How? I cannot find the documentation for it. I would be
>>quite willing to RTFM if I could find it.[/color]
>
>
> Try
>
> locate bin/gcc
>
> in Fedora Core1 I find:
>
> /usr/bin/gcc
> /usr/bin/gcc32
> /usr/bin/gcc296
>
> (gcc is the default, version 3.3.2)
>
> It is not a good idea to compile things (libraries, kernel,
> etc.) with a (very) different version of the compiler,
> so I tend to use gcc whenever I can.
>
> However, gcc32 and gcc296 are there if I need them.
>
> Most often, the easiest thing to do is to sent
> the enviornment variable CC to gcc296, for example,
> before running ./configure to compile.
>
> I have seen some packages which don't have a configure
> script where one might have to modify the Makefile to
> get it to use a particular version.
>
> There are also C++ compilers for backwards compatibility
> /usr/bin/g++296
> in Fedora Core1.
>
> So, check your system and see what you have.[/color]

I finally found /usr/bin/gcc296 and /usr/bin/g++296. I was never able to
find any documentation about gcc296 and g++296, either at Red Hat's site
(or IBM's site).

This fixed all the superficial problems I have compiling stuff for IBM's
DB2 V8.1.5. Only the fundamental problem remains unsolved: It insists that
NULL is undefined in various parts of a program (with embedded SQL) that
compiled perfectly well with RHL 7.3 and ran with IBM DB2 V6.1. Sigh.