Failed to generate gRPC service classes - c++

I am trying to follow along with this tutorial. I am stuck on trying to generate the .grpc files (service classes) but I was able to generate the message classes. When I run
protoc -I ../proto --grpc_out=.
--plugin=protoc-gen-grpc=grpc_cpp_plugin ../proto/eample.proto
I get "grpc_cpp_plugin: program not found". How can I generate the service classes? Im not sure about the correct command I have to run.

The question is pretty old, but I hope my answer will help somebody. Giorgio Azzinnaro was right you need to install GRPC (in addition to protoc). On OSX you can do it with:
brew install grpc
For the other languages, commands are described here

Can you try to run this?
$ which grpc_cpp_plugin
If it finds a match, try to use the full path:
--plugin=protoc-gen-grpc=`which grpc_cpp_plugin`
If that isn't found, see if it is there in /usr/local/bin (it might just not be in the path), and if you find it there again use the full path in the --plugin directive.
If all this fails I suppose it might be that gRPC was not installed correctly...

Related

Need help on compiling DPDK hello world

I try to learn DPDK using the following link: https://doc.dpdk.org/guides/prog_guide/build_app.html
I have downloaded DPDK 19.11.1 version in Ubuntu 16 virtual machine. Then unzipped the tar.gz file. Then I have given the following commands
~/DPDK$ cd examples/helloworld/
~/DPDK/examples/helloworld$ export RTE_SDK=/home/vijay/dpdk
~/DPDK/examples/helloworld$ export RTE_TARGET=x86_64-native-linuxapp-gcc
~/DPDK/examples/helloworld$ make
The following error is displayed:
/home/vijay/dpdk/mk/internal/rte.extvars.mk:29 cannot find .config in /home/vijay/dpdk/build. stop
If I put sudo make, the following error is displayed
Makefile:44: *** "Please define RTE_SDK environment variable". stop
When I put echo $RTE_SDK and echo $RTE_TARGET the values are printed correctly. I tried x86_64-native-linux-gcc for RTE_TARGET also.
I tried multiple times and referred to different sources. Not sure whether I miss any steps in the process. What can I try next?
Based on the error logs, it looks like you have not built dpdk libraries in the desired target folder. To do it correctly
cd dpdk-main-folder
export RTE_SDK=$PWD
export RTE_TARGET=x86_64-native-linuxapp-gcc
make config T=$RTE_TARGET O=$RTE_TARGET
cd $RTE_TARGET
make -j 10
With these done go to your desired example and execute make

Pabot - Unable to run parallel robotframework tests

