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

Ask about the protobuf version #2

Closed
DoctorXK opened this issue Apr 11, 2022 · 12 comments
Closed

Ask about the protobuf version #2

DoctorXK opened this issue Apr 11, 2022 · 12 comments

Comments

@DoctorXK
Copy link

DoctorXK commented Apr 11, 2022

Dear author,

I am trying to build panoptic_mapping_pipeline by using
catkin build panoptic_mapping_pipeline -j2,

but encounter:

Errors     << voxblox:make /opt/ros/melodic/logs/voxblox/build.make.029.log
In file included from /opt/ros/melodic/build/voxblox/Block.pb.cc:4:0:
/opt/ros/melodic/build/voxblox/Block.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
 #include <google/protobuf/port_def.inc>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/voxblox_proto.dir/Block.pb.cc.o] Error 1
make[1]: *** [CMakeFiles/voxblox_proto.dir/all] Error 2
make: *** [all] Error 2
cd /opt/ros/melodic/build/voxblox; catkin build --get-env voxblox | catkin env -si  /usr/bin/make --jobserver-fds=3,4 -j; cd -

while the output of protoc --version is libprotoc 3.13.0.
Then I copy the libprotobuf google directory to voxblox directory by using
cp -r /miniconda/pkgs/libprotobuf-3.13.0.1-hd408876_0/include/google /opt/ros/melodic/build/voxblox

and build panoptic_mapping_pipeline again, then I face:

Errors     << voxblox:make /opt/ros/melodic/logs/voxblox/build.make.027.log
In file included from /opt/ros/melodic/build/voxblox/Block.pb.cc:4:0:
/opt/ros/melodic/build/voxblox/Block.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^~~~~
/opt/ros/melodic/build/voxblox/Block.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
  ^~~~~
/opt/ros/melodic/build/voxblox/Block.pb.h:14:2: error: #error your headers.
 #error your headers.

That says my protobuf version is too low, then I try with protobuf 3.16.0 also with the result of too low and try with protobuf 3.18.0 with the result of too high. Obviously there only remainds protobuf 3.17.0 to be chosen, so I try with protobuf 3.17.0 and it outputs a new error:

/opt/ros/melodic/devel/lib/libvoxblox_proto.so: undefined reference to google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/opt/ros/melodic/devel/lib/libvoxblox_proto.so: undefined reference to google::protobuf::internal::VarintParseSlow64(char const*, unsigned int)'
collect2: error: ld returned 1 exit status
make[2]: *** [/opt/ros/melodic/devel/lib/voxblox/tsdf_to_esdf] Error 1
make[1]: *** [CMakeFiles/tsdf_to_esdf.dir/all] Error 2
make: *** [all] Error 2
cd /opt/ros/melodic/build/voxblox; catkin build --get-env voxblox | catkin env -si  /usr/bin/make --jobserver-fds=3,4 -j; cd -

So I am confused about which version of protobuf should I use. Or is there any other reason that cause the problem?

Looking forward to your reply.

@hmz-15
Copy link
Owner

hmz-15 commented Apr 11, 2022

Hi there, thanks for your interest in our work. Seems that the isue is on building Voxblox, which is an off-the-shelf module we used. Can you try if you can build the standalone Voxblox?

Also for your reference, my protobuf version is 3.0.0

@DoctorXK
Copy link
Author

Dear author, thanks for your reply. It seems that the protobuf 3.0.0 is not compatible with python 3.7 which is the python version you require in Installation Guide.

As I use conda install libprotobuf==3.0.0, the installation output is:

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - protobuf==3.0.0 -> python[version='2.7.*|3.4.*|3.5.*']

Your python: python=3.7

Is there any conflicts in your version?

@hmz-15
Copy link
Owner

hmz-15 commented Apr 11, 2022

Oh I see. So I was either building with conda env deactivated (where I have python 2.7 and protobuf 3.0.0) or in the conda env (with python 3.7 and protobuf 3.19.0). Sorry for the confusion.

@DoctorXK
Copy link
Author

Oh I see. So I was either building with conda env deactivated (where I have python 2.7 and protobuf 3.0.0) or in the conda env (with python 3.7 and protobuf 3.19.0). Sorry for the confusion.

Oh, I try with protobuf 3.19 and it says my protobuf version is too high:

______________________________________________________________________________________________________________________________________________________________
Errors     << voxblox:make /opt/ros/melodic/logs/voxblox/build.make.034.log
In file included from /opt/ros/melodic/src/Interactive-Scene-Reconstruction/mapping/voxblox-plusplus/voxblox/voxblox/include/voxblox/core/block.h:9:0,
                 from /opt/ros/melodic/src/Interactive-Scene-Reconstruction/mapping/voxblox-plusplus/voxblox/voxblox/src/core/block.cc:1:
