Unable to install libraries on Microsoft R Open 3.5 / MacOS High Sierra / R Studio 1.1.453

Quite frustrating. Any help would be appreciated.

I cannot install tidyverse, or any library, anymore. I am pasting a console log file from a install.packages() with some notes at the beginning of the file. I always get a non-zero exit status. I am running Microsoft R Open 3.5.0. I have reinstalled MS R Open 3.5 twice now with no luck. I am running R Studio 1.1.453

I know this is machine specify because I have no problems with my other machines.

MacOS High Sierra
Version 10.13.5
MacBook Air
Processor 1.7 GHz
Memory 8 GB
154.65 GB storage free

I am pasting interesting snippets from the console log file from a

install.packages("tidyverse", dependencies = TRUE)

separated with a "~~~~~~".

I always get a non-zero exit status. I am running Microsoft R Open 3.5.0. I have reinstalled MS R Open 3.5 twice now with no luck. I am running R Studio 1.1.453


R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

Multithreaded BLAS/LAPACK libraries detected. Using 2 cores for math algorithms.

Default CRAN mirror snapshot taken on 2018-06-01.
See: https://mran.microsoft.com/.

Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
  dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /opt/X11/lib/libSM.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Resources/modules//R_X11.so
  Reason: image not found
[Workspace loaded from ~/.RData]

> install.packages("tidyverse", dependencies = TRUE)
also installing the dependencies ‘colorspace’, ‘testthat’, ‘mnormt’, ‘munsell’, ‘processx’, ‘utf8’, ‘backports’, ‘plyr’, ‘psych’, ‘reshape2’, ‘bindrcpp’, ‘glue’, ‘Rcpp’, ‘tidyselect’, ‘digest’, ‘scales’, ‘lazyeval’, ‘mime’, ‘openssl’, ‘cellranger’, ‘callr’, ‘selectr’, ‘stringi’, ‘pillar’, ‘evaluate’, ‘markdown’, ‘yaml’, ‘htmltools’, ‘base64enc’, ‘rprojroot’, ‘broom’, ‘dplyr’, ‘dbplyr’, ‘forcats’, ‘ggplot2’, ‘haven’, ‘hms’, ‘httr’, ‘lubridate’, ‘modelr’, ‘purrr’, ‘readr’, ‘readxl’, ‘reprex’, ‘rlang’, ‘rvest’, ‘stringr’, ‘tibble’, ‘tidyr’, ‘xml2’, ‘feather’, ‘knitr’, ‘rmarkdown’

trying URL 'https://mran.microsoft.com/snapshot/2018-06-01/src/contrib/colorspace_1.3-2.tar.gz'
Content type 'application/octet-stream' length 293433 bytes (286 KB)
==================================================
downloaded 286 KB

~~~~~~
it downloads all the tar.gz with no problems
~~~~~~


Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
  dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /opt/X11/lib/libSM.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Resources/modules//R_X11.so
  Reason: image not found
* installing *source* package ‘colorspace’ ...
** package ‘colorspace’ successfully unpacked and MD5 sums checked
** libs
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include   -fPIC  -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include  -c colorspace.c -o colorspace.o
make: /usr/local/clang4/bin/clang: No such file or directory
make: *** [colorspace.o] Error 1
ERROR: compilation failed for package ‘colorspace’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.0-MRO/Resources/library/colorspace’
Warning in install.packages :
  installation of package ‘colorspace’ had non-zero exit status
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
  dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /opt/X11/lib/libSM.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Resources/modules//R_X11.so
  Reason: image not found
* installing *source* package ‘mnormt’ ...
** package ‘mnormt’ successfully unpacked and MD5 sums checked
** libs
gfortran -arch x86_64   -fPIC  -g -O2  -c biv-nt.f -o biv-nt.o
make: gfortran: No such file or directory
make: *** [biv-nt.o] Error 1
ERROR: compilation failed for package ‘mnormt’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.0-MRO/Resources/library/mnormt’
Warning in install.packages :
  installation of package ‘mnormt’ had non-zero exit status



