Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: compilation failed for package ‘gridtext’ #22

Open
jmw86069 opened this issue Dec 13, 2021 · 9 comments
Open

ERROR: compilation failed for package ‘gridtext’ #22

jmw86069 opened this issue Dec 13, 2021 · 9 comments

Comments

@jmw86069
Copy link

This issue is related to #7 and #11, and I think happened sometime between version 0.1.1 and current released version 0.1.4.

I was previously able to install version 0.1.1 without problem on CentOS 7.8 for R-3.6.1.
Today recently I was not able to install version 0.1.4 on R-4.1.0, nor R-3.6.1.

I have GCC-4.8.5 which is reported to provide support for C++11:
https://gcc.gnu.org/gcc-4.8/cxx0x_status.html

C++11 was released 2014, however it appears the issue is tied to a specific version requirement for libstdc++.so.6.0.20 or higher. (I can't verify that version works, but I did try.)
It looks like that version is associated with GCC-4.9 in 2016.
https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html

The solution in #11 was to install CentOS devtoolset-9 which was released November 2019.

I really love gridtext/ggtext as it does provide brilliant capability and looks fantastic in data visualizations.
The issue for me, I don't want to include an R package dependency that is a problem for me to install.
I'm more tech-forgiving and persistent than most, I don't want my package to fail at the install step.

So my options are:

  1. do not include gridtext/ggtext in Depends - only Suggests. Then I need to write optional use of gridtext/ggtext.
  2. implore you to revisit whatever changes broke support for g++ version 4.8.5. :)

I'll post my compile errors in case they help.

@jmw86069
Copy link
Author

I admit, my cursory review of the commit history didn't turn up anything "obvious" - but I also have no idea what I'm looking for! Haha. Maybe something in the error message below could give you an idea?

Oddly enough, my existing installed gridtext version 0.1.1 is linked to libstdc++.so.6 which points to libstdc++.so.6.0.19 - suggesting that this version was high enough to be functional at some point. I'm not sure why it wouldn't be now? The .cpp code hasn't changed much since then. Ah well.

install.packages("gridtext")

Output from install.packages("gridtext"), click to expand
* installing *source* package 'gridtext' ...
** package 'gridtext' successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/opt/biotools/R361/lib64/R/include" -DNDEBUG  -I"/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I/usr/local/include  -fpic  -g -O2  -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)
                                                                                              ^
