I am trying to install the ´ggtext´ package in R 3.6.0 which has a dependency on another package called ´gridtext´. After running install.packages("ggtext") I get the error:
grid-renderer.h:61:94: error: no matching function for call to ‘Rcpp::Vector<10, Rcpp::PreserveStorage>::Vector(int, bool&, const GraphicsContext&)’
Trying to install from github results in the same problem. I am trying to do this in a server running CentOS Linux release 7.7.1908.
More detailed error message:
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I"/home/myuser/R/x86_64-redhat-linux-gnu-library/3.6/Rcpp/include" -I"/home/myuser/R/x86_64-redhat-linux-gnu-library/3.6/testthat/include" -I/usr/local
/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
In file included from gridtext_types.h:12:0,
from RcppExports.cpp:4:
grid-renderer.h: In member function ‘void GridRenderer::raster(Rcpp::RObject, Length, Length, Length, Length, bool, const GraphicsContext&)’:
grid-renderer.h:61:94: error: no matching function for call to ‘Rcpp::Vector<10, Rcpp::PreserveStorage>::Vector(int, bool&, const GraphicsContext&)’
NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
EDIT:
trying install.packages("gridtext", dep = TRUE) results in the following error:
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcairo -lfreetype
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find Cairo or Freetype2. Try installing:
* deb: libcairo2-dev (Debian, Ubuntu)
* rpm: cairo-devel (Fedora, CentOS, RHEL)
* csw: libcairo_dev (Solaris)
* brew: cairo (OSX)
If cairo freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a cairo freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
---------------------------[ ERROR MESSAGE ]----------------------------
src/tests/sysdeps.c:1:10: fatal error: cairo-ft.h: No such file or directory
#include <cairo-ft.h>
^~~~~~~~~~~~
compilation terminated.
------------------------------------------------------------------------
ERROR: configuration failed for package ‘gdtools’
* removing ‘/home/miguel/R/x86_64-redhat-linux-gnu-library/3.6/gdtools’
ERROR: dependency ‘gdtools’ is not available for package ‘vdiffr’
* removing ‘/home/miguel/R/x86_64-redhat-linux-gnu-library/3.6/vdiffr’
The downloaded source packages are in
‘/tmp/RtmpszdI5c/downloaded_packages’
Warning messages:
1: In install.packages("gridtext", dep = TRUE) :
installation of package ‘gridtext’ had non-zero exit status
2: In install.packages("gridtext", dep = TRUE) :
installation of package ‘gdtools’ had non-zero exit status
3: In install.packages("gridtext", dep = TRUE) :
installation of package ‘vdiffr’ had non-zero exit status
> install.packages('ggext', dep=TRUE)
EDIT
Update after doing sudo yum install cairo-devel
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I"/home/miguel/R/x86_64-redh
at-linux-gnu-library/3.6/Rcpp/include" -I"/home/miguel/R/x86_64-redhat-linux-gnu
-library/3.6/testthat/include" -I/usr/local/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 RcppEx
ports.o
In file included from gridtext_types.h:12:0,
from RcppExports.cpp:4:
grid-renderer.h: In member function ‘void GridRenderer::raster(Rcpp::RObject, Le
ngth, Length, Length, Length, bool, const GraphicsContext&)’:
grid-renderer.h:61:94: error: no matching function for call to ‘Rcpp::Vector<10,
Rcpp::PreserveStorage>::Vector(int, bool&, const GraphicsContext&)’
icVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)