I've recently been having problems with compiling packages for R. I'm not sure of the causes but one possibility is that there are a couple of different versions of gcc on my MacBook Pro. When I type which gcc
in a terminal window it returns /usr/bin/gcc
. But when I type gcc --version I get back
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I may also have some issues with the path. It is currently set to
/usr/local/sbin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/usr/local/bin:/usr/bin:/bin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/git/bin
I added the Applications... path to PATH hoping it would help but it didn't. /usr/bin contains both a g++ and gcc file install May 18, so very recently. I've tried renaming those as a test of whether that would solve the problem but I'm unable to do that even as sudo.
Suggestions greatly appreciated!
brew formula R
and it will show that "gcc" is required for gfortran - so the simplest way to install R is by usingbrew install R
which will install all required dependences. Brew compiles from sources directly on your computer.