0

I am working with a government program that was written in Fortran 77, and requires g77 to configure and compile the source code. I understand that g77 has been phased out, and replaced with newer compilers, but my point of contact with the government and I are finding that the newer compilers in GCC produce numerous errors when we try to compile this program.

I have tried instructions that were available in a previously posted question for Ubuntu 12, where the sources.list file is amended to add the Hardy Ubuntu pages, and then it should be available. However, as the output below shows, that was not successful. I have tried searching for other sources of g77, but nothing has turned up.

I have tried installing earlier versions of Linux on this computer and others, only to find that the versions that I downloaded were missing key features and could not be installed. Please give a detailed answer as I am not very experienced with Linux.

sudo apt-get update
Ign http:// us.archive.ubuntu.com trusty InRelease
Ign http:// security.ubuntu.com trusty-security InRelease                       
Ign http:// us.archive.ubuntu.com trusty-updates InRelease                      
Get:1 http:// security.ubuntu.com trusty-security Release.gpg [933 B]           
Ign http:// extras.ubuntu.com trusty InRelease                                  
Ign http:// us.archive.ubuntu.com trusty-backports InRelease                    
Get:2 http:// security.ubuntu.com trusty-security Release [62.0 kB]             
Hit http:// us.archive.ubuntu.com trusty Release.gpg                            
Get:3 http:// extras.ubuntu.com trusty Release.gpg [72 B]                       
Get:4 http:// us.archive.ubuntu.com trusty-updates Release.gpg [933 B]          
Ign http:// hu.archive.ubuntu.com hardy InRelease                               
Hit http:// extras.ubuntu.com trusty Release                                    
Get:5 http:// us.archive.ubuntu.com trusty-backports Release.gpg [933 B]        
Get:6 http:// security.ubuntu.com trusty-security/main Sources [71.5 kB]        
Hit http:// us.archive.ubuntu.com trusty Release                                
Hit http:// extras.ubuntu.com trusty/main Sources                               
Ign http:// hu.archive.ubuntu.com hardy-updates InRelease                       
Get:7 http:// us.archive.ubuntu.com trusty-updates Release [62.0 kB]            
Get:8 http:// security.ubuntu.com trusty-security/restricted Sources [2,061 B]  
Hit http:// extras.ubuntu.com trusty/main amd64 Packages                        
Get:9 http:// security.ubuntu.com trusty-security/universe Sources [17.9 kB]    
Ign http:// hu.archive.ubuntu.com hardy Release.gpg                             
Get:10 http:// security.ubuntu.com trusty-security/multiverse Sources [1,896 B] 
Hit http:// extras.ubuntu.com trusty/main i386 Packages                         
Get:11 http:// security.ubuntu.com trusty-security/main amd64 Packages [220 kB] 
Get:12 http:// us.archive.ubuntu.com trusty-backports Release [62.0 kB]         
Ign http:// hu.archive.ubuntu.com hardy-updates Release.gpg                     
Ign http:// hu.archive.ubuntu.com hardy Release                                 
Get:13 http:// security.ubuntu.com trusty-security/restricted amd64 Packages [8,875 B]
Hit http:// us.archive.ubuntu.com trusty/main Sources                           
Get:14 http:// security.ubuntu.com trusty-security/universe amd64 Packages [87.7 kB]
Ign http:// hu.archive.ubuntu.com hardy-updates Release                         
Hit http:// us.archive.ubuntu.com trusty/restricted Sources                     
Hit http:// us.archive.ubuntu.com trusty/universe Sources                       
Get:15 http:// security.ubuntu.com trusty-security/multiverse amd64 Packages [3,458 B]
Hit http:// us.archive.ubuntu.com trusty/multiverse Sources                     
Get:16 http:// security.ubuntu.com trusty-security/main i386 Packages [210 kB]  
Hit http:// us.archive.ubuntu.com trusty/main amd64 Packages                    
Hit http:// us.archive.ubuntu.com trusty/restricted amd64 Packages              
Hit http:// us.archive.ubuntu.com trusty/universe amd64 Packages                
Hit http:// us.archive.ubuntu.com trusty/multiverse amd64 Packages              
Get:17 http:// security.ubuntu.com trusty-security/restricted i386 Packages [8,846 B]
Hit http:// us.archive.ubuntu.com trusty/main i386 Packages                     
Get:18 http:// security.ubuntu.com trusty-security/universe i386 Packages [87.7 kB]
Hit http:// us.archive.ubuntu.com trusty/restricted i386 Packages               
Ign http:// extras.ubuntu.com trusty/main Translation-en_US                     
Get:19 http:// security.ubuntu.com trusty-security/multiverse i386 Packages [3,624 B]
Ign http:// extras.ubuntu.com trusty/main Translation-en                        
Get:20 http:// security.ubuntu.com trusty-security/main Translation-en [113 kB] 
Hit http:// us.archive.ubuntu.com trusty/universe i386 Packages                 
Hit http:// us.archive.ubuntu.com trusty/multiverse i386 Packages               
Hit http:// security.ubuntu.com trusty-security/multiverse Translation-en       
Hit http:// security.ubuntu.com trusty-security/restricted Translation-en       
Hit http:// us.archive.ubuntu.com trusty/main Translation-en                    
Get:21 http:// security.ubuntu.com trusty-security/universe Translation-en [48.5 kB]
Hit http:// us.archive.ubuntu.com trusty/multiverse Translation-en              
Hit http:// us.archive.ubuntu.com trusty/restricted Translation-en              
Hit http:// us.archive.ubuntu.com trusty/universe Translation-en     
Get:22 http:// us.archive.ubuntu.com trusty-updates/main Sources [181 kB]
Get:23 http:// us.archive.ubuntu.com trusty-updates/restricted Sources [2,061 B]
Get:24 http:// us.archive.ubuntu.com trusty-updates/universe Sources [105 kB]   
Get:25 http:// us.archive.ubuntu.com trusty-updates/multiverse Sources [4,463 B]
Get:26 http:// us.archive.ubuntu.com trusty-updates/main amd64 Packages [446 kB]
Get:27 http:// us.archive.ubuntu.com trusty-updates/restricted amd64 Packages [8,875 B]
Get:28 http:// us.archive.ubuntu.com trusty-updates/universe amd64 Packages [254 kB]
Get:29 http:// us.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [11.2 kB]
Get:30 http:// us.archive.ubuntu.com trusty-updates/main i386 Packages [436 kB] 
Get:31 http:// us.archive.ubuntu.com trusty-updates/restricted i386 Packages [8,846 B]
Get:32 http:// us.archive.ubuntu.com trusty-updates/universe i386 Packages [255 kB]
Get:33 http:// us.archive.ubuntu.com trusty-updates/multiverse i386 Packages [11.3 kB]
Get:34 http:// us.archive.ubuntu.com trusty-updates/main Translation-en [213 kB]
Err http:// hu.archive.ubuntu.com hardy/universe Sources                        
  404  Not Found [IP: 148.6.0.24 80]
