gfortran on MacOS X

Dominik Epple epple@tphys.physik.uni-tuebingen.de
Mon May 2 10:35:00 GMT 2005


Am 28.04.2005 um 21:48 schrieb Bill Northcott:

> On 29/04/2005, at 1:02 AM, Dominik Epple wrote:
>>> I have managed to build gfortran as part of an Apple gcc-4.0 
>>> compiler on MacOS X 10.3.9.  The code was tagged apple-ppc-5009 and 
>>> seems to be merged with FSF code as at 6 April 2005.
>>>
>>> By adding 'f95' to the --enable-languages line in Apple's 
>>> 'build_gcc' script, I can get gfortran to configure.
>> could you please explain in detail how you did this? Where did you 
>> get this script from? Was it part of an archive? With which arguments 
>> did you run the script?
>
> If you pull gcc code from the cvs with a tag like apple-gcc-50XX you 
> will get the Apple Darwin gcc code including the build script.  There 
> is a file of build instructions README.APPLE.
>>
>> Downloading a googled version of this script and invoking it with 
>> some fancy parameters,
>>
>> ../build_gcc ppc ppc /Users/dominik/gcc-4.0.0 /Users/dominik/destroot 
>> /Users/dominik/destdir /Users/dominik/destinfo
>
> Follow the instructions in README.APPLE.  The script expects a number 
> of environment variables, and will only work on Apple gcc code.  The 
> Apple build does two staging installs.  The first into a standard FSF 
> file layout within the build directory and then a copy from there into 
> an Apple style layout under dst/.  It is that second copy which omits 
> the static libraries.  Once you have an Apple file arrangement in 
> dst/, you use 'sudo ditto' to copy it into /usr.
>>
>> gives the following:
>>
>> configure: error: GMP with MPFR support is required to build f95
>>
>> Normally, und Unix, I now would download and install GMP. Okay, but 
>> what is the 'canonical' way for Mac OS X to do so? How would one 
>> build a Mac OS X package?
>
> Really it is UNIX.  Just grap a GMP tarball and build it.
>
> For more info see the O'Reilly book - 'MacOS X for UNIX geeks' which 
> is excellent.
>
> Bill Northcott
>

Thank you for your explications.

I did as described above. Especially, my modifications to the build_gcc 
script are:

cork:~/gcc dominik$ cvs diff build_gcc
Index: build_gcc
===================================================================
RCS file: /cvsroot/gcc/gcc/Attic/build_gcc,v
retrieving revision 1.1.4.6
diff -r1.1.4.6 build_gcc
102c102
<   --enable-languages=c,objc,c++,obj-c++ \
---
 >   --enable-languages=c,objc,c++,obj-c++,f95 \
105c105,106
<   --build=$BUILD-apple-darwin$DARWIN_VERS"
---
 >   --build=$BUILD-apple-darwin$DARWIN_VERS \
 >   $MYFLAGS"
321a323,324
 > # dominik hack
 > cp -p $DIR/dst-$BUILD-$t$DEST_ROOT/lib/libgfortranbegin.* 
.$DEST_ROOT/lib/ || exit 1


where I use $MYFLAGS to tell configure where my GMP lives.

Then, building and installing works. (To be honest, the #dominik hack 
line is not tested yet as I copied these files manually after the 
install. The script is thus to be verified.)

After installing the compiler into /usr using ditto, I can successfully 
compile and run my a litte numeric testprogram. :)

Playing with the idea of providing binary packages for gfortran.org (as 
someone doing so is missing as I read), let me ask the following 
question: how do I build such nice .dmgs with pkgs inside?

If I understand correctly it is all about the equivalent of 'tar cf 
gfortran.tar build/dst' ...

Regards, Dominik.



More information about the Fortran mailing list