Error: Could Not Find Build Tools Necessary to Build Dplyr

Error: Could not find build tools necessary to build dplyr

You can go to this address to download and install a newer version of Command Line Tools as well as XCode as mentioned by @alistaire, but the one you have is fine.

By the message you posted, it suggests a linkage problem. You want to create a symlink for the readline lib. Homebrew does this for us, but for some reason it didn't; so you may be able to solve this by creating the link manually with --force option as:

brew link readline --force

Install with devtools::install_github() fails to detect build tools

Looks like there are a few issues that you need to overcome to install this package (xcode command line tools and OpenMP support for a start), but you should overcome them if you follow the instructions here: https://stackoverflow.com/a/65334247/12957340

After making the necessary changes, I successfully installed gsynth on my system (macOS Big Sur 11.2.3 / R version 4.0.3) using devtools::install_github('xuyiqing/gsynth') without issue.

--

Here are the instructions in case the link above dies:

  1. Reinstall xcode command line tools (even if it says "up to date")
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

  1. Install gcc & llvm via Homebrew (instructions for installing Homebrew) or, if you already have gcc/llvm installed via Homebrew, skip to the next step
# This can take several hours
brew install gcc
brew install llvm

  1. Once you have gcc & llvm installed via Homebrew:
brew cleanup
brew update
brew upgrade
brew reinstall gcc
brew reinstall llvm

  1. Link some headers into /usr/local/include
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

# You can safely ignore warnings like this:
#ln: /usr/local/include//tcl.h: File exists
#ln: /usr/local/include//tclDecls.h: File exists
#ln: /usr/local/include//tclPlatDecls.h: File exists
#ln: /usr/local/include//tclTomMath.h: File exists
#ln: /usr/local/include//tclTomMathDecls.h: File exists
#ln: /usr/local/include//tk.h: File exists
#ln: /usr/local/include//tkDecls.h: File exists
#ln: /usr/local/include//tkPlatDecls.h: File exists

  1. Create a new ~/.R/Makevars file (if you already have a ~/.R/Makevars file, save it in a different directory (away from ~/.R/)) and include only these lines in the file:
FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
CXX1X=/usr/local/gfortran/bin/g++
CXX98=/usr/local/gfortran/bin/g++
CXX11=/usr/local/gfortran/bin/g++
CXX14=/usr/local/gfortran/bin/g++
CXX17=/usr/local/gfortran/bin/g++

LLVM_LOC = /usr/local/opt/llvm
CC=/usr/local/gfortran/bin/gcc -fopenmp
CXX=/usr/local/gfortran/bin/g++ -fopenmp
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L/usr/local/opt/gettext/lib -L$(LLVM_LOC)/lib -Wl,-rpath,$(LLVM_LOC)/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I$(LLVM_LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

  1. Compile a package from source in R/Rstudio
# To check whether openmp is enabled, compile data.table:
install.packages("data.table", type = "source")

  1. If your package fails to compile, a couple of SO users have had to install a fresh gfortran (re: https://stackoverflow.com/a/65334247/12957340), which you can download from https://github.com/fxcoudert/gfortran-for-macOS/releases/tag/10.2-bigsur-intel

R: make not found when installing a R-package from local tar.gz

what do you need is to update the Rtool, here is the link I had the same issue before once you update it will work.

DLL not found' when building my own R package

Posting because I lost half a day on this ^^'

I had a similar issue because I removed all my c++ code.
However, I had remove the Rcpp import/dpends in my DESCRIPTION file, but that just added the error of a missing dependency in that file...
After finding this page, I grep "Rcpp" to see where the hell it was left in and realized that I still had the [packagename]-package.Rfile ^^' which contained:

## usethis namespace: start
#' @importFrom Rcpp sourceCpp
#' @useDynLib [packagename], .registration = TRUE
## usethis namespace: end
NULL

So yeah, if you don't have c++ code/removed it, make sure your package structure matches ^^'

Error when plotting sf object --- Error: could not find function geom_sf

While running R as the administrator, reinstall ggplot2 like this:

devtools::install_github("tidyverse/ggplot2")
require(ggplot2)

You should be able to see it now with ?geom_sf

For questions related to using devtools, see this SO answer.



Related Topics



Leave a reply



Submit