jmhodges / gocld3

Apache License 2.0
20 stars 18 forks source link

Make gocld3 compilable with protobuf 3.17.3 #19

Closed pemistahl closed 2 years ago

pemistahl commented 3 years ago

Hello Jeff,

I'm on macOS 10.15 and am trying to install gocld3. I've installed pkg-config and protobuf using Homebrew for this purpose. The current version 3.17.3 of protobuf is not compatible with some generated files. I've tried to build the compatible version 3.11.3 of protobuf from source but failed. I'm not a C++ guy either. Can you please make the project compilable with the latest version of protobuf? Thanks a lot. Below is the stacktrace I got:

% go get github.com/jmhodges/gocld3/cld3
# github.com/jmhodges/gocld3/cld3
In file included from cld3.cc:3:
In file included from ../../../go/pkg/mod/github.com/jmhodges/gocld3@v0.0.0-20210219072212-f4c0e00f8117/cld3/nnet_language_identifier.h:22:
In file included from ../../../go/pkg/mod/github.com/jmhodges/gocld3@v0.0.0-20210219072212-f4c0e00f8117/cld3/embedding_feature_extractor.h:23:
In file included from ../../../go/pkg/mod/github.com/jmhodges/gocld3@v0.0.0-20210219072212-f4c0e00f8117/cld3/feature_extractor.h:45:
../../../go/pkg/mod/github.com/jmhodges/gocld3@v0.0.0-20210219072212-f4c0e00f8117/cld3/feature_extractor.pb.h:17:2: error: This file was generated by an older version of protoc which is
../../../go/pkg/mod/github.com/jmhodges/gocld3@v0.0.0-20210219072212-f4c0e00f8117/cld3/feature_extractor.pb.h:18:2: error: incompatible with your Protocol Buffer headers. Please
../../../go/pkg/mod/github.com/jmhodges/gocld3@v0.0.0-20210219072212-f4c0e00f8117/cld3/feature_extractor.pb.h:19:2: error: regenerate this file with a newer version of protoc.
../../../go/pkg/mod/github.com/jmhodges/gocld3@v0.0.0-20210219072212-f4c0e00f8117/cld3/feature_extractor.pb.h:28:10: fatal error: 'google/protobuf/inlined_string_field.h' file not found
jeffreims commented 3 years ago

Try recompiling the .proto files

Go to the gocld3/cld3 directory and run go generate

AgrimPrasad commented 2 years ago

@jeffreims Please review my PR #21 which follows the steps you mentioned. Thanks!