davidgohel / ReporteRs

Note that ReporteRs has been removed from CRAN the 16th of July 2018 and is not maintained anymore. please migrate to officer.
245 stars 44 forks source link

Install issue (Mac OS X, High Sierra) #214

Closed md0u80c9 closed 7 years ago

md0u80c9 commented 7 years ago

Hi,

Not sure whether this is a problem directly with ReporteRs or one of its dependencies.

I'm trying to install and run ReporteRs on a Mac with High Sierra Beta 7. This may be relevant because of the introduction of APFS.

When I try to library ('ReporteRs') I get the following error:

> library ('ReporteRs') Error: package or namespace load failed for ‘ReporteRs’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so': dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so, 6): Library not loaded: /opt/X11/lib/libcairo.2.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so Reason: image not found

A quick google search for that error didn't reveal anything useful.

SessionInfo() returns the following: R version 3.4.1 (2017-06-30) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rJava_0.9-8 ReporteRsjars_0.0.2

loaded via a namespace (and not attached): [1] compiler_3.4.1 tools_3.4.1 Rcpp_0.12.12

I'd be really grateful for any suggestions.

Best wishes,

Andrew

md0u80c9 commented 7 years ago

I've solved this - Cairo needs installing. I have created the following build guide for installing Reporters on the Mac based on things I picked up from reading around which addresses some of the 'gotchas' which make installing ReporteRs non-trivial:

  1. Install XCode; check in Preferences that Command line tools is set to latest XCode.
  2. Open Terminal and enter the following commands
  3. Check Java version: • java –version
  4. If Java isn’t installed a dialog will open; download the latest JDK and install.
  5. Add a symlink to the library (on El Capitan onwards users aren’t allowed to write to /usr/lib): • sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
  6. Repeat the above every time Java is upgraded.
  7. Install HomeBrew for Mac: • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  8. Install Cairo: • brew install cairo
davidgohel commented 7 years ago

thanks, there are people that are facing issues installing Cairo. This only happens on mac OS (but I can't reproduce it neither). I will add your notes to the FAQ