• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: xcode and fortran
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xcode and fortran


  • Subject: Re: xcode and fortran
  • From: Bill Northcott <email@hidden>
  • Date: Tue, 20 Sep 2005 16:05:12 +1000

On 20/09/2005, at 1:01 PM, Michael Rice wrote:
I can't answer your question about Xcode, but I would like to know
how to get a "complete" GCC on Mac (i.e., GCC with Fortran and Ada).
I've got a lot of code I'd like to port from SGI to Mac, but don't
have the compilers to do it.

Building Fortran is not too hard. I have no idea about ADA because I never tried.


You need the Apple sources, which you can get from the normal FSF gcc cvs. (see http://gcc.gnu.org) It is just a matter of using the right cvs tag for the checkout. The current Xcode2.1/2.2a compiler is apple-gcc-5026. If you want to live dangerously try something like apple-gcc-5230 (you can see the most recent tags in the cvs web interface). If you want to futz with the very latest that may not even build, try apple-local-200502-branch.

Once you have the source, you need the GMP maths library. The standard source builds on MacOS 10.4 without problems.

That is all the preliminaries. See README.Apple for the build instructions. Note that the build is driven by a shell script 'build_gcc' which drives configure, make and a final copying step to a staging directory which is dittoed into the install location. Run it without mods once to see how it works.

To get fortran to build you just need to modify the '--enable- languages' option for the configure script at around line 102 in build_gcc to add 'f95'. You could try adding 'ada' as well.

Possible issues:
If you are trying to build on a G4, the configure script will break because the build includes 64bit libraries and although the compiler can build 64 bit code, it won't run on a G4. So you get a message that the compiler can't build executables. There are APPLE LOCAL mods to work around this for C and C++, just copy them into the Fortran bit of the script.


The final copying step into the staging directory omits the run time libraries libgfortran.dylib and libgfortranbegin.a. You will need to xcopy these manually. Check the headers as well.

You will probably have issues similar to these with ada.

Finally the gfortran code in the Apple sources is from gcc 4.0.1. There have been a huge number of bug fixes and improvements since then. Perhaps they will resync after the imminent gcc-4.0.2 release which would be nice. Otherwise you need some intelligent diffing against the gcc-4_0 branch to generate suitable patches which include the more recent work. Apple are making mods in the Fortran code so hopefully once it is judged production quality it will appear in Xcode.

None of the above applies to g77/gcc3. The Apple sources for this won't build.

If this won't work for you, you can always build using FSF sources. This will work, but the resulting compiler will not work well with Xcode and lacks the PPC/Darwin optimisations that apple have added.

Bill Northcott

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: xcode and fortran
      • From: Joe Kurtz <email@hidden>
  • Prev by Date: xcode and fortran
  • Next by Date: BugReport: Build after changing build config compiles old code
  • Previous by thread: xcode and fortran
  • Next by thread: Re: xcode and fortran
  • Index(es):
    • Date
    • Thread