Open surfing1231 opened 8 years ago
> version
_
platform x86_64-apple-darwin16.0.0
arch x86_64
os darwin16.0.0
system x86_64, darwin16.0.0
status
major 3
minor 2.5
year 2016
month 04
day 14
svn rev 70478
language R
version.string R version 3.2.5 (2016-04-14)
nickname Very, Very Secure Dishes
but I tried installing ggplot2 through install.packages("ggplot2"), it worked. So I do not think this is a Mac OS system compatibility problem.
The manual indicates:
"SystemRequirements: zlib headers and library. OpenSSL headers and library. LibSSH2 (optional on non-Windows) to enable the SSH transport."
https://cran.r-project.org/web/packages/git2r/index.html
Are you perhaps missing zlib?
Hi, I have a similar issue. Zlib is a part of macOS. Here is my error code. Anyone a solution? Thanks! Sander
installing source package ‘git2r’ ...
package ‘git2r’ successfully unpacked and MD5 sums checked
checking build system type... x86_64-apple-darwin16.3.0
checking host system type... x86_64-apple-darwin16.3.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for brew... yes
checking for library containing inflate... no
configure: error: in
/private/var/folders/xk/dfj20kgd56xg8796xh874tjr0000gn/T/RtmpseXmyo/R.INSTALL32356e59fd77/git2r':
configure: error: The zlib library that is required to build git2r was not found.
Please install: zlib1g-dev (package on e.g. Debian and Ubuntu) zlib-devel (package on e.g. Fedora, CentOS and RHEL) and try again.
See `config.log' for more details ERROR: configuration failed for package ‘git2r’
The downloaded source packages are in ‘/private/var/folders/xk/dfj20kgd56xg8796xh874tjr0000gn/T/RtmpcfKZgy/downloaded_packages’ Warning messages: 1: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, : installation of package ‘gdsfmt’ had non-zero exit status 2: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, : installation of package ‘git2r’ had non-zero exit status`
Could you please try to install the binary format of git2r from CRAN.
Hi,
I just did. No effect. I get this error below. It has to do with the fact that R can't seem to find zlib... But than I don't understand what I should fill in in "INCLUDE_PATH" or how to find zlib even on Mac OS X Sierra.
Thanks!
Sander
install.packages("git2r") Installing package into ‘/usr/local/lib/R/3.3/site-library’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- HTTPS CRAN mirror
1: 0-Cloud [https] 2: Algeria [https]
3: Australia (Canberra) [https] 4: Australia (Melbourne) [https] 5: Australia (Perth) [https] 6: Austria [https]
7: Belgium (Ghent) [https] 8: Brazil (RJ) [https]
9: Brazil (SP 1) [https] 10: Bulgaria [https]
11: Canada (MB) [https] 12: Chile 1 [https]
13: Chile 2 [https] 14: China (Beijing) [https]
15: China (Hefei) [https] 16: China (Lanzhou) [https]
17: Colombia (Cali) [https] 18: Czech Republic [https]
19: Denmark [https] 20: France (Lyon 1) [https]
21: France (Lyon 2) [https] 22: France (Marseille) [https]
23: France (Montpellier) [https] 24: France (Paris 2) [https]
25: Germany (Falkenstein) [https] 26: Germany (Münster) [https]
27: Iceland [https] 28: India [https]
29: Ireland [https] 30: Italy (Padua) [https]
31: Japan (Tokyo) [https] 32: Malaysia [https]
33: Mexico (Mexico City) [https] 34: New Zealand [https]
35: Norway [https] 36: Philippines [https]
37: Russia (Moscow) [https] 38: Serbia [https]
39: Spain (A Coruña) [https] 40: Spain (Madrid) [https]
41: Sweden [https] 42: Switzerland [https]
43: Taiwan (Chungli) [https] 44: Turkey (Denizli) [https]
45: UK (Bristol) [https] 46: UK (Cambridge) [https]
47: UK (London 1) [https] 48: USA (CA 1) [https]
49: USA (IA) [https] 50: USA (IN) [https]
51: USA (KS) [https] 52: USA (MI 1) [https]
53: USA (TN) [https] 54: USA (TX) [https]
55: (HTTP mirrors)Selection: 55 HTTP CRAN mirror
1: 0-Cloud 2: Algeria
3: Argentina (La Plata) 4: Australia (Canberra)
5: Australia (Melbourne) 6: Austria
7: Belgium (Antwerp) 8: Belgium (Ghent)
9: Brazil (BA) 10: Brazil (PR)
11: Brazil (RJ) 12: Brazil (SP 1)
13: Brazil (SP 2) 14: Bulgaria
15: Canada (BC) 16: Canada (MB)
17: Canada (NS) 18: Canada (ON)
19: Chile 1 20: China (Beijing)
21: China (Hefei) 22: China (Lanzhou)
23: China (Xiamen) 24: Colombia (Cali)
25: Czech Republic 26: Denmark
27: Ecuador 28: El Salvador
29: Estonia 30: France (Lyon 2)
31: France (Marseille) 32: France (Montpellier)
33: France (Paris 1) 34: France (Paris 2)
35: Germany (Falkenstein) 36: Germany (Göttingen)
37: Germany (Münster) 38: Greece
39: Hungary 40: Iceland
41: India 42: Iran
43: Ireland 44: Italy (Milano)
45: Italy (Padua) 46: Italy (Palermo)
47: Japan (Tokyo) 48: Korea (Seoul 1)
49: Korea (Seoul 2) 50: Korea (Ulsan)
51: Lebanon 52: Malaysia
53: Mexico (Mexico City) 54: Mexico (Texcoco)
55: Netherlands (Amsterdam) 56: Netherlands (Utrecht)
57: New Zealand 58: Norway
59: Philippines 60: Portugal (Lisbon)
61: Portugal (Porto) 62: Russia (Moscow)
63: Singapore 64: South Africa (Cape Town)
65: South Africa (Johannesburg) 66: Spain (A Coruña)
67: Spain (Madrid) 68: Sweden
69: Switzerland 70: Taiwan (Chungli)
71: Taiwan (Taipei) 72: Thailand
73: Turkey (Denizli) 74: Turkey (Mersin)
75: UK (Bristol) 76: UK (Cambridge)
77: UK (London 1) 78: UK (London 2)
79: UK (St Andrews) 80: USA (CA 1)
81: USA (CA 2) 82: USA (IA)
83: USA (IN) 84: USA (KS)
85: USA (MI 1) 86: USA (MO)
87: USA (NC) 88: USA (OH 1)
89: USA (OH 2) 90: USA (OR)
91: USA (PA 1) 92: USA (PA 2)
93: USA (TN) 94: USA (TX)
95: VenezuelaSelection: 56 trying URL 'http://cran-mirror.cs.uu.nl/src/contrib/git2r_0.18.0.tar.gz' Content type 'application/x-gzip' length 1122935 bytes (1.1 MB)
downloaded 1.1 MB
installing source package ‘git2r’ ... ** package ‘git2r’ successfully unpacked and MD5 sums checked checking build system type... x86_64-apple-darwin16.4.0 checking host system type... x86_64-apple-darwin16.4.0 checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for brew... yes checking for library containing inflate... no configure: error: in `/private/var/folders/xk/dfj20kgd56xg8796xh874tjr0000gn/T/RtmpbVPTJk/R.INSTALLcd5c1f7fde2d/git2r': configure: error:
The zlib library that is required to build git2r was not found.
Please install: zlib1g-dev (package on e.g. Debian and Ubuntu) zlib-devel (package on e.g. Fedora, CentOS and RHEL) and try again.
If the zlib library is installed on your system but the git2r configuration is unable to find it, you can specify the include and lib path to zlib with: R CMD INSTALL --configure-args='--with-zlib-include=INCLUDE_PATH --with-zlib-lib=LIB_PATH' git2r
See `config.log' for more details ERROR: configuration failed for package ‘git2r’
- removing ‘/usr/local/lib/R/3.3/site-library/git2r’
The downloaded source packages are in ‘/private/var/folders/xk/dfj20kgd56xg8796xh874tjr0000gn/T/RtmpRNkU3D/downloaded_packages’ Warning message: In install.packages("git2r") : installation of package ‘git2r’ had non-zero exit status
According to the manual of install.package
, you should define that you want a binary install, otherwise it will install from source on your system. Do as follows:
install.packages("git2r", type = 'mac.binary.mavericks')
However, the package will be built for OSX Mavericks and you are using OSX Sierra; so I don't know if that will work.
Thank you for this comment!
On a new mac without the full developer setup, this command lets you install git2r
without needing zlib
or openssl
. This is perfect for new R users.
install.packages("git2r", type = 'mac.binary.mavericks')
Also works great on OSX Sierra.
maybe this will help: https://anaconda.org/r/r-git2r
Was wondering if any of these solutions (or that mentioned by https://github.com/IRkernel/IRkernel/issues/542) worked for R version 3.5.0?
I've tried installing devtools or git2r by install.packages("devtools")
or install.packages("git2r")
but neither are installing for me. When installing I get the aforementioned errors "...had non-zero exit status".
The error message I receive for installing git2r (either by
install.packages("git2r", type = 'mac.binary.elcapitan')
or
install.packages("git2r", type = 'mac.binary.mavericks')
is:
Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cran.revolutionanalytics.com/bin/macosx/elcapitan/contrib/3.5: cannot open URL 'https://cran.revolutionanalytics.com/bin/macosx/elcapitan/contrib/3.5/PACKAGES' package ‘git2r’ is available as a source package but not as a binary Warning message: package ‘git2r’ is not available (as a binary package for R version 3.5.0)`
So looks like version R 3.5.0 is not yet compatible? Any thoughts for work arounds for this?
You are mis-specifying 'el-capitan' as 'elcapitan'. Also, I could not resolve the host: "cran.revolution..." that you are using so you could try the r-studio host below:
install.packages("git2r",
repos = "https://cran.r-project.org",
type = "mac.binary.el-capitan")
Also, for future readers of this thread you can find the appropriate name of the binaries for various versions of OSX in the manual for install.packages
: http://stat.ethz.ch/R-manual/R-devel/library/utils/html/install.packages.html
Thanks @trosendal, that worked.
I am on high sierra 10.13.4. It does not work,some methods say R 3.5.1 is not supported others just say libgit2 is to blame, which is funny because git2r is needed for devtools, which is needed for tensorflow on R in mac. So no tensorflow on R in mac Sierra as of Sep 2018.
@devssh tensorflow does not depend on git2r
I was facing the same issue while trying to install devtools. I am on High Sierra Version 10.13.6.
The below steps led to successful installation of devtools.
install.packages("git2r", repos = "https://cran.r-project.org", type = "mac.binary.el-capitan")
install.packages("devtools")
Hopefully this will help others facing this problem.
@stewid I am using https://github.com/rstudio/tensorflow which is using devtools
. Devtools needs git2r and is the go to alternative approach for building from source if things are incompatible. using packages.install("tensorflow") does not work so i tried to install it via this tensorflow devtools alternate method. but cmake cannot build it on my configuration of Macos High Sierra 10.13.4 and R 3.5.1. You see High Sierra is backwards compatible with Sierra, but has at max support for Mavericks in this issue https://github.com/ropensci/git2r/issues/204 where I added my logs. Some people claim it is an issue with path configuration and permissions but those are being taken care of by anaconda3 pretty well usually, however I assume someone in this project would have better info on how to fix the paths.
@devssh does it work to install git2r using
install.packages('git2r', type='source', configure.vars='autobrew=yes')
Hi, I tried the command and it failed
install.packages('git2r', type='source', configure.vars='autobrew=yes')
trying URL 'https://cran.rstudio.com/src/contrib/git2r_0.23.0.tar.gz'
Content type 'application/x-gzip' length 1150314 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
* installing *source* package ‘git2r’ ...
** package ‘git2r’ successfully unpacked and MD5 sums checked
checking build system type... x86_64-apple-darwin17.5.0
checking host system type... x86_64-apple-darwin17.5.0
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/bf/vzp8t8p53xj53_nyf42t5g880000gp/T/RtmpFutTBQ/R.INSTALL639f7410bdc/git2r':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘git2r’
* removing ‘/Users/devashishsood/anaconda3/envs/py36/lib/R/library/git2r’
Warning in install.packages :
installation of package ‘git2r’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/bf/vzp8t8p53xj53_nyf42t5g880000gp/T/RtmpKHmr8L/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
How do I check this config.log
, it might give you more info, it says c compiler doesn't work ?
It says the error is C compiler cannot create executables
I also checked my gcc version
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@devssh It's not clear if you tried the suggestion by @souravbhabesh to install from the binary.
Hi @trosendal I tried the following as suggested by @souravbhabesh
install.packages("git2r",
repos = "https://cran.r-project.org",
type = "mac.binary.el-capitan")
install.packages("devtools")
and then when I do
library(devtools)
devtools::install_github("rstudio/tensorflow")
Rstudio crashes and restarts R session aborted. R encountered a fatal error. The session was terminated. Start new Session?
because I'm running an el-capitan binary on high sierra.
Also there is no binary for sierra.
install.packages("git2r",
+ repos = "https://cran.r-project.org",
+ type = "mac.binary.sierra")
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/bin/macosx/sierra/contrib/3.4:
cannot open URL 'https://cran.r-project.org/bin/macosx/sierra/contrib/3.4/PACKAGES'
package ‘git2r’ is available as a source package but not as a binary
Warning in install.packages :
package ‘git2r’ is not available (as a binary package for R version 3.4.3)
@souravbhabesh you said you were on high sierra? Which version of R are you using? How did you check that it works? Its interesting to note that library(devtools)
does not cause a restart but using devtools crashes Rstudio.
I will also try updating Macos from 10.13.4 to 10.13.6. My R version is 3.5.1
El-capitan was released in 2015 and Sierra has breaking changes wrt backward compatibility. I don't think a binary from el-capitan would work on sierra! How did you make it work?!
brew install libgit2 on mac first
I've tried install lbgit2, zlib, openssl, devtools and cannot seem to get git2r version 0.23.0 installed on monterey intel chip or M1 :-(