[R-SIG-Mac] Macports installation problem
macqueen1 at llnl.gov
Fri Oct 20 20:02:33 CEST 2017
The OP's question has inspired an interestingly large number of responses.
One thing I'm curious about, and I don't think I've seen in the discussion, is why the OP needed to install Cairo graphics with respect to R (otherwise the question was indeed off-topic for R-sig-Mac).
In summary (and I think this is reasonably consistent with other responses; discussion to support my summary follows):
1) Use CRAN R, install dependencies needed for extended R capability on the OS as needed, from whatever source you prefer, or whichever is easiest for R to use
2) If one chooses to install R using MacPorts or homebrew, be prepared to exercise a greater depth of computer science smarts
3) Feel free to install other useful stuff using MacPorts or homebrew, whichever one prefers; there is unlikely to be any conflict with R
In close to 20 years of using R on Mac, I have always been able to use whatever capabilities R offers that I wanted to use, using the R provided on CRAN. Nothing has ever motivated me to install R using MacPorts or homebrew in order to obtain some capability that I couldn't have using CRAN's binary download for Mac. This includes things like access to remote Oracle databases, using various spatial packages built around sp and rgdal, reading and writing MS Office files (both Word and Excel), building simple tcl/tk interfaces, writing my own packages that link to Fortran, and probably more that I don't remember. I see no necessity to install R from MacPorts or homebrew. Of course, if one wishes to for whatever reason, great! And I'm glad that people have wanted to make R available from those package managers.
I do use MacPorts, however, to get useful software such as an X Windows aware version of emacs, ghostscript, and ImageMagick. Indeed, I even have cairo installed using MacPorts, albeit on a 10.11.6 system, not a 10.12.x system like the OP. (It's probably there as a dependency for some other MacPorts package.) From that point of view, the OP's command to install it using MacPorts was correct. I'd need more information to make a guess at why it didn't succeed.
Some R packages do, of course, depend on external libraries not provided with R. One has to install these from somewhere. For example, the spatial packages need GDAL. In this case, I use the KyngChaos frameworks, but I'm aware that they're also available from MacPorts (and probably homebrew as well). Could I use them instead? Probably; R is pretty good about letting the user specify where dependencies are found.
I do not know what R extended capability depends on installing Cairo graphics on the OS. The X11() graphics device, as provided (I believe), has a version that uses cairo. There is the Cairo R package, but it has a binary version, at least for R on 10.11.x, so there's no need to install Cairo graphics to install the Cairo package.
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
Lab cell 925-724-7509
On 10/20/17, 8:34 AM, "R-SIG-Mac on behalf of David Winsemius" <r-sig-mac-bounces at r-project.org on behalf of dwinsemius at comcast.net> wrote:
> On Oct 19, 2017, at 11:33 PM, Rainer Krug <rainer_krug at icloud.com> wrote:
>> On 19 Oct 2017, at 20:25, Robert Baer <rbaer at atsu.edu> wrote:
>> -- snip --
>>>>> I think using MacPorts might actually be the "error" that needs correction. I would suggest an alternate strategy. Go to http://r.research.att.com/libs/ and get the appropriate version of cairo, probably the most recent one.
>>>>> Scroll down to the bottom of that page and an appropriate modification of the two lines for unpacking to the root.
>>>>> curl -O http://r.research.att.com/libs/cairo-1.14.2-darwin.13-x86_64.tar.gz
>>>>> sudo tar fvxz gmp-4.2.4-darwin8-bin4.tar.gz -C /
>> Even though its not my question, I appreciate the specific recommendations on best practices for move ahead.
>>>>> The Mac version of R does not do well with either MacPorts or homebrew installation of required system packages because those package managers put them in loaction that are not recognized by the static build that is the default.
>>>> Using homebrew (and as far as I know Macports as well) works without major problems. The problem start when you mix standard installations / homebrew / Macports. This results in problems.
>>> The fact that the original poster had obviously not used MacPorts (and perhaps did not even know what it was) suggests that the appropriate reply should be to discourage him from using it and offer a strategy with greater likelihood of success in combination with the more typical installation method for the Mac R fork.
>> I am brand new to this list, but have been using R since about 2000. The reason I'm here is to translate Mac-speak like "homebrew" and "MacPorts" into grounded advice that lets me use R as effectively on my new Mac as my Windows and Linux machines.
> If you know your way around in Linux, I would suggest looking into homebrew - it essentially brings the approach of apt (in the case of debian) to a Mac. If not, you might be better off with the official R installers. But all work equally after installed.
I think it might be a bit more complicated than "just use the same installer all the time", but am not a user of either homebrew or MacPorts so am speaking only from reports I have read in this mailing list and SO. Bob Rudis whom I also respect in such matters has several times made the same suggestion. I think there may need to be supplemental instructions on setting system environment variables and also possibly further changes to Makevars files in some packages being obtained from CRAN or BioC. I have been encouraged by others to switch to homebrew, but have never found a sufficiently complete tutorial that appeared to cover these other issues. If you know of one, Rainer, I think you should share it.
>> I appreciate John's predicament and this approach to answering his question is highly informative to me as I lurk and learn. Thanks from this newbie Mac user.
>> Robert W. Baer, Ph.D.
>> Professor of Physiology
>> Kirksville College of Osteopathic Medicine
>> A T Still University of Health Sciences
>> 800 W. Jefferson St
>> Kirksville, MO 63501
>> 660-626-2321 Department
>> 660-626-2965 FAX
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
> University of Zürich
> Cell: +41 (0)78 630 66 57
> email: Rainer at krugs.de
> Skype: RMkrug
> PGP: 0x0F52F982
Alameda, CA, USA
'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law
R-SIG-Mac mailing list
R-SIG-Mac at r-project.org
More information about the R-SIG-Mac