From djsamperi at gmail.com  Fri Feb 15 17:35:32 2013
From: djsamperi at gmail.com (Dominick Samperi)
Date: Fri, 15 Feb 2013 11:35:32 -0500
Subject: [Rd] Building R from source under Mac OS X 10.8.2?
In-Reply-To: <331672A8-5865-4041-BD9E-D5E0E5DFDCA2@r-project.org>
References: <CADUbQ5iR1KHRx5vcCZmgWCN_zJ2MRDD250_p0RLOz+iE+07DoA@mail.gmail.com>
	<331672A8-5865-4041-BD9E-D5E0E5DFDCA2@r-project.org>
Message-ID: <CADUbQ5h6bnwdb_XdxmWmXBAYBPXp03Z+o=XDGnTbSPmBzK3i4w@mail.gmail.com>

Thanks Simon,

I tried the FAQ first, specifically, the
bit about setting arch=x86_64, changing directory
to R-$arch, and running:

../R-2.15.2/configure r_arch=$arch  CC="gcc-4.2 -arch $arch" \
          CXX="g++-4.2 -arch $arch" F77="gfortran-4.2 -arch $arch" \
          FC="gfortran-4.2 -arch $arch" OBJC="gcc-4.2 -arch $arch" \
          --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib

This leads to:
checking whether the C compiler works... no
configure: error: in `/Users/dsamperi/Downloads/R-x86_64':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log shows that gcc-4.2 was not found, so I edited
the command line by replacing gcc-4.2 with gcc. configure
then failed because g++-4.2 was not found, so I removed
the "-4.2" part here as well.

Now configure finishes.

Thanks again,
Dominick

On Fri, Feb 15, 2013 at 9:04 AM, Simon Urbanek
<simon.urbanek at r-project.org> wrote:
> Dominick,
>
> On Feb 15, 2013, at 3:13 AM, Dominick Samperi wrote:
>
>> Hello,
>>
>> I'm trying to build R from source under Mac OS X 10.8.2 (Mountain Lion)
>> by following the FAQ and I run into a problem with the Fortran
>> compiler (downloaded from http://cran.r-project.org/bin/macosx/tools/),
>> specifically, gfortran-4.2.3. I have Xcode 4.6 installed along with
>> the latest command-line tools (dated Feb. 9, 2013).
>>
>> When I try to run configure with or without the --enable-R-framework
>> options I get this diagnostic:
>> checking for dummy main to link with Fortran 77 libraries... none
>> checking for Fortran 77 name-mangling scheme... unknown
>> configure: WARNING: unknown Fortran name-mangling scheme
>> checking whether gfortran appends underscores to external names... unknown
>> configure: error: cannot use Fortran
>>
>> I'm working with the source for R 2.15.2.
>>
>> Any tips would be appreciated.
>>
>
> Have you setup flags so that the architectures match? The default in Xcode for ML is 64-bit while the default for the Fortran is 32-bit (because that was the default for Xcode at the time), so depending on which architecture you want to compile you'll have to use either -arch x86_64 or -arch i386 (see the FAQ for a quickstart guide to compiling R).
>
> Cheers,
> Simon
>
>
>
>> Thanks,
>> Dominick
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
>



[Rd] Building R from source under Mac OS X 10.8.2?
Dominick Samperi