Gfortran-4.2.1 build 5666.3 for Xcode 4.0.2 on Mac OS X 10.6.7

Hi,
One of the build dependencies for gnuradio on Mac OS X 10.6.7 is a
version of gfortran.

The compiler supplied with Xcode 4.0.2 on Mac OS X 10.6.7 is gcc version
4.2.1 (Apple Inc. build 5666) (dot 3).

The most recent version of gfortran-4.2.1 that I could find was for
build 5664.

http://r.research.att.com/tools/

Is there a way to build gfortran, to match the currently install gcc
compiler build from sources from the apple website:

http://opensource.apple.com/release/developer-tools-40/

http://opensource.apple.com/source/gcc/gcc-5666.3/

Elvis D.

On Sat, May 28, 2011 at 10:34 PM, Elvis D. [email protected]
wrote:

http://opensource.apple.com/release/developer-tools-40/
Source Browser

Hi Elvis,

Can you see which package requires fortran?
It sounds like a false dependency and if there actually is something
that requires fortran it might not be important.

I looked through my config.log file but the only place where I see
reference to fortran is where gcc reports that it has been compiled
with fortran support.

Alex

Hi Alex,

On May 29, 2011, at 1:04 AM, Alexandru C. wrote:

Can you see which package requires fortran?
It sounds like a false dependency and if there actually is something
that requires fortran it might not be important.

I looked through my config.log file but the only place where I see
reference to fortran is where gcc reports that it has been compiled
with fortran support.

The package that requires fortran is numpy.

http://sourceforge.net/projects/numpy/files/NumPy/1.6.0/numpy-1.6.0.tar.gz/download

A while back, I got gnuradio-3.3 to compile using gcc-4.0.1 using Xcode
3.2. Now I’m trying to refresh the build, for gnuradio-3.4.0. I’ve got
most of the core dependent libraries installed. Just got stuck at the
gfortran support.

I tried to build the apple gcc-5666.3 compile with fortran only support,
using the following configure options, but got the following error, even
though gmp is installed.

$ cd gcc-5666.3
$ mkdir -p build/obj build/install
$ …/…/configure --disable-checking --enable-werror
–prefix=/Users/elvis/Tool/gcc-5666.3/build/install
–enable-languages=fortran
–program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
–build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10-
–host=x86_64-apple-darwin10 --target=i686-apple-darwin10
–with-gmp=/usr/local

checking host system type… x86_64-apple-darwin10
checking target system type… i686-apple-darwin10
checking build system type… i686-apple-darwin10
checking for a BSD compatible install… /usr/bin/install -c
checking whether ln works… yes
checking whether ln -s works… yes
checking for x86_64-apple-darwin10-gnatbind… no
checking for gnatbind… no
checking whether compiler driver understands Ada… no
checking how to compare bootstrapped objects… cmp --ignore-initial=16
$$f1 $$f2
checking for correct version of gmp.h… no
configure: error:
The following requested languages could not be built: fortran
Recognised languages are: c,c++,objc,obj-c++

Elvis D.

Hi,
Here are my observations so far.

a. gcc-llvm-4.2 supplied with Xcode-4.0.2 package (paid version) appears
to build all the libraries, just like the standard gcc-4.0.1 from the
older Xcode-3.2.x series.

b. Xcode-4.0.2 has gcc-4.2.1 build 5666.3. There is no binary package
for gfortran-4.2.1-5666.3. The closest available is gfortran-4.2.1-5664,
which according some posts is as good as 5666, and you can install the
older binary and get gfortran and gcc-4.2.1 to work without problems.

http://r.research.att.com/gfortran-42-5664.pkg

Perhaps in a while, the folks at research.att.com will release an
updated binary package for gfortran-4.2.1-5666.3 to match the
gcc-4.2.1-5666.3 release that comes with Xcode-4.0.2.

c. For the moment, perhaps it is better to stick to Xcode-3.2.6, if you
just want the gcc compiler for building gnuradio, but don’t want to take
advantage of the newer Xcode-4.0.2 integrated IDE and its newer
features.

http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792

I still haven’t finished the manual build of gnuradio library
dependencies. Right now, I’m down to the last leg, installing and
patching GTK+ OS X libraries for gnuradio companion.

Elvis D.

On Sat, May 28, 2011 at 5:19 PM, Elvis D. [email protected]
wrote:

with fortran support.

–host=x86_64-apple-darwin10 --target=i686-apple-darwin10
checking whether compiler driver understands Ada… no
checking how to compare bootstrapped objects… cmp --ignore-initial=16
$$f1 $$f2
checking for correct version of gmp.h… no
configure: error:
The following requested languages could not be built: fortran
Recognised languages are: c,c++,objc,obj-c++

Elvis D.

I have to say that I find this very strange. Can any of our OSX gurus
out
there comment, perhaps?

Tom

On May 31, 2011, at 3:03 PM, Elvis D. wrote:

a. gcc-llvm-4.2 supplied with Xcode-4.0.2 package (paid version) appears to
build all the libraries, just like the standard gcc-4.0.1 from the older
Xcode-3.2.x series.

TTBOMK, and, really, this is kinda off list-topic by now:

Before XCode 4, Apple has -never- provided fortran as part of their
standard XCode GCC install. Apple’s GCC 4.0.1 and 4.2.1, as found in
XCode for OSX 10.5 and 10.6, do not. I don’t have XCode 4 yet, so I
cannot comment on what is included with it.

GCC is under the GPL, so Apple is required to release their source
changes in some way. Thus, since GCC is capable of building fortran,
Apple’s GCC variant should be as well with the correct tweaks. I’m not
a GCC hacker, but I’m sure there are folks out there who could figure
out what to do.

Apple is moving away from stock GCC, towards LLVM / Clang etc… LLVM
provides interfaces for the major languages including fortran, though of
course Apple can provide whatever interfaces it choose to.

I’m sure there are others, but this’ll have to do for now :slight_smile: - MLD

2 comments:

1: Apple’s GCC variant does not provide a fortran option (at all); maybe
it can be hacked on, but I don’t know of a project that’s done that.
You’re better off getting the vanilla GCC & compiling it with fortran
enabled, or go with a fortran-specific project instead.

2: IIRC numpy requires fortran for the purpose of putting that name in
place for ‘f2c’-like purposes – none of the internal numpy code is
actually written in fortran and the fortran compiler is never invoked
during configuration, building, or installation of numpy. It is invoked
is you do a “test” or “check”, but you can safely ignore those errors.
Once upon a time, the MacPorts’ py27-numpy port fixed the fortran
version via a patch to the numpy source (maybe it still does) – you
should be able to do a similar trick to convince numpy that it doesn’t
even need fortran, if that’s even necessary. Of course, if you really
-do- need fortran for some real purpose (e.g., compiling a project
that’s written with fortran code), then you’re better off with vanilla
GCC.