grid-renderer.h:61:94: note: candidates are:
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:241:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(std::initializer_list<typename Rcpp::traits::init_type<RTYPE>::type>) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage; typename Rcpp::traits::init_type<RTYPE>::type = bool]
     Vector( std::initializer_list<init_type> list ) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:241:5: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:233:5: note: template<class InputIterator, class Func, class T> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(InputIterator, InputIterator, Func, T, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( InputIterator first, InputIterator last, Func func, T n,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:233:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   deduced conflicting types for parameter 'InputIterator' ('int' and 'bool')
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:226:5: note: template<class InputIterator, class Func> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(InputIterator, InputIterator, Func)
     Vector( InputIterator first, InputIterator last, Func func) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:226:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   deduced conflicting types for parameter 'InputIterator' ('int' and 'bool')
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:218:5: note: template<class InputIterator, class T> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(InputIterator, InputIterator, T, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( InputIterator first, InputIterator last, T n,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:218:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   deduced conflicting types for parameter 'InputIterator' ('int' and 'bool')
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:211:5: note: template<class InputIterator> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(InputIterator, InputIterator)
     Vector( InputIterator first, InputIterator last){
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:211:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   deduced conflicting types for parameter 'InputIterator' ('int' and 'bool')
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:202:5: note: template<class T, class U1, class U2, class U3> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const T&, Rcpp::Vector<RTYPE, StoragePolicy>::stored_type (*)(U1, U2, U3), const U1&, const U2&, const U3&, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( const T& siz, stored_type (*gen)(U1,U2,U3), const U1& u1, const U2& u2, const U3& u3,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:202:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'Rcpp::Vector<10, Rcpp::PreserveStorage>::stored_type (*)(U1, U2, U3)' and 'bool'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:193:5: note: template<class T, class U1, class U2> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const T&, Rcpp::Vector<RTYPE, StoragePolicy>::stored_type (*)(U1, U2), const U1&, const U2&, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( const T& siz, stored_type (*gen)(U1,U2), const U1& u1, const U2& u2,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:193:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'Rcpp::Vector<10, Rcpp::PreserveStorage>::stored_type (*)(U1, U2)' and 'bool'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:184:5: note: template<class T, class U1> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const T&, Rcpp::Vector<RTYPE, StoragePolicy>::stored_type (*)(U1), const U1&, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( const T& siz, stored_type (*gen)(U1), const U1& u1,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:184:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'Rcpp::Vector<10, Rcpp::PreserveStorage>::stored_type (*)(U1)' and 'bool'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:177:5: note: template<bool NA, class T> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const Rcpp::sugar::SingleLogicalResult<NA, T>&)
     Vector( const sugar::SingleLogicalResult<NA,T>& obj ) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:177:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'const Rcpp::sugar::SingleLogicalResult<NA, T>' and 'int'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:169:5: note: template<class T, class U> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const T&, const U&, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( const T& size, const U& u,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:169:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*' and 'Rcpp::Vector<19>'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:163:5: note: template<bool NA, class VEC> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const Rcpp::VectorBase<RTYPE, NA_, T>&)
     Vector( const VectorBase<RTYPE,NA,VEC>& other ) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:163:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'const Rcpp::VectorBase<10, LHS_NA, LHS_T>' and 'int'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:153:5: note: template<class U> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const Rcpp::Dimension&, const U&)
     Vector( const Dimension& dims, const U& u) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:153:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   candidate expects 2 arguments, 3 provided
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:146:5: note: template<class T> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(T, typename Rcpp::traits::enable_if<(Rcpp::traits::is_bool<T>::value && (RTYPE == 10)), void>::type*)
     Vector(T value,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:146:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'typename Rcpp::traits::enable_if<(Rcpp::traits::is_bool<T>::value && (10 == 10)), void>::type*' and 'bool'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:134:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const Rcpp::Dimension&) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage]
     Vector( const Dimension& dims) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:134:5: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:129:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const int&) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage]
     Vector( const int& size ) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:129:5: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:123:5: note: template<class T> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(T, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector(T size,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:123:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*' and 'bool'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:114:5: note: template<class T> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const T&, Rcpp::Vector<RTYPE, StoragePolicy>::stored_type (*)(), typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( const T& siz, stored_type (*gen)(void),
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:114:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   cannot convert 'interpolate' (type 'bool') to type 'Rcpp::Vector<10, Rcpp::PreserveStorage>::stored_type (*)() {aka int (*)()}'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:108:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const char*) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage]
     Vector( const char* st ) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:108:5: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:102:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const string&) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage; std::string = std::basic_string<char>]
     Vector( const std::string& st ){
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:102:5: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:95:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const int&, const stored_type&) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage; Rcpp::Vector<RTYPE, StoragePolicy>::stored_type = int]
     Vector( const int& size, const stored_type& u) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:95:5: note:   candidate expects 2 arguments, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:88:5: note: template<class T> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const T&, const stored_type&, typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*)
     Vector( const T& size, const stored_type& u,
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:88:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'typename Rcpp::traits::enable_if<Rcpp::traits::is_arithmetic<T>::value, void>::type*' and 'Rcpp::Vector<19>'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:83:14: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const Rcpp::no_init_vector&) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage]
     explicit Vector( const no_init_vector& obj) {
              ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:83:14: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:78:5: note: template<class Proxy> Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const Rcpp::GenericProxy<Proxy>&)
     Vector( const GenericProxy<Proxy>& proxy ){
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:78:5: note:   template argument deduction/substitution failed:
In file included from gridtext_types.h:12:0,
                 from RcppExports.cpp:4:
grid-renderer.h:61:94: note:   mismatched types 'const Rcpp::GenericProxy<Proxy>' and 'int'
           NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate, gp)
                                                                                              ^
