fortran plugin for xcode 3.1?
By chem at Mon, Jul 21 2008 10:53pm |
Has anyone attempted to use the fortran plugin with Xcode 3.1? If so, were you using the ADC download of Xcode 3.1 or the iphone SDK? Did it work? Did you use the plugin left over from the install of 3.1 over 3.0, or did you reinstall the plugin after installing 3.1?
I am of course referring to the plugin made for Xcode 3.0, which is available here:
http://maxao.free.fr/xcode-fortran-plugin/
I am curious -- and may wish to use the fortran plugin in Xcode 3.1 myself, clearly :)
thanks!




Re:
I want to use the plug-in too. But its not working in 3.1. Actually I'm working with 3.1.1 the latest version of Xcode came with iPhone SDK. Is there anyone who can help?
I have tried the fortran
I have tried the fortran plugin under a fresh installation of Leopard and Xcode 3.1 without success.
As far as I know (I've never used Xcode much myself, preferring to stick to command line tools) Xcode 3.1 has changed very much from the 2.5 version I've occasionally used.
Any help would be greatly appreciated by many members of this community.
Intel 11 and Xcode 3.1.2
Richard Conn Henry
I have been successfully using command line Intel fortran on my mac for years. With some trepidation I just downloaded 11.0 and also installed the iPhone SDK which provides updated developer tools. And thank heaven my command line fortran still works just fine. I've always wanted to use Xcode simply because my Language System Fortran (decades ago) had commands to create windows with menus and I can't do that now. In Xcode I could. But I am totally unfamiliar with Xcode. What I would greatly appreciate is someone sending me a simple Sample Project - a Hello World but with bells and whistles: windows with menus for example. Whatever is neat. My past experience is that I could then pop in my own fortran code and adapt. Why on earth does Intel Fortran not provide such simple samples? Or do they, and I just don't know where they are? Help, please! Oh ... and Happy Thanksgiving, everyone!
email address
Richard Conn Henry
I forgot to include my email address: henry@jhu.edu please make my day by sending me a sample Xcode fortran project!
some success, but ....
Richard Conn Henry
Well, well, with the help of my wife, I have now actually used Xcode 3.1.2 and Intel fortran 11.0 to duplicate what I have done previously from the Command line. It is much harder to do (i.e. many more steps) and it seems to add precisely zero value. What have I gained? Nothing, as far as I can see. In particular, I seem no closer to being able to create windows and menus. Looks to me like that cannot be done from fortran by itself. I'll have to learn to use ... what is it called? Cocoa or something? ... and then execute my fortran within an application. Again, if anyone has a simple example of this, kindly email it to henry@jhu.edu
does anyone already send you
does anyone already send you a fortran project in Xcode. If not tell me, I can do it
christophe
it would be nice
Could you please send it to me (a fortran project in Xcode)?
Thanks,
Adolfo
No one has sent me a sample!
does anyone already send you a fortran project in Xcode. If not tell me, I can do it
christophe
Richard Conn Henry has NOT yet received a sample. Please DO be so kind as to send me one!
linking trouble
Well, I downloaded the source for the fortran plugin from sourceforge, along with the api project. I had to copy the headers folder from the api project folder into the fortran plugin folder, and that got the plugin to compile. Plugin is installed, but when I try to build the included test project, it fails at link time. If the linking is done with gfortran however (from the command line) the project builds and the program runs.
I Fixed it!!!!!
Ok! I got the plugin to work, and the test project compiled and ran just fine.
The problem is that Xcode is for some reason insistent on calling gcc rather than gfortran during the linking stage (I think). Now gcc can't deal with fortran object files unless it's passed the right flags. So here's what I did to get it work:
1) go to : http://xcodeplugins.svn.sourceforge.net/viewvc/xcodeplugins/APIInterface/
2) click on "Download GNU tarball" at the bottom of the page
3) go to : http://xcodeplugins.svn.sourceforge.net/viewvc/xcodeplugins/FortranPlugin/
4) repeat 2
5) decompress both files (to the desktop is fine), then open the APIInterface project folder and copy the Headers folder into the FortranPlugin project folder.
6) go into the FortranPlugin project folder and open FortranPlugin.xcodeproj. Xcode will open.
7) build the release version of the project.
8) copy the file FortranPlugin/build/Release/FortranPlugin.pbplugin to ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/ (create the plugins folder if it doesn't exist)
9) open the test project included with the plugin source
10) expand on Targets under Groups & Files on the left of the project window, select the Test target, and get info on it.
11) go to the build tab, scroll down to the Linking section, and under the variable 'Other Linker Flags', enter something like 'OTHER_LDFLAGS = -lgfortran -L/opt/local/lib/gcc44 -L/opt/local/lib/gcc44/gcc/i386-apple-darwin9.7.0/4.4.0/ -lgfortranbegin'
That last step is tricky, because you have to know where the libgfortran.a and libgfortranbegin.a files reside, and include those paths with the -L flag. In my case, GCC4.4 was installed via Macports, so my search paths are as you see above.
Now the trick is going to be for someone to figure out how to mod the plugin so that we don't have to add those linker flags every time.
Paul
PS my version of xcode is 3.1.3, which is from the latest iphone dev kit.
**EDIT** Looks like the linker flags can go in the linker section of the project build options, instead of having to put them in the target build options, so either one will work, I think.
**EDIT2** Looks like a fortran only project must also have at least one .c file in it, even if the .c file is empty. Without a .c file, I get the error "error: can't exec '/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/gcc' (No such file or directory)"
This seems to be some bug with either the plugin or fluke of Xcode itself.
**EDIT3** Ok, change to the flags: Get Info on the project, go to the Build tab, find the "Other Linker Flags" variable and give it a value of "-lgfortran -lgfortranbegin", just as before. Now scroll down to the Search Paths subsection, find the variable "Library Search Paths" and give it a value like "/opt/local/lib/**", if /opt/local/lib/ happens to be the library directory for your gfortran install. The /** at the end makes Xcode search the subdirectories too, which is good. Be careful that you don't give it too much to search through though. For example, if I were to instead set it to "/opt/**", then it would take forever to finish looking for libraries.
Jesus H Christ in a chicken basket.
Jesus H Christ in a chicken basket.
You did it, Paul!!!!
For those out there using fink, I followed the instructions for Edit3 and supplied the following infomation:
• I got info on the Test Project
• Under the Build tab, I set Other Linker Flags to: -lgfortran -lgfortranbegin
• Under Library Search Paths, I supplied: /sw/lib/gcc4.4/lib/**
Both library files in the Other Linker Flags are found nested in the above directory.
For creating a new fortran project, this is what I did:
Then, you're good to go.
Side note: I could not get targets to build with the "Build Active Architecture Only" option deselected. This is on my Powerbook G4. Perhaps you need to be an intel for this to work at all? Or perhaps my gfortran version can't build for anything other than PPC. My point is, you have to keep this option selected in the release configuration where it is normally deselected. That is, the release tries to, by default, build more than just the active architecture, and this does not seem possible with gfortran on a PPC.
Thanks again, Paul.
~CmdrGuard
Is this method still valid
Is this method still valid for XCode 3.2.3 ?
I am stuck with "warning: no rule to process file '$(PROJECT_DIR)/Hello.f90' of type sourcecode.fortran.f90 for architecture i386" with XCode 3.0, 3.1 and 3.2.3 ...
Thanks