Equations

Friday 23 October 2009

install g77 in Ubuntu 9.04 (Jaunty Jackalope)

Recently i needed to compile some programs with g77, ubuntu 9.04 repositories has gcc 4.3 and gfortran. Unfortunately, gfortran is not compatible with many g77 dependent programs.
There's an easy way to install gcc 3.4 and g77:
add to /etc/sources.list the ubuntu 8.04 hardy repositories:

deb http://hu.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://hu.archive.ubuntu.com/ubuntu/ hardy universe
deb http://hu.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://hu.archive.ubuntu.com/ubuntu/ hardy-updates universe

then in the terminal:

sudo aptitude update
sudo aptitude isntall g77

remove or comment the ubuntu 8.04 repositories in sources.list
that's it

11 comments:

  1. Would you be so kind as to explain the procedure of installing g77 to a person who started ubuntu few days ago?
    Best regards,
    Vlado

    ReplyDelete
  2. I'll be glad, but what exactly you have trouble with? What Ubuntu version you have ?

    ReplyDelete
  3. Hi, thank you very much for this trick. However, I have a trouble withit: when I open my sources.list file by xemacs, and try to copy the aforementioned lines, I get a message like "the file is read-only type". Hence, I cannot add the magic lines to the file.
    How can I solve this?

    ReplyDelete
  4. Marco, you need to open the file with sudo for example
    "sudo emacs /etc/sources.list" That will give you write permission.

    ReplyDelete
  5. It should be "sudo emacs /etc/apt/sources.list" but not "sudo emacs /etc/sources.list"

    One can use nano (or) "gedit" (or) "leafpad" (or) "kedit" (or) "vi" (or) "pico" or what ever text editor instead of "emacs"

    ReplyDelete
  6. Very good tip. This one actually works...

    ReplyDelete
  7. Hi,
    I have successfully installed the heasoft source file for newely installed ubuntu 10.04 in my pc, (installation log shown no problem at all ) . When I am running the any FTOOL (e.g. fdump)it is showing follwing error.
    --------------------------------------------------
    fdump: error while loading shared libraries: libg2c.so.0: cannot open shared object file: No such file or directory
    -------------------------------------------------------
    I tried to install libg2c both way ap-get and synaptic manager but this shows
    -------------------------------------------------
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package libg2c
    ............................................
    Plese someone help me
    Thank you very much

    ReplyDelete
  8. I think that this g77 package is just for 32bit machine. how can i do please if the machine is 64bit?

    Thank you very mauch,

    ReplyDelete
  9. now it is /etc/apt/sources.list

    ReplyDelete
  10. badr:
    If you mean
    error while loading shared libraries: libg2c.so.0: wrong ELF class: ELFCLASS64
    Solution is here: http://imsb.au.dk/pipermail/o-info/2009-October/008450.html
    namely: sudo apt-get install lib32g2c0

    ReplyDelete