Fortran Compiling a Fortran 77 Code on Ubuntu

AI Thread Summary
The discussion centers around a user named Mathia who is experiencing issues compiling and running a Fortran 77 code that previously worked on Cygwin in Windows 7. After installing f77, gfortran, and gcc on Ubuntu, Mathia encounters a compilation error with f77 and a runtime error when using gfortran, specifically a "Bad value during integer read" at a certain line in the code. Despite confirming that the input data is integer and the code functions correctly on Cygwin, the user seeks assistance.Suggestions from other forum members include posting on development boards for the specific compiler version, checking the encoding of the input file (potentially UTF-8 issues), and debugging by simplifying the program to read a single number. Additionally, they recommend ensuring the Fortran system is properly installed via Ubuntu's package management and recompiling the code to resolve potential runtime library discrepancies.
mathia
Messages
15
Reaction score
0
Hi,
I have a fortran 77 code, I compiled it on cygwin in windows 7 by using f77 and gfortran, and it has been working correctly.
I should use this code on Ubuntu, so I installed f77, gfortran and gcc compiler. I tried to comile that code by using f77 but it gave me the following error:
> f77 software.f -o software
> pickup_blockiirm:
> /usr/bin/f77: aborting compilation

The code was compiled successfully when I tried gfortran and f95, but whenever I want to run the program, it gives me the following error:
> At line 172 of file software.f
> Fortran runtime error: Bad value during integer read

I should mention that I'm sure that my input data is integer, and this code and input file works on cygwin smoothly!

Can anyone help me?
Regards,
Mathia
 
Technology news on Phys.org
mathia said:
Hi,
I have a fortran 77 code, I compiled it on cygwin in windows 7 by using f77 and gfortran, and it has been working correctly.
I should use this code on Ubuntu, so I installed f77, gfortran and gcc compiler. I tried to comile that code by using f77 but it gave me the following error:
> f77 software.f -o software
> pickup_blockiirm:
> /usr/bin/f77: aborting compilation

The code was compiled successfully when I tried gfortran and f95, but whenever I want to run the program, it gives me the following error:
> At line 172 of file software.f
> Fortran runtime error: Bad value during integer read

I should mention that I'm sure that my input data is integer, and this code and input file works on cygwin smoothly!

Can anyone help me?
Regards,
Mathia

Hey mathia and welcome to the forums.

This is just a suggestion, but since your problem is not so much with the language or even the compiler in general (but a specific version), you might get better luck posting to the dev boards for that particular port.

The only alternative to this that I think is feasible is if you had the compiler code in the raw source and then stepped through it yourself.

This sounds like a real pain to be in given that you have run it on a different platform with no problem... argh!
 
Hhhh...could it have something to do with the format or, rather encoding of the input file? So, I am not talking about the numbers in it, but, rather about UTF-8 versus something else? How did you bring your input file from Windows over to Ubuntu?

Other than that...for debugging purposes, I would shorten the program to just read one number and see if you can do that much...and start incrementing the scope of the program.
 
You probably have not got the right runtime libraries between the two systems.

Install the fortran system using the Ubuntu package management system and recompile your code on the Ubuntu installation. It should run correctly after that.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.

Similar threads

Replies
8
Views
3K
Replies
2
Views
2K
Replies
3
Views
2K
Replies
17
Views
6K
Replies
2
Views
6K
Replies
5
Views
5K
Back
Top