Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bjornkoop

macrumors newbie
Original poster
Oct 14, 2010
3
0
Hello,

I've been trying to find a solution for a few days now, but with no luck yet. Hopefully somebody here can help me.
I have installed gfortran on my mac (10.6.4) and it works ok, apart from one little thing. If I program a .f90 file to print/write to screen, nothing is displayed on the screen. It does create an output file, but it should also show the result on the screen. The previous time I had it installed (on osx 10.5.xx if I remember right) it did work. I am using the terminal to execute the fortran files using gfortran xxx.f90 command (xxx is filename). If nobody can help me, maybe somebody can explain to me how to get gfortran to work in xcode 3.2.4. I seem to be unable to figure that one out.

Thanks in advance,

Björn
 

breatheasy

macrumors member
Mar 9, 2010
71
0
This may sound like a silly question, but are you actually executing the files or just compiling them?

gfortran is a compiler, so you need to use gfortran XXX.f90 to compile the program then you need to execute the program by running ./a.out
 

bjornkoop

macrumors newbie
Original poster
Oct 14, 2010
3
0
Hmm, stupid of me. That was indeed the problem! Forgot that after all the time I haven't used it. Thank you for the quick reply! But is there an easy way to compile and build the files with xcode? I don't really like it to use terminal for it though it works. But since I also write the programs in xcode, it would be nice to be able to compile and build it with the same program. I have tried a few different possibilities, but all are for earlier versions of xcode and don't work for me (or I am doing something wrong ofcourse). I use Xcode 3.2.4. I found some things about gfortran project and plugin, but somehow I don't really get what to do and the way I do it (which is in my case it is explained to do it) doesn't work.
Hope somebody can help me with that.

Björn
 

breatheasy

macrumors member
Mar 9, 2010
71
0
I'm sure you can change the compiler somewhere in the project settings, but in my opinion with fortran you can't really beat a good text editor(aquamacs,vi,even just the editor component of xcode), the terminal and makefiles.
 

bjornkoop

macrumors newbie
Original poster
Oct 14, 2010
3
0
Hmm, well, guess I will just stick with terminal then and xcode as editor. But thanks anyway
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.