version `GFORTRAN_1.4' not found

Axel Freyn axel-freyn@gmx.de
Mon Feb 28 15:56:00 GMT 2011


On Mon, Feb 28, 2011 at 04:19:48PM +0100, Janus Weil wrote:
> >> The "save" way would be to install your private gcc-4.6-version
> >> somewhere where YaST does nothing (like /usr/local) -- that way you can be
> >> quite sure that "your" files will never be overwritten by YaST.
> >
> > I believe Axel is right and installing under /usr/lib64
> > can lead to all sorts of problems.
> 
> Huh, I was assuming the whole point of
> --enable-version-specific-runtime-libs was to have several GCC
> versions in the same /lib tree without using a different --prefix. At
> least that's the way I used it in the past and it always seemed to
> work. Is that wrong?
No, I believe that's right. And gcc did it correctly for you (cited from
your other mail, you have):

/usr/lib64/libgfortran.so.3
/usr/lib64/gcc/x86_64-suse-linux/4.5/libgfortran.so
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.0/libgfortran.so

However, the problem is (in my understanding): When you start "./a.out",
the runtime library-resolution searches libgfortran.so according to your
/etc/ld.so.conf, and finds the one in /usr/lib64/ -- so this one (the
one from gfortran-4.5) is used (which has been overwritten by the last
opensuse update).

To correct this, two ways should work:

 - Anton's proposal: you pass the path directly to the linker with 
   gfortran-4.6 -Wl,-rpath=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.0 hello.f90
   ./a.out
   This way, "ldd ./a.out" should also point to the "4.6-version"

 - or by changing the library resolution at runtime:
   gfortran-4.6 hello.f90
   LD_LIBRARY_PATH=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.0 ./a.out
   This way, "ldd ./a.out" should point to the "4.5-version", but
   LD_LIBRARY_PATH=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.0 ldd ./a.out
   should point to the "4.6-version".

On my machine, (Debian with gcc-4.4.5 as system-compiler and gcc-4.6 as
self-installed compiler (but installed with --prefix=/opt/gcc) ) both
solutions work fine.

Axel



More information about the Fortran mailing list