SOLVED Unable to install grpc via PECL

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
948
29
178
Having problems installing the grpc module. Gettting the following errors...

/root/tmp/pear/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc:279:49: error: no matching function for call to 'StrFormat(const char [30], const string&, grpc_core::GrpcLbClientStats*)'
/root/tmp/pear/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc:279:49: note: mismatched types 'absl::lts_2020_09_23::FormatSpec<Args ...>' and 'const char [30]'
/root/tmp/pear/grpc/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template argument deduction/substitution failed:
/root/tmp/pear/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc:527:72: note: mismatched types 'absl::lts_2020_09_23::FormatSpec<Args ...>' and 'const char [20]'
make: *** [src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.lo] Error 1
I've had a dig around and can't find anything obvious. I was hoping someone else may have had this same issue and has resolved it. Many thanks.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,597
2,617
363
cPanel Access Level
Root Administrator
Hey there! I have run into this one before, and it's an issue with the version of GRPC having a conflict with the GCC libraries on the system. If we check the version of GRPC that will be installed, we'll see this:

Code:
# /opt/cpanel/ea-php72/root/usr/bin/pecl search grpc
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
gRPC    1.35.0 (stable)       A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.
If we check the installation requirements here:


we'll see you need GCC 4.9, which is not available in CentOS 7 at this time:

Code:
[root@a ~]# rpm -qa | grep gcc
gcc-c++-4.8.5-44.el7.x86_64
libgcc-4.8.5-44.el7.x86_64
gcc-4.8.5-44.el7.x86_64
I did check a CentOS 8 machine and that would meet the requirements, but you'd need to manually install an earlier version of grpc tools in order to get that working as it is not recommended to try and update the GCC package outside of what CentOS/CloudLinux provides.
 
  • Like
Reactions: 4u123

fisec77933

Registered
Dec 15, 2020
4
0
1
india
cPanel Access Level
Root Administrator
root/tmp/pear/grpc/third_party/boringssl-with-bazel/src/include -I/root/tmp/pear/grpc/third_party/re
2 -I/root/tmp/pear/grpc/third_party/upb -I/root/tmp/pear/grpc/third_party/xxhash -DHAVE_CONFIG_H -st
d=c++11 -fno-exceptions -fno-rtti -g -O2 -c /root/tmp/pear/grpc/src/core/ext/filters/client_channel/
backend_metric.cc -fPIC -DPIC -o src/core/ext/filters/client_channel/.libs/backend_metric.o
In file included from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/lb_policy.h:31:0,
from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/backend_metric.h:24,
from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/backend_metric.cc:19:
/root/tmp/pear/grpc/src/core/ext/filters/client_channel/server_address.h: In member function 'virtua
l std::string grpc_core::ServerAddressWeightAttribute::ToString() const':
/root/tmp/pear/grpc/src/core/ext/filters/client_channel/server_address.h:135:41: error: no matching
function for call to 'StrFormat(const char [3], const uint32_t&)'
return absl::StrFormat("%d", weight_);
^
/root/tmp/pear/grpc/src/core/ext/filters/client_channel/server_address.h:135:41: note: candidate is:

In file included from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/server_address.h:28:0,

from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/lb_policy.h:31,
from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/backend_metric.h:24,
from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/backend_metric.cc:19:
/root/tmp/pear/grpc/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template std::string absl::lts_20210324::StrFormat(absl::lts_20210324::FormatSpec&, const A
rgs& ...)
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec& format,
^
/root/tmp/pear/grpc/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template argume
nt deduction/substitution failed:
In file included from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/lb_policy.h:31:0,
from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/backend_metric.h:24,
from /root/tmp/pear/grpc/src/core/ext/filters/client_channel/backend_metric.cc:19:
/root/tmp/pear/grpc/src/core/ext/filters/client_channel/server_address.h:135:41: note: mismatched
types 'absl::lts_20210324::FormatSpec' and 'const char [3]'
return absl::StrFormat("%d", weight_);
^
make: *** [src/core/ext/filters/client_channel/backend_metric.lo] Error 1
ERROR: `make' failed