libg2c.so.0 and gcc-3.4 issues

Asked by david garcia

My system: uname -a
Linux Ubuntu-1004-lucid-64-minimal 2.6.32-35-server #78-Ubuntu SMP Tue Oct 11 16:26:12 UTC 2011 x86_64 GNU/Linux

Hello, i'm trying to execute a 32 bits binary in my 64bit ubuntu. When i try to run the binary (is a Fortan program, i think), i retrieve

"error while loading shared libraries: libg2c.so.0: cannot open shared object file: No such file or directory"

aptitude install libg2c0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
No candidate version found for libg2c0
No candidate version found for libg2c0
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done

I'm unable to install gcc-3.4 too

Here http://ubuntuforums.org/showthread.php?t=1487901 there is a link to download the libg2c0 deb package created for jaunty, but the link is broken http://packages.ubuntu.com/jaunty/libg2c0

Best regards.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gcc-3.4 Edit question
Assignee:
No assignee Edit question
Solved by:
david garcia
Solved:
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

gcc 3.4 is a very old version, that is no longer supported -- you should be using a newer version. Jaunty is also end-of-life, so the packages are not longer online.

According to

http://<email address hidden>/msg18043.html

libg2c was part of the g77 code, which has been deprecated some time ago. Do you have the source code for your fortran program?

Revision history for this message
david garcia (aristegui) said :
#2

No, is a binary and the source code is not available!
Thank you for your help, best regards.

Revision history for this message
david garcia (aristegui) said :
#3

By the way

dpkg -l | grep gcc
ii gcc 4:4.4.3-1ubuntu1 The GNU C compiler
ii gcc-4.4 4.4.3-4ubuntu5 The GNU C compiler
ii gcc-4.4-base 4.4.3-4ubuntu5 The GNU Compiler Collection (base package)
ii lib32gcc1 1:4.4.3-4ubuntu5 GCC support library (32 bit Version)
ii libgcc1 1:4.4.3-4ubuntu5 GCC support library

dpkg -l | grep fortran
ii gfortran 4:4.4.3-1ubuntu1 The GNU Fortran 95 compiler
ii gfortran-4.4 4.4.3-4ubuntu5 The GNU Fortran 95 compiler
ii libgfortran3 4.4.3-4ubuntu5 Runtime library for GNU Fortran applications

dpkg -l | grep 77
ii f2c 20090411-1 A FORTRAN 77 to C/C++ translator
ii fort77 1.15-8 Invoke f2c like a real compiler

Revision history for this message
david garcia (aristegui) said :
#4

Getting the proper .deb files, the problem is solved

dpkg -i gcc-3.4-base_3.4.6-9_amd64.deb
and finally
dpkg --force- -i libg2c0_3.4.6-6ubuntu5_amd64.deb

Best regards.
David,

Revision history for this message
mycae (mycae) said :
#5

Be careful with the above solution -- it is technically not valid, but may appear to work

There is no guarantee that libc shipping with gcc-3.4 and gcc4 are the same -- part of the reason you had to force install.

Your application may provide incorrect results, or crash, as binary compatibility within your package hierarchy is almost certainly not present.