#1249 closed defect (fixed)

Compilation error on master

Reported by: dmisev Owned by: atoader
Priority: minor Milestone: 9.2
Component: rasnet Version: development
Keywords: Cc: gmerticariu, mdumitru, vmerticariu
Complexity: Medium

Description

I'm not able to compile current master (g++ version 4.9.2):

[HOSTCXX] Compiling src/compiler/csharp_generator.cc
src/compiler/csharp_generator.cc:47:43: error: ‘google::protobuf::compiler::csharp::GetReflectionClassName’ has not been declared
 using google::protobuf::compiler::csharp::GetReflectionClassName;
                                           ^
src/compiler/csharp_generator.cc: In function ‘void grpc_csharp_generator::{anonymous}::GenerateServiceDescriptorProperty(grpc::protobuf::io::Printer*, const ServiceDescriptor*)’:
src/compiler/csharp_generator.cc:237:64: error: ‘GetReflectionClassName’ was not declared in this scope
              "umbrella", GetReflectionClassName(service->file()), "index",
                                                                ^
Makefile:1945: recipe for target '/home/dimitar/projects/rasdaman/community/src/third_party/grpc/objs/opt/src/compiler/csharp_generator.o' failed

Here's the configure command:

./configure --prefix=/home/dimitar/projects/rasdaman/community/install --with-pic --with-netcdf --disable-java --with-debug-symbols --with-default-basedb=sqlite --with-filedatadir=/d/rasdata

The repo is a fresh clone.

Change History (6)

comment:1 Changed 17 months ago by mdumitru

You might have a previous protobuf version installed on your computer. GRPC first tries to use the global one. It might help to uninstall the global one.

comment:2 Changed 17 months ago by dmisev

You're right, I found some stuff in /usr/local/. After removing them now I have this problem. Btw do I need protoc from packages or not?

test -f version.h && cmp version.h.tmp version.h || mv version.h.tmp version.h
rm -f version.h.tmp 2>/dev/null   
make  all-recursive
make[1]: Entering directory '/home/dimitar/projects/rasdaman/community/src'
Making all in third_party
make[2]: Entering directory '/home/dimitar/projects/rasdaman/community/src/third_party'
cd .. && git submodule update --init --recursive
cd grpc && \
make && \
/bin/mkdir -p /home/dimitar/projects/rasdaman/community/src/third_party/bin/grpc && \
make install prefix=/home/dimitar/projects/rasdaman/community/src/third_party/bin/grpc
make[3]: Entering directory '/home/dimitar/projects/rasdaman/community/src/third_party/grpc'
[MAKE]    Generating cache.mk
[CXX]     Compiling src/cpp/proto/proto_utils.cc
In file included from include/grpc++/impl/codegen/proto_utils.h:41:0,
                 from include/grpc++/impl/proto_utils.h:37,
                 from src/cpp/proto/proto_utils.cc:34:
include/grpc++/impl/codegen/config_protobuf.h:38:42: fatal error: google/protobuf/stubs/common.h: No such file or directory
 #include <google/protobuf/stubs/common.h>
                                          ^
compilation terminated.
Makefile:1950: recipe for target '/home/dimitar/projects/rasdaman/community/src/third_party/grpc/objs/opt/src/cpp/proto/proto_utils.o' failed

comment:3 Changed 17 months ago by mdumitru

You shouldn't need anything global related to grpc or protobuf. GRPC comes bundled with protobuf and we build it statically so there shouldn't be any need for any linux library.
Not sure about this error, are you sure there's no header somewhere else in the include path?
I've been building it for OSGeo twice yesterday and today and it worked fine for me.

@atoader: Can we force grpc to use the protobuf it comes bundled with? It seems quite problematic for users that install from source, what if he installs some other package that puts protobuf in the global include paths?

comment:4 Changed 17 months ago by atoader

Make sure to remove GRPC and Protobuf from your system or install the version we are using on your system.
I will present a more comprehensive solution to this problem at our next group meeting. But, if you have time, you can implement a check in third_party/Makefile.am which checks for Protobuf on the user's system and stops the build if it encounters a version older than 0.12.

comment:5 Changed 17 months ago by dmisev

  • Priority changed from blocker to minor

Ok it worked after really removing anything in /usr I found related to '*protobuf*' and '*grpc*'.

We should put this in the wiki:FAQ or really make sure that the local ones are used as Alex suggested.

comment:6 Changed 15 months ago by dmisev

  • Resolution set to fixed
  • Status changed from new to closed

I added an entry in the FAQ

Note: See TracTickets for help on using tickets.