Hi Mirko,

Doesn't your software require only 'libgcc_s.so' from gcc-4.5.2?

If not, then I'm not sure that's the appropriate way of doing this. Instead of changing your PATH and LD_LIBRARY_PATH, the way it's usually done is by using a specific suffix with your gcc version:

For exemple, on rhel5, you have these compilers available:
-rwxr-xr-x 2 root root 221920 Dec  9  2009 /usr/bin/gcc (gcc (GCC) 4.1.2 
20080704 (Red Hat 4.1.2-48)
-rwxr-xr-x 2 root root 102408 Aug 23  2006 /usr/bin/gcc34 gcc34 (GCC) 3.4.6 
20060404 (Red Hat 3.4.6-4)
-rwxr-xr-x 2 root root 262944 Sep  1 23:07 /usr/bin/gcc44 gcc44 (GCC) 4.4.4 
20100726 (Red Hat 4.4.4-13)

You could do it this way:
1) compile gcc with something like this:
"--enable-languages=c,c++,f77,objc '--program-suffix=452'"

that should give you these binaries:
/usr/local/bin/gcc452
/usr/local/bin/g++452
/usr/local/bin/f77452

You could also take a look into the gcc44 source rpm, check how RH does this and try to adapt it to gcc-4.5.2, that would make deployment easier...

2) Compile all the other GNU tools you need by using:
CC="gcc452" CXX="g++452" ./configure ...... whatever..

Just my 2c, I don't like mangling with LD_LIBRARY_PATH either..

Vincent

On Thu, 27 Jan 2011, Mirko Vukovic wrote:

I am installing a software package that requires gcc version 4.5.2
I built gcc (and prerequisites gmp, mpc, mpfr) yesterday, and installed into 
default
location /usr/local/...

I cannot remove the preinstalled gcc, gmp, mpc, mpfr libraries that live in 
/usr, because that will break
many other dependencies.  So, how do I access the new libraries without setting
LD_LIBRARY_PATH?

From reading around, permanently setting LD_LIBRARY_PATH is not approved of.

Thank you,

Mirko
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to