Err http:// hu.archive.ubuntu.com hardy/universe amd64 Packages                 
  404  Not Found [IP: 148.6.0.24 80]
Err http:// hu.archive.ubuntu.com hardy/universe i386 Packages                  
  404  Not Found [IP: 148.6.0.24 80]
Ign http:// hu.archive.ubuntu.com hardy/universe Translation-en_US              
Hit http:// us.archive.ubuntu.com trusty-updates/multiverse Translation-en     
Hit http:// us.archive.ubuntu.com trusty-updates/restricted Translation-en      
Get:35 http:// us.archive.ubuntu.com trusty-updates/universe Translation-en [131 kB]
Ign http:// hu.archive.ubuntu.com hardy/universe Translation-en                 
Get:36 http:// us.archive.ubuntu.com trusty-backports/main Sources [5,298 B]    
Err http:// hu.archive.ubuntu.com hardy-updates/universe Sources                
  404  Not Found [IP: 148.6.0.24 80]
Get:37 http://us.archive.ubuntu.com trusty-backports/restricted Sources [28 B] 
Get:38 http:// us.archive.ubuntu.com trusty-backports/universe Sources [20.7 kB]
Err http:// hu.archive.ubuntu.com hardy-updates/universe amd64 Packages         
  404  Not Found [IP: 148.6.0.24 80]