Warning message:

From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
HEAD is now at b87fc8c Merge pull request #4369 from MikeMcQuaid/cache_store_mkpath
==> Tapping homebrew/core
Cloning into '/private/var/folders/5n/1xj9jlpj2n9cxfbpfjf7ydbw0000gn/T/build-openssl@1.1/Library/Taps/homebrew/homebrew-core'...
Tapped 4579 formulae (4,831 files, 12.2MB)
Already up-to-date.
Error: Your Xcode (6.2) is too outdated.
Please update to Xcode 9.4 (or delete it).
Xcode can be updated from the App Store.

Using PKG_CFLAGS=-I/var/folders/5n/1xj9jlpj2n9cxfbpfjf7ydbw0000gn/T//build-openssl@1.1/opt/openssl@1.1/include -I/var/folders/5n/1xj9jlpj2n9cxfbpfjf7ydbw0000gn/T//build-openssl@1.1/opt/openssl/include
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.0-MRO/Resources/library/openssl’
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status

ERROR: dependencies ‘broom’, ‘dplyr’, ‘dbplyr’, ‘forcats’, ‘ggplot2’, ‘haven’, ‘hms’, ‘httr’, ‘lubridate’, ‘modelr’, ‘purrr’, ‘readr’, ‘readxl’, ‘reprex’, ‘rlang’, ‘rvest’, ‘stringr’, ‘tibble’, ‘tidyr’, ‘xml2’ are not available for package ‘tidyverse’

  • removing ‘/Library/Frameworks/R.framework/Versions/3.5.0-MRO/Resources/library/tidyverse’
    Warning in install.packages :
    installation of package ‘tidyverse’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/5n/1xj9jlpj2n9cxfbpfjf7ydbw0000gn/T/RtmpFZs1Hw/downloaded_packages’


> .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/3.5.0-MRO/Resources/library"

Forget Microsoft R Open on High Sierra. I've been a fan of MRO in the past, but with release 3.5.0 they freaked up big time. Not only they postponed the release date many times, but the final result doesn't work. I've been wasting time for a couple days installing, uninstalling, looking for help on the Internet, to no avail. It seems that the problem lies in the Warning you get when you launch it:

Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
  dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /opt/X11/lib/libSM.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Resources/modules//R_X11.so
  Reason: image not found
[Workspace loaded from ~/.RData]

These libraries R_X11.so and libSM.6.dylib are needed to install pretty much any package on CRAN, but it seems like those shipped with MRO have some bug. The result is that installing packages is impossible.

You can ask for support in the Microsoft R Open support forum, but this error seems to crop up every now and then when they release a new version...I'm not sure they'll be able to solve this. Read this thread

https://social.msdn.microsoft.com/Forums/en-US/f4ed5dd2-6c7f-427b-8130-306c230891d0/error-with-331-on-mac-os-x?forum=ropen

Apparently our own @kevinushey found out that this is a bug in the MRO binaries, though of course this was for older versions, so we can't be 100% sure the same is happening for the current version.

Personally, I saved myself all the pain and the hassle, and I happily went back to the CRAN-provided R binaries, but if you're feeling adventurous, you can write on their support forum.

PS for reasons I don't know, it seems the MRO Windows binaries don't have a similar problem.

1 Like

Thank you Andrea!

For documentation purposes, I downloaded / installed / reboot XQuartz 2.7.11 with no luck. My next step is to get rid of MRO 3.5....

ok.  It's now working thanks to Andrea!  

Here is what I did: 
- Removed MRO 3.5 from my system
- Downloaded / installed XQuartz.2.7.11
- Downloaded / installed R 3.5  (cran.us.r-projet.org)
- Downloaded / installed clang-6.0.0.pkg  (cran.us.r-projet.org)
- Downloaded / installed gfortran-6.1.pkg  (cran.us.r-projet.org)
- Rebooted my system

Everything seems to work fine now!
1 Like