Since installing R 4.3.1 and RStudio 2023.06.2+561 on my MacBook Pro running Big Sur (11.7.8), I am having a lot of trouble installing any packages from Github - i.e. I am having trouble compiling things (although not everything). I have tried pretty much everything including altering my Makevars file in .R, installing a new version of gcc from Homebrew, installing Xcode Developer tools, deleting the Makevars file to see if that helps, but to no avail. I think this message may be informative:
** libs
using C compiler: ‘Apple clang version 13.0.0 (clang-1300.0.29.30)’
using C++ compiler: ‘Apple clang version 13.0.0 (clang-1300.0.29.30)’
using C++11
using SDK: ‘’
This suggests that maybe the SDK headers are missing? I don’t know. Does anyone have a quick fix for me? Last time this happened I spent hours fruitlessly typing things into Terminal and then worked out that just installing a newer version of R would fix it. Sadly that has not worked this time. Updating my operating system seems a radical step but I am willing to take it if nothing else works - but worried that will break something else.
What are some of the github packages that you are having trouble with?
BTW: with the upcoming release of Sonoma, Big Sur will drop off the list of supported versions for RStudio, which follows the Apple support schedule of the current and two most recent versions.
Thanks - specifically gganimate at the moment (I came to this problem because I was trying to install the developer version of gganimate to overcome a bug that seems to have arisen in the latest CRAN version). In trying this, it also attempts to install transformr and tweenr from Github, which also fails. I don't know if this string of warnings is informative:
* installing *source* package ‘tweenr’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 13.0.0 (clang-1300.0.29.30)’
using C++ compiler: ‘Apple clang version 13.0.0 (clang-1300.0.29.30)’
using C++11
using SDK: ‘’
clang++ -arch x86_64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include' -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c along.cpp -o along.o
In file included from along.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/doubles.hpp:9:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/as.hpp:3:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:327:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:742:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from along.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/doubles.hpp:9:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/as.hpp:3:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:328:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:771:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from along.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/doubles.hpp:9:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/as.hpp:3:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
13 errors generated.
make: *** [along.o] Error 1
ERROR: compilation failed for package ‘tweenr’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/tweenr’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/tweenr’
..but it suggests that there is something wrong with the XCode Developer Tools version of C++. At least I think so?
Aha, I see that your clang++ version is quite different from mine! After the "using SDK" line I get:
clang++ -arch x86_64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include' -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c along.cpp -o along.o
In file included from along.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/doubles.hpp:9:
In file included from /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/cpp11/include/cpp11/as.hpp:3:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
So that seems to be where the error is occurring? Everything is the same until "in file included"
EDIT: I think it may be the architecture that is making the difference! I can see you have a newer version of clang with your newer architecture.
You should not need a Makevars file, and you definitely do not need compilers from brew. In fact it it best to delete the ~/.R/Makevars file, and also the compilers from brew.
If you got rid of these and the installation still does not work, please show us the complete input and output, including the commands you run, and the full output. Thanks.
Thanks for your reply! What has actually worked for me is upgrading my operating system to Ventura. I’m not really sure why this worked, but it did.
Hope this helps others. I also reinstalled R, XQuartz and gfortran as suggested on the CRAN site. Now to proceed with getting gganimate to work properly again.