cannot link against libgfortran2

Bug #158673 reported by Rafael de Pelegrini Soares
6
Affects Status Importance Assigned to Milestone
gcc-4.2 (Ubuntu)
Invalid
Low
Matthias Klose

Bug Description

Binary package hint: libgfortran2

Hi,

I'm using Ubuntu 7.10. If I try to compile/link a Fortran program with gfortran-4.2/libgfortran2 I get a:
'/usr/bin/ld: cannot find -lgfortran'

If I create a link:
'sudo ln -s /usr/lib/libgfortran.so.2 /usr/lib/libgfortran.so'

I get undefined references to `_gfortran_copy_string'

But if I use gfortran-4.1/libgfortran1 instead, then everything works fine.

I think there is a bug with the libgfortran2 package and I'll be glad to provide any additional information.

Thank you in advance.

Revision history for this message
Rafael de Pelegrini Soares (rafael-rps) wrote :

Hi,

What I've done to get a working Fortran95 compiler with Ubuntu 7.10 was:

1. Install the package gfortran-4.1
2. Select '/usr/bin/gfortran-4.1' as an alternative for 'f95' (I recommend galternatives for this task)
3. Compile any Fortran code with 'f95' and link against 'libgfortran'

Revision history for this message
Matthias Klose (doko) wrote :

Creating the symlink by hand is the wrong approach. Please install the gfortran package instead.

Changed in gcc-4.2:
assignee: nobody → doko
importance: Undecided → Low
status: New → Invalid
Revision history for this message
Russel Winder (russel) wrote :

Manually creating a symlink may be the wrong approach but it is currently the only really successful approach. Clearly it makes sense to have a system that allows 4.1 and 4.2 to be installed at the same time, however there is a blocking problem here:

  gcc ......... -lgfortran

fails. I have libgfortran2 properly installed and gfortran properly installed and I still have to do the manual symlink to get the link to complete.

I assume this and Bug #156524 are effectively the same.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.