Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Help with fortran

Help with fortran
Thread Tools
TumppiH
Fresh-Faced Recruit
Join Date: Jan 2004
Location: Helsinki, Finnland
Status: Offline
Reply With Quote
Sep 15, 2005, 03:32 PM
 
Hello everyone

I need some help with fortran because I need to code some stuff for a school course.

I installed g77 with fink and compiled a .f file in terminal and got a .out file, how are these run. In basics my guestion is how to run a program I have written in .f file in os x.

Other thing is how the g77 interacts with xcode, I can edit codes there, but can I compile if I have installed g77.

Hopefully you undestant my questions and somebody can help me
TumppiH
     
budster101
Baninated
Join Date: Dec 2004
Location: Illinois might be cold and flat, but at least it's ugly.
Status: Offline
Reply With Quote
Sep 15, 2005, 03:45 PM
 
God, who uses Fortran? I thought Fortran was only really good for mathematical operations.

You have to compile it with a compiler. Just like with C or PASCAL. You just can't run it.

You run it then you get output. That's it.
     
TumppiH  (op)
Fresh-Faced Recruit
Join Date: Jan 2004
Location: Helsinki, Finnland
Status: Offline
Reply With Quote
Sep 15, 2005, 03:48 PM
 
Originally Posted by budster101
God, who uses Fortran? I thought Fortran was only really good for mathematical operations.

You have to compile it with a compiler. Just like with C or PASCAL. You just can't run it.

Well apparently the professor who keeps the class likes to use fortran for calculations, we are doing mathematical stuff, so I guess its okay.
I tought that the g77 is a compiler, so do I need some additional software?

Thanks for help
TumppiH
     
budster101
Baninated
Join Date: Dec 2004
Location: Illinois might be cold and flat, but at least it's ugly.
Status: Offline
Reply With Quote
Sep 15, 2005, 03:52 PM
 
Originally Posted by TumppiH
Well apparently the professor who keeps the class likes to use fortran for calculations, we are doing mathematical stuff, so I guess its okay.
I tought that the g77 is a compiler, so do I need some additional software?

Thanks for help
I'm not familiar unfortunately with compiling Fortran on a Mac, but it's cool that your professor is using it to demonstrate the values in Fortran as a mathematical tool.

I did this stuff in High School which was..... too long ago and on a <cough>terminal hooked up to a mainfram</cough>
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Sep 15, 2005, 03:53 PM
 
I don't do Fortran, but I'm pretty sure g77 is a compiler. Did you try running the object file?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
TumppiH  (op)
Fresh-Faced Recruit
Join Date: Jan 2004
Location: Helsinki, Finnland
Status: Offline
Reply With Quote
Sep 15, 2005, 04:16 PM
 
Originally Posted by Chuckit
I don't do Fortran, but I'm pretty sure g77 is a compiler. Did you try running the object file?
okay now I got it to work, to run the .out file you have to put ./ in front of the file name if the file is in the current directory, otherwise the whole path.

For example ./foo.out

Thanks for help, now it seems to be working.
TumppiH
     
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Sep 16, 2005, 02:23 AM
 
That's not specific to what you're doing. You need to explicity state the path for any executable that isn't in your $PATH.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:25 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,