Closed jphill01 closed 2 years ago
I think this is a bad interaction between RStudio's detection and your system.
Try not installing the build tools in RStudio, open a separate terminal window, install the build tools there and then open R in that same window and run pkgbuild::check_build_tools(debug = TRUE)
and see if it works.
I use macOS Big Sur 11.4 myself and do not see this issue, so I am confident this is not a general problem with RStudio and pkgbuild but something specific to your current configuration.
Nonetheless I would like to help you resolve it if possible.
Hi Jim,
I'm unsure on how exactly to install the additional build tools from the terminal. Is there a specific block of commands that needs to be executed? Could you walk me through it?
Thanks.
Jarrett
After doing some reading online, it seems that macOS Big Sur and clang are not friends and it is advised to alter the Makevars file within the .R folder to enable gcc/g++.
I am working though this document
http://yiqingxu.org/public/BigSurError.pdf
Currently, my Makevars look like
# The following statements are required to use the clang4 binary
CC=/usr/local/clang4/bin/clang
CXX=/usr/local/clang4/bin/clang++
CXX1X=/usr/local/clang4/bin/clang++
CXX98=/usr/local/clang4/bin/clang++
CXX11=/usr/local/clang4/bin/clang++
CXX14=/usr/local/clang4/bin/clang++
CXX17=/usr/local/clang4/bin/clang++
LDFLAGS=-L/usr/local/clang4/lib
# End clang4 inclusion statements
I am thinking to change the above to rely on gcc/g++ instead.
Since you peraonally use Big Sur, what compiler do you rely upon (clang or gcc/g++)?
The default apple compiler is clang, it works perfectly fine for R packages. If you have everything installed correctly you don't need anything in your personal or site makevars. Also just putting g++
or gcc
in your Makevars does not use GCC, by default clang is what is called by g++
e.g.
> g++ --version
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 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Are you / they using homebrew R? If so, uninstall it and install the cask, e.g.
brew install --cask r
No. I'm not using Homebrew R, but I do have Homebrew installed:
Jarretts-MacBook-Pro-3:~ jarrettphillips$ brew config
HOMEBREW_VERSION: 3.2.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 09f7bc27a99469cf947431df4754737dfbadb31d
Last commit: 2 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: b1c76d0f6e481ae009775f96f89c6cd1c635822d
Core tap last commit: 3 days ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.syQHtikHlQ/org.macosforge.xquartz:0
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: quad-core 64-bit broadwell
Clang: 12.0.5 build 1205
Git: 2.10.1 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Not sure how else to proceed here, but I do appreciate the help.
UPDATE #1
I did manage to bypass the prompt to build additional tools in R with
options(buildtools.check = function(action) TRUE )
for debugging purposes. I now get a bunch of errors when calling
devtools::build()
on my package.
It's long, but here is what I get
ERROR: package installation failed Error in (function (command = NULL, args = character(), error_on_status = TRUE, : System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines): E> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:650:17: error: no template named 'numeric_limits' E> static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix"); E> ^ E> fatal error: too many errors emitted, stopping now [-ferror-limit=] E> 20 errors generated. E> make: ** [RcppExports.o] Error 1 E> ERROR: compilation failed for package ‘HACSim’ E> removing ‘/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpKH90nC/Rinst9cc48afc544/HACSim’ E> ----------------------------------- E> ERROR: package installation failed Type .Last.error.trace to see where the error occurred
I now suspect something deeper is going on here, but it seems we're closer to resolving things. Specifically, this looks like a problem with Rcpp interacting with Big Sur.
UPDATE #2
I've made some more progress from downloading and running the following in the terminal:
https://github.com/rmacoslib/r-macos-rtools/releases/tag/v4.0.0
which was based on a response from this SO post:
Once this was done, I checked Homebrew again. Interestingly, CLT (and other info) is now visible.
Jarretts-MacBook-Pro-3:~ jarrettphillips$ brew config HOMEBREW_VERSION: 3.2.0 ORIGIN: https://github.com/Homebrew/brew HEAD: 09f7bc27a99469cf947431df4754737dfbadb31d Last commit: 3 weeks ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: b1c76d0f6e481ae009775f96f89c6cd1c635822d Core tap last commit: 5 days ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.syQHtikHlQ/org.macosforge.xquartz:0 HOMEBREW_MAKE_JOBS: 4 Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: quad-core 64-bit broadwell Clang: 12.0.5 build 1205 Git: 2.10.1 => /usr/local/bin/git Curl: 7.64.1 => /usr/bin/curl macOS: 11.4-x86_64 CLT: 12.5.1.0.1.1623191612 Xcode: 12.5.1 XQuartz: 2.7.11 => /opt/X11
However, I'm still prompted to build additional R tools when I run devtools::build().
Any ideas?
This seems like a duplicate of #103 to me.
After recently upgrading to macOS Big Sur 11.4, I'm having issues building and installing my R package from source, which relies on compiled code via both Rcpp and RcppAramadillo.
I've upgraded to R 4.1.0 and RStudio 1.4.1717. I have also updated to Xcode 12.5.1 (12E507).
Command line tools is installed, as well as functionality for OpenMP.
Each time I run pkgbuild::build() (or equivalently devtools::build() followed by devtools::install()), I am prompted to install additional build tools.
When I click "Yes", R gives the error
When I call pkgbuild::check_build_tools(debug = TRUE) nothing happens.
I followed instructions in this SO post:
https://stackoverflow.com/questions/65251887/clang-7-error-linker-command-failed-with-exit-code-1-for-macos-big-sur/65334247#65334247
but the issue is still unresolved.
Is this a legitimate bug? How should I go about resolving my issue?
Thanks!