Click to See Complete Forum and Search --> : Fortran 77 - How do you run compiled programs?
cptsteiny
07-25-2002, 09:29 PM
Okay, I have a freshly installed RedHat 7.3 and I chose to install every module possible.
Now I have a few scripts written in Fortran 77 and I can compile them using the 'f77 scriptname.f -o scriptname.x' command. Everything works, it compiles and everything looks great.
However, when I try to execute the outputed excecutable, it comes back with a Bash error saying it doesn't know that command.
Is there something I need to set up somewhere in Linux so I can run these programs I compile?
Thanks,
-cptsteiny
mdwatts
07-26-2002, 06:34 AM
Is is executable?
chmod +x filename
If the executable is not in your path (echo $PATH), then you need to prefix the command with './'.
./command
Originally posted by mdwatts
Is is executable?
chmod +x filename
If the executable is not in your path (echo $PATH), then you need to prefix the command with './'.
./command
according to the compile options used the executable should already be at least 700. then the ./ should do. cptsteiny, I'm curious as to why you're using f77. gcc has g77 which I use all the time. works just fine and it's free :cool:
cptsteiny
07-26-2002, 11:26 AM
Thank you, both of you. It worked.
Just one question. 'f77' came with RH 7.3, and I just checked and so does 'g77'. At my workplace, I've always used 'f77', but can I use 'g77' and was is the difference between the two?
Thanks again!
-cptsteiny
Originally posted by cptsteiny
Thank you, both of you. It worked.
Just one question. 'f77' came with RH 7.3, and I just checked and so does 'g77'. At my workplace, I've always used 'f77', but can I use 'g77' and was is the difference between the two?
Thanks again!
-cptsteiny
g77 is the GNU compiler for fortran 77. it's free and compares very favorably to commercial compilers out there. f77 is the g77 precursor on Unix systems. last time I used it I was still working on Irix (SGI). since I migrated to Linux I only use g77 because of all the free doc. plus it works very well. I've done all sort of stuff with it. from dicky 50 lines programs to 1000+ lines CFD code. I also have f77 on Suse8.0 but never used it.
code should be interchangeable between the two compilers without any serious modifs if any. the differences between them are rather subtle and concern mostly non-standard Fortran77 extensions.
what do you use fortran for? I have to ask because fortran programmers don't run the streets :)