0

I have been trying to install dplyr version 1.0.10 on R because I'm having problems with the current version (1.1.0) (there's some sort of error with the mfdb function mfdb_dplyr_prey).

I tried:

> url_dplyr_1.0.10 <- "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_1.0.10.tar.gz"
> install.packages(url_dplyr_1.0.10,repos=NULL,type="source")

And I get:

trying URL 'https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_1.0.10.tar.gz'
Content type 'application/x-gzip' length 884984 bytes (864 KB)
==================================================
downloaded 864 KB

* installing *source* package ‘dplyr’ ...
** package ‘dplyr’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -O3 -march=native -c chop.cpp -o chop.o
clang: error: the clang compiler does not support '-march=native'
make: *** [chop.o] Error 1
ERROR: compilation failed for package ‘dplyr’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/dplyr’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/dplyr’
Warning in install.packages :
  installation of package ‘/var/folders/zj/1863w5hj19vbt381ctytbhx00000gn/T//RtmpwaPvih/downloaded_packages/dplyr_1.0.10.tar.gz’ had non-zero exit status```

My sessionInfo():

> sessionInfo()
 R version 4.2.2 (2022-10-31)
 Platform: aarch64-apple-darwin20 (64-bit)
 Running under: macOS Monterey 12.6.3
 
 Matrix products: default
 
 LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
 locale:
 [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
 
 attached base packages:
 [1] stats     graphics  grDevices utils     datasets  methods   base     
 
 other attached packages:
 [1] rstudioapi_0.14 ggplot2_3.4.0   mfdb_7.3-1      dplyr_1.1.0
r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 2
    Have a look at `remotes::install_version` – stefan Feb 13 '23 at 11:28
  • I tried it already and I get the following output: ``` > remotes::install_version("dplyr",version="1.0.10") Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/dplyr/dplyr_1.0.10.tar.gz Error: Failed to install 'unknown package' from URL: Could not find tools necessary to compile a package Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem. ``` – williantafsilva Feb 13 '23 at 11:42
  • 1
    Can you tell me what you used to copy code into this question? I'm seeing a lot of questions being posted with backslashes in them, and it's broken. I'm editing your question to replace `\<-` with `<-`, but this surge in recent questions suggests a "common practice" has a bug. – r2evans Feb 13 '23 at 13:38
  • For your *"Could not find tools necessary to compile a package"* error, a [google search](https://www.google.com/search?q="macos"+"r"+"Could+not+find+tools+necessary+to+compile+a+package") for that suggests https://stackoverflow.com/q/66359031/3358272. I'm confident there are other discussions, mostly centered on (I believe) needing xcode to install clang or more, and/or verifying they are in your `PATH` (OS level). – r2evans Feb 13 '23 at 13:41

1 Answers1

0

You could try installing the package with the flag turned off:

  • Download source package from CRAN and extract
url_dplyr_1.0.10 <- "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_1.0.10.tar.gz"
tar -xzvf dplyr_1.0.10.tar.gz
  • Open src/Makevars file in a text editor and comment out the line that includes -march=native
  • Save and install
R CMD INSTALL dplyr_1.0.10.tar.gz
simon
  • 1
  • 1