cannot build grpc on ubuntu - fails in src/compiler/csharp_generator.cc

1,246 views
Skip to first unread message

Mark David

unread,
Jun 15, 2015, 5:14:50 PM6/15/15
to grp...@googlegroups.com
I checked that I had all prerequisites specified in INSTALL. I have a pretty normal/standard/working Ubuntu development environment.

Linux ubuntu 3.19.0-20-generic #20-Ubuntu SMP Fri May 29 10:10:47 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

I get the following at the tail end of doing 'make', with latest git clone of https://github.com/grpc/grpc.git. Anyone know anything?
Thanks,
-Mark


[HOSTCXX] Compiling src/compiler/cpp_generator.cc
[HOSTCXX] Compiling src/compiler/csharp_generator.cc
src/compiler/csharp_generator.cc: In function ‘std::string grpc_csharp_generator::{anonymous}::GetFileNamespace(const FileDescriptor*)’:
src/compiler/csharp_generator.cc:67:23: error: ‘const class google::protobuf::FileOptions’ has no member named ‘has_csharp_namespace’
   if (file->options().has_csharp_namespace()) {
                       ^
src/compiler/csharp_generator.cc:68:28: error: ‘const class google::protobuf::FileOptions’ has no member named ‘csharp_namespace’
     return file->options().csharp_namespace();
                            ^
Makefile:2585: recipe for target 'objs/opt/src/compiler/csharp_generator.o' failed
make: *** [objs/opt/src/compiler/csharp_generator.o] Error 1

Nicolas Noble

unread,
Jun 15, 2015, 5:21:46 PM6/15/15
to Mark David, grp...@googlegroups.com
This means you haven't installed the version of protobuf 3.0.0 that's actually the latest. You need protobuf 3.0.0-alpha3. This is the latest version that has been released, and also the version that grpc's submodule is targeting.

Please install the newest version of protobuf and let us know if that improves the compilation!

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d7b310b8-f816-4354-bbea-cda9d7b41bee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark David

unread,
Jun 15, 2015, 6:40:15 PM6/15/15
to grp...@googlegroups.com, mhd...@gmail.com
OK, so then I did a git clone of 3.0.0-alpha3, went through the build procedure through make install, then did make clean and then make in the grpc directory. It failed again like the following.  It seems the old installation of protobufs is getting in the way, but I'm unsure what to do? Can someone give hints or guide me?
Thanks,
Mark


[HOSTLD]  Linking bins/opt/grpc_csharp_plugin
/usr/bin/ld: warning: libprotobuf.so.10, needed by /usr/local/lib/libprotoc.so, may conflict with libprotobuf.so.9
/usr/bin/ld: ./libs/opt/libgrpc_plugin_support.a(csharp_generator.o): undefined reference to symbol '_ZN6google8protobuf2io7Printer5PrintEPKcS4_RKSsS4_S6_S4_S6_S4_S6_'
/usr/local/lib/libprotobuf.so.10: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:7686: recipe for target 'bins/opt/grpc_csharp_plugin' failed
make: *** [bins/opt/grpc_csharp_plugin] Error 1

Nicolas Noble

unread,
Jun 15, 2015, 6:45:32 PM6/15/15
to Mark David, grp...@googlegroups.com
That's a beautiful one, that I haven't seen before! I am guessing that you tried to build and install protobuf 3.0.0-alpha3 without removing the old version from your drive, and now they are conflicting with each other.

Could you try a `sudo ldconfig` to make sure your system picks up the latest versions of your installed libraries before retrying compiling grpc ?

Mark David

unread,
Jun 15, 2015, 8:10:16 PM6/15/15
to grp...@googlegroups.com, mhd...@gmail.com
That did not help much, ending up with similar but different complaints about .so (lib) file confusion.  So I then manually removed old .so files I could find, something like

  sudo find /usr/lib -name "*protobuf*" -delete

did the thing you said

  sudo ldconfig

also in protobuf-3.0.0-alpha3 directory

  sudo make distclean
  make clean
  make

and then a clean and make in the grpc directory, and it finally ran to completion with no apparent errors.

But it was a manual and iffy procedure.  There seems to be no 'make uninstall' (for protobufs).  Can someone produce a description of how to "remove old version [of protobufs] from your drive"?

Thank you,

Mark
Reply all
Reply to author
Forward
0 new messages