I don't have /usr/local/lib/gcc/x86_64-apple-darwin13.0.0, so it makes sense that it can't be found. I have /usr/local/lib/gcc/i686-apple-darwin11 and /usr/local/lib/gcc/4.8 (symlink to Homebrew installation). Where is it getting x86_64-apple-darwin13.0.0 from?

There are a lot of references to a similar error online. However, all of them are related to compiling in Xcode and resolved by updating project settings, which is not applicable here.

Homebrew installations are not supported by "official R Core". There is a Fortran package at r.research.att.com but I think it might have static linking with the "authorized" version that ends up in the Frameworks tree. I'm not an expert in this area and there are some users of SO (thinking of @hrbrmstr) that think homebrew is "just fine". Do a search on "user:1457051 homebrew" and see if you find more support than I offer.
– 42-Mar 15 '16 at 0:14

I have gcc installed via homebrew and I've created a Makevars file but I keep having issues, primarily because I have a newer version of gcc. I changed the last line to FLIBS=-L/usr/local/Cellar/gcc/7.3.0_1/lib/gcc/7 and then the first line to VER=-7.3.0_1 (which caused problems until I changed it to VER=-7). That might've actually worked for compiling one R package but now for some reason the default compiler remains as clang, I'm not sure why... Have any ideas??
– Steve SMar 22 '18 at 17:31

1

Need to set the implicit variables CXX11, CXX14, and CXX17 to use g++$(VER) just like CXX does. These define the compiler that should be used for each language standard. e.g. CXX11 is the C++11 standard.
– coatlessMar 23 '18 at 18:24

Thank you very much for your response--I really do appreciate it. Now it appears that I'm able to compile some packages with no problem and then when other packages fail to compile I end up just commenting out the Makevars file entirely so that my system uses clang instead, which seems to mostly fix the issue. Is that sort of ad hoc approach normal??
– Steve SApr 25 '18 at 14:01