Get:39 http:// us.archive.ubuntu.com trusty-backports/multiverse Sources [1,898 B]
Get:40 http:// us.archive.ubuntu.com trusty-backports/main amd64 Packages [5,536 B]
Get:41 http:// us.archive.ubuntu.com trusty-backports/restricted amd64 Packages [28 B]
Err http:// hu.archive.ubuntu.com hardy-updates/universe i386 Packages          
  404  Not Found [IP: 148.6.0.24 80]
Get:42 http:// us.archive.ubuntu.com trusty-backports/universe amd64 Packages [24.4 kB]
Get:43 http:// us.archive.ubuntu.com trusty-backports/multiverse amd64 Packages [1,245 B]
Ign http:// hu.archive.ubuntu.com hardy-updates/universe Translation-en_US      
Get:44 http:// us.archive.ubuntu.com trusty-backports/main i386 Packages [5,550 B]
Get:45 http:// us.archive.ubuntu.com trusty-backports/restricted i386 Packages [28 B]
Ign http:// hu.archive.ubuntu.com hardy-updates/universe Translation-en         
Get:46 http:// us.archive.ubuntu.com trusty-backports/universe i386 Packages [24.5 kB]
Get:47 http:// us.archive.ubuntu.com trusty-backports/multiverse i386 Packages [1,249 B]
Get:48 http:// us.archive.ubuntu.com trusty-backports/main Translation-en [3,233 B]
Hit http:// us.archive.ubuntu.com trusty-backports/multiverse Translation-en    
Hit http:// us.archive.ubuntu.com trusty-backports/restricted Translation-en    
Get:49 http:// us.archive.ubuntu.com trusty-backports/universe Translation-en [22.7 kB]
Ign http:// us.archive.ubuntu.com trusty/main Translation-en_US                 
Ign http:// us.archive.ubuntu.com trusty/multiverse Translation-en_US           
Ign http:// us.archive.ubuntu.com trusty/restricted Translation-en_US           
Ign http:// us.archive.ubuntu.com trusty/universe Translation-en_US             
Fetched 3,258 kB in 11s (275 kB/s)                                             
W: Failed to fetch http:// hu.archive.ubuntu.com/ubuntu/dists/hardy/universe/source/Sources  404  Not Found [IP: 148.6.0.24 80]

W: Failed to fetch http:// hu.archive.ubuntu.com/ubuntu/dists/hardy/universe/binary-amd64/Packages  404  Not Found [IP: 148.6.0.24 80]

W: Failed to fetch http:// hu.archive.ubuntu.com/ubuntu/dists/hardy/universe/binary-i386/Packages  404  Not Found [IP: 148.6.0.24 80]

W: Failed to fetch http:// hu.archive.ubuntu.com/ubuntu/dists/hardy-updates/universe/source/Sources  404  Not Found [IP: 148.6.0.24 80]

W: Failed to fetch http:// hu.archive.ubuntu.com/ubuntu/dists/hardy-updates/universe/binary-amd64/Packages  404  Not Found [IP: 148.6.0.24 80]

W: Failed to fetch http:// hu.archive.ubuntu.com/ubuntu/dists/hardy-updates/universe/binary-i386/Packages  404  Not Found [IP: 148.6.0.24 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
:~$ sudo apt-get install g77
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package g77 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'g77' has no installation candidate
:~$ which g77
:~$ dir
  • Have you tried sudo apt-get install f2c – user107425 Feb 27 '15 at 2:48
  • I have tried it, and I just tried it again. I still got the same results seen below: :~$ sudo apt-get install g77 Reading package lists... Done Building dependency tree Reading state information... Done Package g77 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'g77' has no installation candidate :~$ – Randy Clark Feb 27 '15 at 3:21
0

I work with hella old F77 programs too! gfortran has flags you can set to specify that you are using / compiling old code. They help, but are not perfect. You may also want to compile with debug options on.

you can read the manpage for gfortran to get more info. -ff2c Generates code designed to be compatible with code generated by g77 and f2c. -g sets debuging so that you can use GDB later

gfortran -ff2c -g foo.f -o foo

here is a niffty tutorial on debugging fortran http://infohost.nmt.edu/tcc/help/lang/fortran/gdbcompile.html

its wrote for older systems, but I think its understandable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.