[R-SIG-Mac] Compiling R-packages on Mac

R. Michael Weylandt michael.weylandt at gmail.com
Sat Mar 30 12:59:54 CET 2013


Let's keep this on list.

(And if you can, please do reply in plain text -- I've had to
re-format things more or less manually to make it legible)

On Sat, Mar 30, 2013 at 11:50 AM, Petar Milin
<petar.milin at uni-tuebingen.de> wrote:
>
>> On Mar 30, 2013, at 12:43 PM, Michael Weylandt <michael.weylandt at gmail.com>
>> wrote:
>
>>> I am a newbie on Mac, with long Linux experience (Ubuntu, than Debian,
>>> finally Fedora, for many years). R on Mac is very pleasant and works nicely.
>>> However, I noticed something strange, while I was trying to compile a
>>> package on which my research team is working. Briefly, I could
>>> compile/install the package via R interface, but not in console mode
>>> (terminal). It seems that some low-level stuffs are missing, like gfortran
>>> and the like. Now, I wonder how it is possible to compile the package
>>> successfully via R IDE, but not in terminal, with R CMD INSTALL xyz?
>>
>>
>> It does sound a bit strange. Are you sure you are successfully installing
>> and from source in both circumstances? You might be downloading a pre-built
>> binary from the interactive prompt if you are using install.packages without
>> twiddling the defaults.
>
>
> Nope! I am quite sure that I set Local Binaries, then selected a file and
> all went smoothly.
>

But where did the local binaries come from if you can't build them?
Perhaps a $PATH issue, but I'd be quite surprised if R.app had a
different path than the plain R executable.

Perhaps the following will help

echo $PATH

from the terminal and Sys.getenv("PATH") from within R. If you can
narrow it down to what tool in particular is failing, comparing the
output of `which` and Sys.which() might be more direct.

Finally, the traceback of the failed build perhaps and the exact
install.packages() command you used.

>
>>> Also, if I miss something which is not there by default, and provided by
>>> Xcode, how to get that? Should I use Mac Ports? Homebrew? Or via packages on
>>> this site <http://hpc.sourceforge.net/index.php>?
>>
>>
>> All detailed here: http://r.research.att.com/
>>
>> But in short: XCode from Apple + Simon's gfortran.
>>
> So, that is, than, from  http://r.research.att.com/, not to use Mac Ports or
> even this, above http://hpc.sourceforge.net/index.php? Many options…

Yes, sorry if that wasn't clear. Simon is the official R-on-Mac "guy"
(though certainly not the only one of R Core to use it) and provides
the official binaries. You can probably get away with using Mac Ports
or Homebrew or whatnot, but if it doesn't work and you need help, be
prepared to be told to use the officially supported tools.

Michael



More information about the R-SIG-Mac mailing list