Mac programming newbie - help installing Fortran
Hi all,
I have had some very basic programming classes in years past, including a Fortran class, but we really never went beyond basic loops and stuff like that.
I am now in a class that is going to require using functions from the CERN program libraries. After fiddling around with the Fortran software I had used in Windows (Force 2.0), I was unable to figure out how to implement libraries into my program. After doing a bit of research, it seems most people do programming on Linux/UNIX, and thus I am trying to use my Mac now.
I downloaded the Apple Development Kit and have been looking at various articles on this site and others about how to set up a Fortran compiler. I would ideally like to use Xcode because that is the type of environment I am used to working in, but a lot of the material and options are way over my head, because like I said I've only had some very basic programming classes. Unfortunately, a Google search brings up information from years past, and I've now downloaded several various compilers and plugins at this point which may or may not be relevant/compatible. I am also not vary fluent in UNIX, so I am unsure if I have even extracted things correctly.
I guess what I'm asking is: could someone give me a step-by-step guide on what I need to download and how to set up Xcode to do a basic Fortran program using a library? I'm using Leopard and Xcode 3.1. Assume I haven't downloaded anything except the Development Kit - I'm going to try to go back and start from scratch here.
Thanks in advance.



Using a Makefile with Xcode
I posted the following a little over a year ago to this site, but even though I know it is there I have a hard time finding it. I give it here again.
Since a lot of those who are going to be working with Fortran will be working with legacy code, and might want/need a Makefile, I thought I would list the steps to take to get Xcode to work with legacy fortran code (including a Makefile).
1. File -> New Project. In the window that pops up choose "Standard Tool" in the "Command Line Utility" submenu.
2. Delete All the files in source (When prompted: Tell it to delete the files and refrences).
3. Drag all fortran code files into the source folder (When prompted: Click on Default). -Note: this will keep the folder structure and paths.
4. Delete the target (When prompted: Click on Default).
5. Project -> New Target. (When prompted choose: External Target).
6. Give the target a name when prompted.
7. In the Target settings set Arguments to: "PATH=/usr/local/bin:/other/paths/bin:$PATH $(ACTION)"
8. In the Target settings set Directory to the path of the folder where you want the executable and .o files to be placed. I want the executable (and the .o) to be placed in the same folder as the Makefile (as a simple Makefile would), in the case of the program that I am currently writing this is: "/Users/3/Lewis_Group/Programming/xyzSTATS"
9. Right-Click on the Executable Icon.
10. When prompted. Add: New Custom Executable
11. When prompted give the executable a name.
12. Set Executable Path to the path of of the executable (this includes the .x executable that you would have made if you typed make). In the case of the project that I am currently working on this is "/Users/3/Lewis_Group/Programming/xyzSTATS/xyzSTATS.x"
13. Finishing Step 12 will bring up a new window. In "Set the working directory to:" choose "Custom directory." Then set the path to be the directory in which your Makefile puts the executable.
Following these steps will allow you to use "Build" and "Build and Go". I have not tried to use Debug yet, so I don't know if there is anything special that needs to happen when using a Makefile. Hopefully, someone will post a reply describing what steps to take, if we do need to do something special.
error mesg
Hi,
I followed the instruction and here is the error messages. Do you have any ideas about how to let it run?
Building target “runclass” of project “cnclass” with configuration “Release” — (1 error)
cd /Users/cks/CNCALASS
/usr/bin/make PATH=/usr/local/bin:/other/paths/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
make: *** No rule to make target `Allometry.obj', needed by `runclass'. Stop.
make: *** No rule to make target `Allometry.obj', needed by `runclass'. Stop.
make: *** No rule to make target `Allometry.obj', needed by `runclass'. Stop.
Build failed (1 error)
error in Makefile
kchang,
The error "No rule to make target" leads me to believe that the problem lies in your Makefile. You will need to go though it very carefully, and test each line.