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

Cannot get the demo working #37

Open
husafan opened this issue Oct 29, 2021 · 3 comments · May be fixed by #38
Open

Cannot get the demo working #37

husafan opened this issue Oct 29, 2021 · 3 comments · May be fixed by #38

Comments

@husafan
Copy link

husafan commented Oct 29, 2021

I've set up a Docker container running Ubuntu 21. I've followed the instructions under installation to make sure the necessary package dependencies are installed and that grpc is available. I then clone the repository, CD into the base directory and run R -e 'demo("helloserver", "grpc")'. I see:

root@dbf97d90098c:/tmp/grpc# R -e 'demo("helloserver", "grpc")'

R version 4.1.1 (2021-08-10) -- "Kick Things"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (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.

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.

> demo("helloserver", "grpc")
Error in find.package(package, lib.loc, verbose = verbose) : 
  there is no package called 'grpc'
Calls: demo -> find.package
Execution halted
@nfultz
Copy link
Owner

nfultz commented Oct 30, 2021

It looks like you didn't build and install the package?

there is no package called 'grpc'

@husafan
Copy link
Author

husafan commented Oct 30, 2021

Thank you you very much for replying. You were absolutely right. Please forgive my newness to R. I got further last night by installing the devtools package and then running install_local("/tmp/grpc"). However, now I am seeing the following error:

g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/usr/local/lib/R/site-library/Rcpp/include'   `pkg-config --cfl
ags grpc` -fpic  -g -O2 -ffile-prefix-map=/build/r-base-kbcSEe/r-base-4.1.1=. -flto=auto -ffat-lto-objects -fstack-pro
tector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.og++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/usr/local/lib/R/site-library/Rcpp/include'   `pkg-config --cflags grpc` -fpic  -g -O2 -ffile-prefix-map=/build/r-base-kbcSEe/r-base-4.1.1=. -flto=auto -ffat-lto-objects -fstack-pro
tector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c client.cpp -o client.o
client.cpp: In function 'Rcpp::RawVector fetch(Rcpp::CharacterVector, Rcpp::CharacterVector, Rcpp::RawVector, Rcpp::Ch
aracterVector)':                                                                                                      client.cpp:76:47: error: no match for 'operator=' (operand types are 'grpc_metadata' and '<brace-enclosed initializer list>')                                                                                                                  76 |         {{nullptr, nullptr, nullptr, nullptr}}};
      |                                               ^
In file included from /.grpc/include/grpc/impl/codegen/byte_buffer.h:26,
                 from /.grpc/include/grpc/byte_buffer.h:24,                                                                            from /.grpc/include/grpc/grpc.h:26,                                                                                   from client.cpp:2:                                                                                   /.grpc/include/grpc/impl/codegen/grpc_types.h:533:16: note: candidate: 'grpc_metadata& grpc_metadata::operator=(const 
grpc_metadata&)'                                           
  533 | typedef struct grpc_metadata {
      |                ^~~~~~~~~~~~~
/.grpc/include/grpc/impl/codegen/grpc_types.h:533:16: note:   no known conversion for argument 1 from '<brace-enclosed
 initializer list>' to 'const grpc_metadata&'
/.grpc/include/grpc/impl/codegen/grpc_types.h:533:16: note: candidate: 'grpc_metadata& grpc_metadata::operator=(grpc_m
etadata&&)'
/.grpc/include/grpc/impl/codegen/grpc_types.h:533:16: note:   no known conversion for argument 1 from '<brace-enclosed
 initializer list>' to 'grpc_metadata&&'
make: *** [/usr/lib/R/etc/Makeconf:177: client.o] Error 1
ERROR: compilation failed for package 'grpc'
* removing '/usr/local/lib/R/site-library/grpc'

Any idea what that's about? Thanks again for your time and help.

@nfultz
Copy link
Owner

nfultz commented Oct 31, 2021

The error message you posted is at this line:

{{nullptr, nullptr, nullptr, nullptr}}};

I suspect you are using a more recent version of GRPC from google, and maybe something in the header slightly changed. If you make the line match the version you installed, it ought to build, or it may reveal some other related issues. Please dosubmit a PR if you get it working.

@husafan husafan linked a pull request Oct 31, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants