LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to get f77 compiler on Ubuntu 12.04 (https://www.linuxquestions.org/questions/linux-server-73/how-to-get-f77-compiler-on-ubuntu-12-04-a-4175439344/)

YankeePride13 11-29-2012 01:03 PM

How to get f77 compiler on Ubuntu 12.04
 
Hello,

I am in the process of upgrading one of my systems to a newer beefier server. We are transitioning from Red Hat version 4 update 9 to the latest LTS version of Ubuntu, 12.04. One of the users of this system absolutely needs the f77 fortran compiler (don't ask) and this package does not seem to be available from Ubuntu (which makes sense since the compiler is 9 years my senior).

Any suggestions on an easy way to get the compiler on the Ubuntu system?

Thanks for any help in advance.

wpeckham 11-29-2012 04:29 PM

A quick google, and
 
I found this that may help:
May 4th, 2010, 05:14 PM
Edit your /etc/apt/sources.list to add:
deb http://cz.archive.ubuntu.com/ubuntu hardy-updates main universe

Then use:
sudo apt-get update
sudo apt-get install g77
--------------------
G77 is the GNU F77 compiler package that is part of the GCC/G++ world. To get it all on Ubuntu, you may need to download new libs (after checking the requirments) and the GCC source package and compile the compiler with the right options to create a new GCC with G77. Rather a pain, but someone on the Ubuntu team decided we will never need FORTRAN again. How silly!

------------
I have not checked the Debian repos and packages. There may be something interesting there! I run CentOS and Debian on my systems, but cross loading packages is not recommended.

knudfl 12-01-2012 11:10 AM

The g77-compat compiler for Ubuntu 11* .. 12* :
g77-compat-3.4.6.ubuntu11_i386.deb
https://docs.google.com/open?id=0B7S...kZXX0xWN0M0Um8

Ubuntu 12.04, g77-compat depends on gcc34-compat-3.4.6.ubuntu1204_i386.deb
https://docs.google.com/open?id=0B7S...GdETGREbXp2T1U

Reuti 12-02-2012 07:30 AM

It would be good to investigate why he needs g77. Some defaults are different any maybe gfortran needs -finit-local-zero or other switches. But this could also be fixed inside the source code not to rely on this behavior of the compiler.

YankeePride13 12-03-2012 08:28 AM

@knudfl

thank you very much!

@Reuti

Have ya ever met someone who is "set in their ways"? That's what I'm dealing with here. Nothing could be said to change the situation. Appreciate the response though.

YankeePride13 12-10-2012 02:43 PM

I just found out that there is a fortan 77 compiler for Ubuntu 12.04 (fort77). Has anyone used this? Is it the same as f77?

Also, while installing the application, apt had the following output:

Code:

update-alternatives: using /usr/bin/fort77 to provide /usr/bin/f77 (f77) in auto mode.
I'm not sure what this means, and Google didn't yield anything helpful. Does anyone know what this means?

knudfl 12-10-2012 03:44 PM

# 6.

gcc34-compat-3.4.6, g77-compat-3.4.6 : A gcc-3.4.6 build.


'fort77' is a 7.5 kB perl script that "Invokes f2c like a real compiler"
http://packages.ubuntu.com/precise/fort77

Works with some f77 code, not all. If I remember right.


.

YankeePride13 12-11-2012 08:44 AM

Quote:

Originally Posted by knudfl (Post 4846532)
# 6.

gcc34-compat-3.4.6, g77-compat-3.4.6 : A gcc-3.4.6 build.


'fort77' is a 7.5 kB perl script that "Invokes f2c like a real compiler"
http://packages.ubuntu.com/precise/fort77

Works with some f77 code, not all. If I remember right.


.

Have you used it before? Would it work the same way (despite some code possibly not working)?

knudfl 12-12-2012 06:36 AM

# 8

Why not use the proof tool ? I.e. g77-compat-3.4.6 .

YankeePride13 12-12-2012 07:58 AM

Quote:

Originally Posted by knudfl (Post 4847672)
# 8

Why not use the proof tool ? I.e. g77-compat-3.4.6 .

I had tried to use it but the system was complaining about missing packages when I tried to install the .deb file. I forget exactly what.

YankeePride13 12-12-2012 08:28 AM

Here's the error I was talking about:

Code:

# dpkg -i gcc34-compat-3.4.6.ubuntu1204_i386.deb
Selecting previously unselected package gcc34-compat:i386.
(Reading database ... 24090 files and directories currently installed.)
Unpacking gcc34-compat:i386 (from gcc34-compat-3.4.6.ubuntu1204_i386.deb) ...
dpkg: dependency problems prevent configuration of gcc34-compat:i386:
 gcc34-compat:i386 depends on libc6.
dpkg: error processing gcc34-compat:i386 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 gcc34-compat:i386


knudfl 12-12-2012 10:23 AM

# 11

May be you have a 64bits OS ?

This command will reply with i686 for 32bits, and x86_64 for 64bits :
$ uname -m

YankeePride13 12-12-2012 10:36 AM

Yes, it's a 64 bit system.

YankeePride13 12-13-2012 10:21 AM

#12

Do I require 64 bit versions of the deb files that you provided for it to work? If so, do you know where I could get them?

knudfl 12-13-2012 10:49 AM

# 14.

The gccXx-compat compilers for 32bits Ubuntu 11* - 12* :
They were created by me, mainly to be used for old versions of ns2,
which work best on a 32bits OS.

I will check if it's possible to build a 64bits gcc-3.4.6 + f77,
and let you know.


.


All times are GMT -5. The time now is 12:28 PM.