[R-SIG-Mac] Compiling R-packages on Mac
simon.urbanek at r-project.org
Sat Mar 30 16:33:37 CET 2013
On Mar 30, 2013, at 7:59 AM, R. Michael Weylandt wrote:
> 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>
>>>> 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,
No you can't (at least not for HPC, Fink, MacPorts) - they don't have Apple compiler drivers. If you want to use those, you'll have to compile R yourself using their tools. (I'm not 100% about Homebrew, because they apparently use our compilers as I learden from the storm of e-mails when we had server issues ;)) You'll have to pick the world you want to live in - either native OS X + CRAN (supported by us) or one of the parallel universes like MacPorts, Fink etc. (supported by them, not us). But as Brian, said, reading the manuals is a good start (and FWIW, if you downloaded R from CRAN, you did see the link pointing you to the tools).
> but if it doesn't work and you need help, be
> prepared to be told to use the officially supported tools.
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
More information about the R-SIG-Mac