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

error compiling cl-protobufs in order to install #402

Open
vchudnov-g opened this issue Apr 26, 2023 · 5 comments
Open

error compiling cl-protobufs in order to install #402

vchudnov-g opened this issue Apr 26, 2023 · 5 comments

Comments

@vchudnov-g
Copy link

I'm having problems installing cl-protobufs. I get errors like

g++ -std=c++14 -I/PATH/TO/MY/LOCAL/lisp/protobuf/include -I.   -c -o generator.o generator.cc
generator.cc: In member function ‘virtual bool google::protobuf::cl_protobufs::LispGenerator::Generate(const google::protobuf::FileDescriptor*, const std::string&, google::protobuf::compiler::OutputDirectory*, std::string*) const’:
generator.cc:62:5: error: ‘GOOGLE_CHECK’ was not declared in this scope
   62 |     GOOGLE_CHECK(annotations.SerializeToZeroCopyStream(meta.get()));
      |     ^~~~~~~~~~~~
generator.cc: In member function ‘virtual bool google::protobuf::cl_protobufs::LispGenerator::GenerateAll(const std::vector<const google::protobuf::FileDescriptor*>&, const std::string&, google::protobuf::compiler::GeneratorContext*, std::string*) const’:
generator.cc:135:5: error: ‘GOOGLE_CHECK’ was not declared in this scope
  135 |     GOOGLE_CHECK(annotations.SerializeToZeroCopyStream(meta.get()));
      |     ^~~~~~~~~~~~
make: *** [<builtin>: generator.o] Error 1

FWIW, I had to use different compilation steps for protobuf than what's included in your README, since protobuf seems to be currently set up for bazel or cmake builds. After trying various approaches, the following are the steps that wound up successfully compiling protobuf and installing it (and its include/) to a local user directory for me. I don't get an error until I try to compile cl-protobuf:

export PROTOC_ROOT=/PATH/TO/MY/LOCAL/lisp/protobuf
mkdir -p /tmp/lisp/proto
pushd /tmp/lisp/proto

git clone --recursive https://github.com/google/protobuf
pushd protobuf
git submodule update --init --recursive

mkdir -p ${PROTOC_ROOT}
cmake . -DCMAKE_CXX_STANDARD=14 -DCMAKE_INSTALL_PREFIX=${PROTOC_ROOT}
cmake --build . --parallel 10

cmake --install .
path-prepend ${PROTOC_ROOT}/bin
popd # protobuf

git clone [email protected]:qitab/cl-protobufs.git

pushd cl-protobufs/protoc
make  #### ****  <-- error occurs here

popd # cl-protobufs/protoc
popd # /tmp/lisp/proto

@Slids
Copy link
Member

Slids commented May 1, 2023

Thank you for the issue.
I've been pretty sick lately, but please know this
is on my list of things to look at!

@cgay
Copy link
Contributor

cgay commented Mar 14, 2024

@Slids I'm trying to build with Bazel instead of cmake because the protobuf/cmake/README.md only mentions Windows and Linux support, not macOS. If you export cl-protobufs/BUILD I can give it a shot.

Building protoc with bazel worked flawlessly...

git clone --recursive https://github.com/google/protobuf
cd protobuf/
brew install bazel
bazel build :protoc :protobuf
cp bazel-bin/protoc ~/bin/

I suspect I just need the following in my cl-protobufs/WORKSPACE file in order to build cl-protobufs/protoc, once I have the BUILD file.

workspace(name = "the-fantabulous-cl-protobufs-workspace")

local_repository(
    name = "com_google_protobuf",
    path = "../protobuf",  # assume installed in same dir as cl-protobufs
)

@cgay
Copy link
Contributor

cgay commented Mar 19, 2024

@Slids where are you?!!! I needz my BUILD filez!

@Slids
Copy link
Member

Slids commented Sep 7, 2024

Using CMake as done in the yaml CI files will work post:
#438

@Slids
Copy link
Member

Slids commented Sep 7, 2024

Protocol Buffers and ABSL both had some major changes, and I only (just barely) updated to a newer version of Prtocol Buffer used. Please check the SBCL-test.yaml file in the CI and the CMake file in protoc.

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.

3 participants