Sign in with
Sign up | Sign in
Your question
Solved

Run a fortran file

Last response: in Linux/Free BSD
Share
January 28, 2011 1:07:32 AM

Hello,

Hello,

I'm trying to compile and run a fortran file (name zerodegen1). I used this command

$f77 -o zerodegen1 zerodegen1.f -limsl -lsocket -lnsl

and it compiles the file. But then, when I want to run the file using this command

$zerodegen1

I got this error message:
*** TERMINATING zerodegen1
*** Received signal 4 SIGILL
Illegal Instruction

Can you tell me what is the problem here?

More about : run fortran file

Best solution

January 28, 2011 6:47:46 AM

Unlikely to be able to diagnose the problem without seeing the program.

Short answer - there's something wrong with the program or your compiler configuration. Not a very helpful answer, but not a very helpful question.
Share
January 28, 2011 10:55:48 AM

There's a bug in the code. Programmers call this a runtime error. Just because a program compiles doesn't mean that it will run as expected. Consult the author of the program and try to find a solution. There may be missing compiler options that are needed to get working code, but we wouldn't be able to help with that, only the author.
m
0
l
Related resources
January 28, 2011 11:03:51 AM

Hmm. Illegal instruction errors aren't normally caused by logic errors in the program. A compiler option seems more likely.

It might be instructive to run the program under gdb to see which instruction is causing the fault.
m
0
l
January 29, 2011 12:20:50 PM

Don't know about Fortran (haven't touched it for 20 years), but with C / C++ (etc) you normal use the compiler to create object modules, then use ld to link them to the run-time libraries and start-up code...

I've always used tools like Automake to build makefiles that do the dirty work.
m
0
l
January 29, 2011 6:24:46 PM

Gcc automatically compiles, assembles, and links if you don't tell it to do otherwise. So the command in the op would have produced the executable. (It wouldn't have run far enough to die with an illegal instruction if it hadn't been properly linked.)
m
0
l
February 8, 2011 10:18:29 PM

Best answer selected by amirahazmi.
m
0
l
February 8, 2011 10:20:10 PM

Thank you so much for all the feedbacks. It was some kind of error in the code itself that has been fixed. The program works fine now.
m
0
l
!