So, I'm working on a robotframework test project, and the goal is to run several test suites in parallel. For this purpose, pabot was chosen as the solution. I am trying to implement it, but with little success.
My issue is: after installing Pabot (which, I might say, I did by cloning the project and running "setup.py install", instead of using pip, since the corporate proxy I'm behind has proven an obstacle I can't overcome), I created a new directory in the project tree, moved some suites there, and ran:
pabot --processes 2 --outputdir pabot_results Login*.robot
Doing so results in the following error message:
2018-10-10 10:27:30.449000 [PID:9676] [0] EXECUTING Suites.LoginAdmin
2018-10-10 10:27:30.449000 PID:400 EXECUTING Suites.LoginUser
2018-10-10 10:27:30.777000 PID:400 FAILED Suites.LoginUser
2018-10-10 10:27:30.777000 [PID:9676] [0] FAILED Suites.LoginAdmin
WARN: No output files in "pabot_results\pabot_results"
Output:
[ ERROR ] Reading XML source '' failed: invalid mode ('rb') or filename
Try --help for usage information.
Elapsed time: 0 minutes 0.578 seconds
Upon inspecting the stderr file that was generated, I have this message:
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\robotframework-3.1a2.dev1-py2.7.egg\robot\running\runner.py", line 22, in
from .context import EXECUTION_CONTEXTS
ValueError: Attempted relative import in non-package
Apparently, this has to do with something from the runner.py script, which, if I'm not mistaken, came with the installation of robotframework. Since manually modifying that script does not seem to me the optimal solution, my question is, what am I missing here? Did I forget to do anything while setting this up? Or is this an issue of compatibility between versions?
This project is using Maven as the tool to manage dependencies. The version I am running is 3.5.4. I am using a Windows 10, 64bit system; I have Python 2.7.14, and Robot Framework 3.1a2.dev1. The Pabot version is 0.44. Obviously, I added C:\Python27 and C:\Python27\Scripts to the PATH environment variable.
Edit: I am also using robotframework-maven-plugin version 1.4.0.8, if that happens to be relevant.
Edit 2: added the error messages in text format.
I believe I've come across an issue similar when setting up parallel execution on my machine. Firstly I would confirm that pabot is installed using pip show robotframework-pabot.
Then you should define the directory your results are going to using -d.
I then modified the name of the -o to Output.xml to make it easy to identify.
This is a copy of the code I use. Runs optimally with 8 processes
pabot --processes 8 -d results -o Output.xml Tests
Seems that you stumbled on a bug in the prerelease version of robot framework (3.1a2.dev1).
Please install a release version of robot framework. For example 3.0.4.
Just in case anyone happens to stumble upon this issue in the future:
Since I can't use pip, and I tried a good deal of workarounds that eventually made things more unstable, I ended up saving my project and removing everything Python-related from my system, so as to allow me to install everything from scratch. In a Windows 10, 64bit system, I used:
Python 2.7.14
wxPython 2.8.12.1, win64, unicode, for py27
setuptools 40.2.0 (to allow me to use the easy_install command)
Robot Framework 3.0.4
robotremoteserver 1.1
Selenium2Library 3.0.0
and Pabot version 0.45.
I might add that, when installing the Selenium2Library the way I described above, it eventually tries to download some things from the pip repositories - which, if you have a proxy, will cause you trouble. I solved this problem by browsing https://pypi.org/simple/selenium/, manually downloading the 2.53.6 .tar.gz file, then extracting it and running setup.py install on the command line.
PS: Ideally, though, anyone should be able to use proxy settings from the command line (--proxy http://user:password#server:port) to get pip and then use it; however, for some reason, probably related to network security configurations that I didn't want to lose time with, this didn't work in my case.

Building Perf with Babeltrace on CentOS 7.2 using rpms

I wish to use CTF conversion with perf. From the scarce information around, I've figured out that I need to recompile perf.
I've installed the epel repository and used yum to install
babeltrace and libbabeltrace
for the run time as well as
libunwind-devel slang-devel libbabeltrace-devel and asciidoc
for compilation.
I cloned git.kernel.org (as alternative I also tried github.com/torvalds) and used
LIBBABELTRACE=1 make
to build the perf with babeltrace support. However, I get the error:
Makefile.config:780: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
So I try adding LIBBABELTRACE_DIR with /usr but this, too, fails. Checking out the Makefile.conf, I see that the configuration is looking in the wrong places: it is set up to use a locally compiled babeltrace with well defined subdirectories (include and lib), but these are NOT used when installing from rpm (yum). The rpm places them in /usr/include/babeltrace and /usr/lib64.
Patching the Makefile also doesn't help.
So, short of being forced to use a locally compiled babeltrace, what options do I have?
This is for a cluster of 26 nodes and I really would prefer a simple 'yum install' as this simplifies restaging nodes when the get corrupted (we do research with them and regularily corrupt stuff) and does not require setting specific environments.
ADDENDUM:
I tried compiling babeltrace from https://github.com/efficios/babeltrace.git: this, too, fails with the error:
babeltrace-cfg-cli-args.c:2390:29: error: ‘POPT_ARG_LONGLONG’ undeclared (first use in this function)
and, surely enough, popt.h does not define POPT_ARG_LONGLONG.
Thanks in advance.

RabbitMQ C++ client for old Debian

I have an old Debian (Lenny), on which I develop an application that should connect to RabbitMQ.
I downloaded the official C++ client rabbitmq-c-0.8.0 from https://github.com/alanxz/rabbitmq-c/releases/tag/v0.8.0 , but unfortunately, I can't compile it on my old Debian:
wget https://github.com/alanxz/rabbitmq-c/archive/v0.8.0.tar.gz
tar zxvf v0.8.0.tar.gz
autoreconf -i
Result:
autoreconf -i
/usr/share/aclocal/libmcrypt.m4:17: warning: underquoted definition of AM_PATH_LIBMCRYPT
/usr/share/aclocal/libmcrypt.m4:17: run info '(automake)Extending aclocal'
/usr/share/aclocal/libmcrypt.m4:17: or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
Makefile.am:6: Libtool library used but `LIBTOOL' is undefined
Makefile.am:6: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
Makefile.am:6: to `configure.ac' and run `aclocal' and `autoconf' again.
Makefile.am:6: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure
Makefile.am:6: its definition is in aclocal's search path.
autoreconf2.50: automake failed with exit status: 1
Version of automake I have (and I can't upgrade it): 1:1.10.1-3
Version of libtool I have (and I can't upgrade it as well): 1.5.26-4+lenny1
Does anyone know how to build the RabbitMQ client on the old OS I use?
Many thanks!!!
Eventually, the best solution was to move to ubuntu 14+

omz_urlencode:42: -regex-match not available for regex

Okay so i'm trying to install Homebrew, so that I can I can install nodejs and npm. However I'm using this command from brew.sh;
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once I install Homebrew It keeps returning this error
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md etc lib libexec Library LICENSE.txt README.md sbin share .git .github .gitignore
omz_urlencode:42: failed to load module `zsh/regex': dlopen(/usr/local/Cellar/zsh/5.2/lib/zsh/regex.so, 9): image not found
omz_urlencode:42: -regex-match not available for regex'
I honestly have no idea what's happening here. I'm not sure If I have to symlink Homebrew up or what. But I have tried everything I know so far (which isn't much). If anyone could be kind enough to give me instructions as what too look for to solve the issue, I'm all ears.
Thank you for listening!
It seems it's a bug that have been corrected in recent version of OMZ, you should update it.
You get the output:
zsh: command not found: homebrew
Because homebrew is not a command. Try brew -v instead.
To resolve:
Warning: node-5.10.1 already installed, it's just not linked
Use brew link node
Okay so I think I have made some progress, It may have been for some weird reason I didn't have permission writes to run the 'brew link < package > ' so i ran the following command:
'sudo chown -R /usr/local/share/systemtap/tapset && brew doctor'
Once I ran 'brew link node' it successfully created 7 symlinks for the node directory on the following path;
'Linking /usr/local/Cellar/node/5.10.1... 7 symlinks created'
However, when I installed live-server via npm; I typed 'live-server -v' and it again returned 'zsh: command not found: live-server'. In addition to this it keeps telling me I have 'unbrewed dylibs':
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libociei.dylib
So im still unsure what the exact issue is.
P.S. Apologies for not posting this correctly, as im trying to see where I can seperate it into commands like you corrected in the first post, if you could link me to a post where it tells me how to use it properly i'll be more than happy to read it.
Thanks,