problem installing exactextract package

Error Information:

[kupferd@rl01-int-p .R]$ R CMD INSTALL exactextractr_0.1.0.tar.gz

  • installing to library ‘/home/kupferd/R/library’
  • installing source package ‘exactextractr’ ...
    ** package ‘exactextractr’ successfully unpacked and MD5 sums checked
    ** using staged installation
    configure: exactextractr: 0.1.0
    checking for geos-config... /usr/bin/geos-config
    checking geos-config usability... yes
    configure: GEOS version: 3.5.0
    checking geos version at least 3.6.0... no
    Upgrade GEOS to version 3.6.0 or greater.
    checking compiling and building against geos_c... yes
    configure: PKG_CXX: g++
    configure: PKG_CXXFLAGS: -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include
    configure: PKG_LIBS: -Wl,-z,relro -L/usr/lib64 -lgeos_c
    configure: creating ./config.status
    config.status: creating src/Makevars
    ** libs
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RcppExports.cpp -o RcppExports.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exact_extract.cpp -o exact_extract.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/area.cpp -o exactextract/src/area.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/box.cpp -o exactextract/src/box.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/cell.cpp -o exactextract/src/cell.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/coordinate.cpp -o exactextract/src/coordinate.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/floodfill.cpp -o exactextract/src/floodfill.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/geos_utils.cpp -o exactextract/src/geos_utils.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/grid.cpp -o exactextract/src/grid.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/perimeter_distance.cpp -o exactextract/src/perimeter_distance.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -L/opt/rh/devtoolset-7/root/usr/lib64 -I"/home/kupferd/R/library/Rcpp/include" -I/usr/local/include -O3 -std=c++11 -march=native -mtune=native -fPIC -I/usr/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c exactextract/src/raster_cell_intersection.cpp -o exactextract/src/raster_cell_intersection.o
    In file included from exactextract/src/floodfill.cpp:18:0:
    exactextract/src/grid.h: In function ‘exactextract::Gridexactextract::bounded_extent exactextract::common_grid(T, T)’:
    exactextract/src/grid.h:338:26: error: parameter declared ‘auto’
    (auto& acc, auto& op) {
    exactextract/src/grid.h:338:37: error: parameter declared ‘auto’
    (auto& acc, auto& op) {

    exactextract/src/raster_stats.h:214:68: note: candidate expects 0 arguments, 2 provided
    make: *** [exact_extract.o] Error 1
    ERROR: compilation failed for package ‘exactextractr’
  • removing ‘/home/kupferd/R/library/exactextractr’

Description of issue -
Trying to install exactextractr package but I get an error which I think is related to the g++ version I am using or some compatibility issue. As far as I know the problem should be resolved by enabling c++11 compatibility, but that dit not work for me.

Steps taken so far -
I have tried different version of gcc and devtoolsets.
Here is my Makevars:
CXX14FLAGS=-O3 -std=c++11 -march=native -mtune=native -fPIC

System Information:

  • RStudio Edition: (Server)
  • RStudio Version: 1.1.383
  • OS Version: Redhat 7.7
  • R Version: 3.6


  • Your sessionInfo():

R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.7 (Maipo)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/


attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_3.6.0

From Troubleshooting Guide: Using RStudio

Hi, and welcome!

I just installed on vanilla Ubuntu 19.10 with


Not required here, but for any coding questions to the community, please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers.

Hello technocrat,
I solved my problem. The problem was that I used '-std=c++11'. When I changed it to 'c++14' the compilation went well. So in my Makevars I have this now:

CXX14FLAGS=-O3 -std=c++14 -march=native -mtune=native -fPIC

My google attempts did not produce any clear results on this.


If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

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