Re: Can't install gcc 3.2 alongside gcc 2.96 on Red Hat 7.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 18, 2004 at 01:48:06PM +0000, Jonathan Watt wrote:
> Hi,

Hello.

> I would like (need) to install gcc 3.2 or greater on Red Hat 7.3 while 
> leaving the default compiler (gcc 2.96) and its libraries in place. I am 
> relatively new to GNU/Linux but I know that other people have managed 
> this before. I have spent the last week or so trying with what I believe 
> to be suitable RPMs and source RPMs that I have found while searching 
> the Web. Unfortunately the RPMs want to install files that conflict with 
> files belonging to gcc 2.96, and the source RPMs I have found won't 
> build. An example error message would be:
> 
> RPM build error.
> Bad exit status from /var/tmp/rpm-tmp 83330
> 
> I would be very greatful for any help in solving these problems. I 
> should probably add that what I know about RPM has been learnt in the 
> last week so I may not be using it correctly.

Oh man, redhat and the joy of RPM. ;-)

Usually, gcc RPMs are not designed to be installed side by side and hence
they usually can't.

But there are various possibilities:

1) just install without RPM; gcc will then install by default to /usr/local.
Additionally you could use checkinstall which generates an RPM for you from
the `make install' process that you can install and remove just like other
RPMs.

2) upgrade to RH 8.x and use the compat-*-7.3 RPMs. That way you'd have the
default gcc (3.2 IIRC) plus the old compiler for RH 7.3.

3) edit the .spec file(s) of the gcc SRPM (just *install* the src.rpm and edit
the file(s) in /usr/src/redhat/SPECS)  and alter the `configure' options. 

E.g. you could specify a custom install location (e.g "--prefix=/usr/gcc32")
or add a custom suffix to the binaries (e.g. --program-suffix=-3.2) and
install the libstdc++ files to a different location (e.g.
--with-gxx-include-dir=/usr/include/c++/3.2). You may also combine some of
these and specify other options of course; RTFM. 

Then do `rpmbuild -bb <spec-file>' (you may also specify --target PLATFORM
in order to optimize for e.g. i686). 

You may also have a look at the spec files for the compat-gcc src RPM how
they manage that sort of thing and what configure options they use.


I'd say if you don't want to distribute the RPM afterwards options 1 or 2
sound preferable. Or just install Debian -- it's a lot more fun ;-)

Also note that C++ libraries generated with g++ 2.96 are not ABI compatible
with g++ 3.x and you can't link with them. 

You need to be more verbose about the error message, I think rpmbuild keeps
a log of the build process somewhere. A build error often suggests that
you're missing required packages, but that's just a shot in the dark.

HTH
-- 
Claudio Bley                                 ASCII ribbon campaign (")
Debian GNU/Linux user                         - against HTML email  X 
http://www.cs.uni-magdeburg.de/~bley/                     & vCards / \

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux