0

I just finished re-installing both Xcode and CLT on my Mac running Big Sur 11.4. I'm working in RStudio Version 1.4.1717 with R 4.1.1

I then ran devtools::has_devel() to ensure things were installed properly and they weren't. I received the message

Error: Could not find tools necessary to compile a package

Call pkgbuild::check_build_tools(debug = TRUE) to diagnose the problem.

To fix the problem, I deleted my Makevars and now everything is OK.

Your system is ready to build packages!

However, upon attempting to build(), compilation fails and R throws several errors.

Here is one such error

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/Mac  OSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global   namespace
using ::signbit;
      ~~^

It seems that Rcpp is not being recognized? Maybe the C++ headers...

I found this SO post, but it concerns Mac OS Catalina: Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace

Any thoughts on how to solve?

user20650
  • 24,654
  • 5
  • 56
  • 91
compbiostats
  • 909
  • 7
  • 22
  • I suspect you simply didn't follow the (sadly somewhat manual) installation steps for macOS. Try for example this post https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/ -- but I am not sure if it is the most current. If in doubt, try the r-sig-mac list. Rcpp tests fine at CRAN (and many other places) on properly configured systems. – Dirk Eddelbuettel Jan 25 '22 at 21:43
  • 1
    Thanks. Actually, I followed that link (and should have mentioned so). However, I will try again and if issues persist, will reach out to r-sig-mac list. – compbiostats Jan 25 '22 at 22:03
  • I recommend building up from the inside. Get Rcpp, and tools installed. The try `Rcpp::evalCpp("2+2")`; if you see the expected answer you have that right. On for `gfortran` (if you need it), other libraries, ... You can generally trust existing CRAN packages which should build at your end too. – Dirk Eddelbuettel Jan 25 '22 at 22:07

0 Answers0