/opt/ros/melodic/build/voxblox/./Block.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
  ^~~~~
/opt/ros/melodic/build/voxblox/./Block.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
  ^~~~~
/opt/ros/melodic/build/voxblox/./Block.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
  ^~~~~
In file included from /opt/ros/melodic/src/Interactive-Scene-Reconstruction/mapping/voxblox-plusplus/voxblox/voxblox/include/voxblox/core/layer.h:9:0,
                 from /opt/ros/melodic/src/Interactive-Scene-Reconstruction/mapping/voxblox-plusplus/voxblox/voxblox/include/voxblox/alignment/icp.h:49,
                 from /opt/ros/melodic/src/Interactive-Scene-Reconstruction/mapping/voxblox-plusplus/voxblox/voxblox/src/alignment/icp.cc:43:
/opt/ros/melodic/build/voxblox/./Block.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
  ^~~~~
/opt/ros/melodic/build/voxblox/./Block.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
  ^~~~~
/opt/ros/melodic/build/voxblox/./Block.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
  ^~~~~

I think it is very weird( laugh cry ). Maybe I should first try to build the standalone Voxblox as you suggest?

@TooSchoolForCool
Copy link
Collaborator

Then I copy the libprotobuf google directory to voxblox directory by using cp -r /miniconda/pkgs/libprotobuf-3.13.0.1-hd408876_0/include/google /opt/ros/melodic/build/voxblox

As you copied the header of protobuf (3.13) to your voxblox root directory, did you remove it after installing the latest version (3.19)?

@DoctorXK
Copy link
Author

DoctorXK commented Apr 11, 2022

Then I copy the libprotobuf google directory to voxblox directory by using cp -r /miniconda/pkgs/libprotobuf-3.13.0.1-hd408876_0/include/google /opt/ros/melodic/build/voxblox

As you copied the header of protobuf (3.13) to your voxblox root directory, did you remove it after installing the latest version (3.19)?

Oh yes I did. I remove /build/voxblox/google every time before I copy a different version into /build/voxblox/ directory. When I copy protobuf 3.17.0 I will get:

...
/opt/ros/melodic/devel/lib/libvoxblox_proto.so: undefined reference to google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/opt/ros/melodic/devel/lib/libvoxblox_proto.so: undefined reference to google::protobuf::internal::VarintParseSlow64(char const*, unsigned int)'
collect2: error: ld returned 1 exit status
make[2]: *** [/opt/ros/melodic/devel/lib/voxblox/tsdf_to_esdf] Error 1
make[1]: *** [CMakeFiles/tsdf_to_esdf.dir/all] Error 2
make: *** [all] Error 2
cd /opt/ros/melodic/build/voxblox; catkin build --get-env voxblox | catkin env -si  /usr/bin/make --jobserver-fds=3,4 -j; cd -

@hmz-15
Copy link
Owner

hmz-15 commented Apr 12, 2022

Seems that there are a few related issues in the Voxblox repo, such as this. While
we used an outdated fork of Voxblox, you can still try using the new dependency protobuf_catkin they provide.

@DoctorXK
Copy link
Author

DoctorXK commented Apr 17, 2022

OK, thanks @hmz-15 @TooSchoolForCool ,
I will try using the new dependency and see if it works. Sorry for didn't get back to this soon :)

@DoctorXK
Copy link
Author

Hi dear authors,
I add protobuf include path into the CPLUS_INCLUDE_PATH in ~/.bashrc,
and add add protobuf lib path into the LIBRARY_PATH in ~/.bashrc.
Retry building and finally get:

[build] Summary: All 21 packages succeeded!
[build]   Ignored:   17 packages were skipped or are skiplisted.
[build]   Warnings:  4 packages succeeded with warnings.
[build]   Abandoned: None.
[build]   Failed:    None.
[build] Runtime: 4 minutes and 4.4 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.

Seems that it complie successfully! :)

@yinloonga
Copy link

@DoctorXK ,which protobuf version you installed. I also tried to install protobuf_catkin , when I recomplied, it showed same errors, libvoxblox_proto.so: undefined reference to google::protobuf::internal::***

@DoctorXK
Copy link
Author

DoctorXK commented Jun 16, 2022

@yinloonga 3.17.0. Maybe you can try add protobuf lib path into the LIBRARY_PATH and LD_LIBRARY_PATH in ~/.bashrc.

@yinloonga
Copy link

well, thank you! I just recompiled the protobuf_catkin package, but your idea is good, I followed your tips and added some Infos to ~/.zshrc.
By the way, my protobuf version is different from yours. But the idea is same.

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

No branches or pull requests

4 participants