In file included from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/Vector.h:52:0,
                 from /home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp.h:40,
                 from layout.h:4,
                 from gridtext_types.h:11,
                 from RcppExports.cpp:4:
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:72:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(SEXP) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage; SEXP = SEXPREC*]
     Vector( SEXP x ) {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:72:5: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:64:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const Rcpp::Vector<RTYPE, StoragePolicy>&) [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage]
     Vector( const Vector& other){
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:64:5: note:   candidate expects 1 argument, 3 provided
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:56:5: note: Rcpp::Vector<RTYPE, StoragePolicy>::Vector() [with int RTYPE = 10; StoragePolicy = Rcpp::PreserveStorage]
     Vector() {
     ^
/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include/Rcpp/vector/Vector.h:56:5: note:   candidate expects 0 arguments, 3 provided
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package 'gridtext'
* removing '/home/jmw86069/R/x86_64-pc-linux-gnu-library/3.6/gridtext'

sessionInfo():

sessionInfo() output, click to expand
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /opt/biotools/R361/lib64/R/lib/libRblas.so
LAPACK: /opt/biotools/R361/lib64/R/lib/libRlapack.so

locale:
[1] C

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

other attached packages:
[1] gridtext_0.1.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7        prettyunits_1.1.1 ps_1.6.0          withr_2.4.2       rprojroot_2.0.2   crayon_1.4.1      R6_2.5.0          magrittr_2.0.1    cli_3.0.1         rlang_0.4.11      stringi_1.7.3     curl_4.3.2        rstudioapi_0.13   remotes_2.4.0     callr_3.7.0       xml2_1.3.1        tools_3.6.1       stringr_1.4.0     markdown_1.1
[20] compiler_3.6.1    processx_3.5.2    pkgbuild_1.0.6

@clauswilke
Copy link
Collaborator

As far as I can see, all your problems arise from inside Rcpp code. So maybe something changed there. I'm just using their published API.

@jmw86069
Copy link
Author

Ah that's a fair point - I'll check the Rcpp Github issues to look for something similar posted.

I did notice that your cpp code had not changed (that I could tell) so it would make sense if something happened inside Rcpp.

@jmw86069
Copy link
Author

From what I could grok from a large number of only slightly- or possibly-related threads, both on Github and their rcpp-devel mailing list, it seems like an issue where header include order could be causing a problem.

Lots of examples of "no matching function for call" - but nothing I can debug as I'm not a C++ programmer.

Also, I was wrong earlier: I didn't actually get it to install previously, I asked our linux admin to install it. I remember he said it was hard to install. ;)

I ran strings -a gridtext.so | grep -i gcc and it shows GCC-5.3 was used. long sigh It does use the older libstdc++.so.6.0.19 so apparently that file is not the problem/solution?

Next steps:
I can post an issue to Rcpp - but this isn't my code, I'm unfamiliar with C++ debugging, and I'm not likely to be able to answer any of their follow-up questions without your input.
I can defer that back to you - if you're interested then I'm happy to be responsive with testing. If not, then I'll be sad not to use gridtext/ggtext, but I don't think I can debug this issue.

Does this package really require GCC-5.3 or higher? I feel like this is somewhat limiting for a package dependency. Maybe not for laptops/workstations, but for servers it's kind of heavy.

@clauswilke
Copy link
Collaborator

GCC 5.3 was released in December 2015. It's not high on my priority list to support older versions. If somebody figures out what needs to be done to provide support I'm happy to consider PRs, but I'm not going to hunt down issues that can be solved by simply upgrading to a more recent system.

@jmw86069
Copy link
Author

Yeah I understand that logic. ;)

Is it true that using a newer GCC also means R itself needs to be compiled with newer GCC, and all R packages reinstalled with the newer GCC?
I did a quick test: installed gcc-11.2/g++-11.2 on the side; then installed gridtext with that compiler. It did compile and install, but it fails to load inside R-4.1.0 because the libstdc++.so.6 version is mismatched with R.

Maybe there's a clever way to link older libraries while using a newer compiler. I will research that on my own.

I'm concerned about the number of people on CentOS 7, with default GCC-4.8.5.
Although CentOS 7 was released in 2014, the newer CentOS 8 was released late 2019.
Given the Covid cloud that covered 2020 and 2021, I'm not sure many places have upgraded to CentOS 8 since then.

I can confidently say that none of my work is important enough to ask someone to upgrade their OS. haha
I'm okay with that! :) I'm not sure I can ask them to do compiler tricks, but maybe it's easier than I realize.

@clauswilke
Copy link
Collaborator

Not sure. I'm not doing that much C++ anymore these days and the compiler and library inconsistencies have always been annoying me. C++ wasn't really usable before C++14, released in 2014, and even then it's barely usable if we want to be honest.

@bandrewfox
Copy link

I'm also having this trouble on a machine where I don't have the ability to update the OS and get a newer version of C++. So, I pulled the gridtext_0.1.5.tar.gz from cran and looked at the grid-renderer.h file which is referred to in the first line of the error:

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)

So, if I look at line 61 of grid-renderer.h, then that line is listing the arguments to the function called raster_grob:
https://github.com/wilkelab/gridtext/blob/master/src/grid-renderer.h#L55

The definition of raster_grob is here:
https://github.com/wilkelab/gridtext/blob/master/src/grid.h#L35

List raster_grob(RObject image, NumericVector x_pt = 0, NumericVector y_pt = 0, NumericVector width_pt = 0, 
    NumericVector height_pt = 0, LogicalVector interpolate = true, RObject gp = R_NilValue, RObject name = R_NilValue);

So, it looks like "gp" should be the last argument of raster_grob(), but it is currently the last argument of the "LogicalVector." And, LogicalVector isn't defined in Rcpp::Vector to have those 3 arguments and so it is throwing this error. If I move the parenthesis to be before the "gp" then it compiles fine on my old machine:

  void raster(RObject image, Length x, Length y, Length width, Length height, bool interpolate = true,
              const GraphicsContext &gp = R_NilValue) {
    if (!image.isNULL()) {
      m_grobs.push_back(
        raster_grob(
          image, NumericVector(1, x), NumericVector(1, y),
          NumericVector(1, width), NumericVector(1, height), LogicalVector(1, interpolate), gp
        )
      );
    }
  }

I don't know enough about C++/Rcpp why this error would be skipped in a newer version, and I don't know the consequence of having "gp" not get passed to raster_grob properly. I don't know enough about this package or R development to be able to even test it.

I will try this fix and recompile and then see if I can get survminer to work and then report back to here.

@clauswilke
Copy link
Collaborator

@bandrewfox Good point. I think the code is indeed buggy and the gp argument should be placed outside the LogicalVector() call. Would you mind creating a PR with this change and then we can see if the unit tests work? I would expect they do.

bandrewfox added a commit to bandrewfox/gridtext that referenced this issue Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants