Help! Running Fortran program with Xcode

Hi all,

I am developing a Fortran code for a class project, I understand Matlab, but very little of advanced programming like Fortran or C++, but have to learn some for my class (note: it is not a programming class). The professor gave us a code to run and modify it, the code is supposed to work (and in fact it is working on windows computers). I didn't know how to run Fortran on a mac so I followed the instructions given in these links:

http://www.macresearch.org/xcodegfortran_contest_winner_damienbobillot
http://lists.apple.com/archives/fortran-dev/2006/Mar/msg00011.html

I installed Xcode 2.4, and gfortran. After I made my Project on Xcode (following the links above), I clicked Build and it was successful, but after I clicked Build and Go I got the following error:

Warning:Array reference at (1) is out of bounds
Command/usr/local/bin/gfortran failed with exit code 1

I don't know what does that mean. Can anyone help me with this?
I would like some easy-to-follow instructions to run a Fortran program with Xcode, starting from the basics.
It is hard to find an easy compiler for mac, PC people have qFortran (for free at at school) and things like that where you just have to click compile and that is it.

Thanks!

lbml

iBook G4, Mac OS X (10.4.11)

Posted on Feb 25, 2008 9:28 PM

Reply
2 replies

Feb 25, 2008 9:39 PM in response to lbml

I'd need to see your code to give details, but the error you got says you declared an array with a certain number of elements and then you tried to talk to the array outside those elements.

For example you say:

integer myArray(5)


and then try to index either myArray(0) or myArray (6).

Does that make sense. I have never tried to get fortran working with Xcode, but I did get Pascal working, so it is probably better is someone else helps you, but I will try if no one steps up.

Feb 25, 2008 9:50 PM in response to Sagesse

Thanks for your help, I really appreciated.
I think I understand your point but my knowledge is so short that I can't figure out what is wrong in the code, however, exactly the same code is running ok on PCs

I started again a new Project, and again Build was successful, but this time after Build and Go, a window popped up with the message:
No launchable executable present path.
/Users/(my name)/Documents/aeromain02/build/Release/aero_target

Any clues?

Thanks!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Help! Running Fortran program with Xcode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.