Compiling a Fortran 77 Code on Ubuntu

  • Context: Fortran 
  • Thread starter Thread starter mathia
  • Start date Start date
  • Tags Tags
    Code Fortran Ubuntu
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
 
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 17 ·
Replies
17
Views
8K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 3 ·
Replies
3
Views
4K