Impossible to install package, compilation error ?

Hello,

For a few days now, I've been trying install new packages in RStudio. It used to work but stopped and I can't figure out why.

It always fails, I've tried a few different packages : extRemes, evd and others too.

Here is what I read on the console when I try :

install.packages("evd",dependencies = T)
also installing the dependencies ‘sp’, ‘akima’

[dowloading sources from weblinks...]

  • installing source package ‘sp’ ...
    ** package ‘sp’ correctement décompressé et sommes MD5 vérifiées
    ** using staged installation
    ** libs
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c Rcentroid.c -o Rcentroid.o
    /bin/sh: x86_64-apple-darwin13.4.0-clang: command not found
    make: *** [Rcentroid.o] Error 127
    ERROR: compilation failed for package ‘sp’
  • removing ‘/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/library/sp’
    Warning in install.packages :
    installation of package ‘sp’ had non-zero exit status

and then the rest fails because the dependencies are not installed.

Does anyone have an idea ?

I do not know why it is happening but
ERROR: compilation failed for package ‘sp’ seems to be a problem.

Have you tried install.packages("sp") either within RStudio or at command-line level?

That was my guess too.

The code I shared is from RStudio console. I tried both with RStudio writing the line by itself, or writing it myself.

The dependency parameter does not have an impact, my problem is the same with or without it being set to True.
The only difference is when dependency=T, R wants to load more packages. But the first one always fails and the others fails due to missing dependencies.

As suggested, I tried manual installation of the first dependency. Here is the resulting prompt :

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

install.packages("sp")
trying URL 'https://cran.rstudio.com/src/contrib/sp_1.4-2.tar.gz'
Content type 'application/x-gzip' length 1135318 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

  • installing source package ‘sp’ ...
    ** package ‘sp’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c Rcentroid.c -o Rcentroid.o
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c gcdist.c -o gcdist.o
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c init.c -o init.o
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c pip.c -o pip.o
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c pip2.c -o pip2.o
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c sp_xports.c -o sp_xports.o
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c surfaceArea.c -o surfaceArea.o
    x86_64-apple-darwin13.4.0-clang -I"/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/include" -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -I/Users/julesboulard/opt/anaconda3/envs/Renv/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/julesboulard/opt/anaconda3/envs/Renv/include -fdebug-prefix-map=/usr/local/miniconda/conda-bld/r-base_1587480508710/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/Users/julesboulard/opt/anaconda3/envs/Renv=/usr/local/src/conda-prefix -c zerodist.c -o zerodist.o
    x86_64-apple-darwin13.4.0-clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/lib -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/julesboulard/opt/anaconda3/envs/Renv/lib -L/Users/julesboulard/opt/anaconda3/envs/Renv/lib -o sp.dylib Rcentroid.o gcdist.o init.o pip.o pip2.o sp_xports.o surfaceArea.o zerodist.o -L/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/lib -lR -Wl,-framework -Wl,CoreFoundation
    ld: unknown option: -platform_version
    clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/share/make/shlib.mk:6: sp.dylib] Error 1
    ERROR: compilation failed for package ‘sp’
  • removing ‘/Users/julesboulard/opt/anaconda3/envs/Renv/lib/R/library/sp’
    Warning in install.packages :
    installation of package ‘sp’ had non-zero exit status

What is your OS?

This is getting well past my knowledge level but the message Id: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

may be suggesting it is as OS problem.

On the other hand R version 3.6.3 is just a bit out of date. I am running
R version 4.0.1 (2020-06-06)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS

and I see that "sp" is installed and seems to load so perhaps you should consider an upgrading to 4.0.1?

Sorry I cannot be of more help.

I'm running R on a MacOS 10.15.5.

As I created this new Renvironment just 2 month ago using anaconda and updated it with conda update, I'm surprised to have an outdated R version.

How should I install the latest version ?

It is not a problem for the 'sp' package only, every package I tried gave me the same result...

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.