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

No definition of [google-mock] for OS [osx] #110

Open
ejalaa12 opened this issue Feb 7, 2018 · 13 comments
Open

No definition of [google-mock] for OS [osx] #110

ejalaa12 opened this issue Feb 7, 2018 · 13 comments

Comments

@ejalaa12
Copy link

ejalaa12 commented Feb 7, 2018

Hello,

I am trying to install ros-lunar for osx with your script.
I did comment the homebrew/science tap. (because it is deprecated)
And I run into this issue while doing the rosdep command:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
roslisp: No definition of [google-mock] for OS [osx]
catkin: No definition of [google-mock] for OS [osx]

Should I build google-mock myself? If so, how do I say to rosdep where to find it?
If not, what should I do ?

Thank you.

@quinnabrvau
Copy link

I'm having the same issue, I tried building google-mock myself but it doesn't seem to reference it still

@mikepurvis
Copy link
Owner

mikepurvis commented Feb 7, 2018

Homebrew doesn't package gtest/gmock because the maintainers explicitly recommend against doing so— they're prefer you vendor the source into your projects rather than having a globally-installed version.

Vendoring is not the preferred ROS approach, so GTest is presently handled by a formula on the ros/deps tap, here: https://github.com/ros/homebrew-deps/blob/master/gtest.rb

GMock should be handled the same way.

In the very immediate, if you've already built and install GMock yourself, you can modify your rosdeps.yaml overlay file to blank out the dependency, similar to how we do for opencv and qt:

https://github.com/mikepurvis/ros-install-osx/blob/master/rosdeps.yaml

@quinnabrvau
Copy link

quinnabrvau commented Feb 8, 2018

I got through this by installing gmock manually and adding this to the rosdep.yaml
I'm not sure if this is the right thing to do? but it looks like opencv
google-mock:
osx:
homebrew:
packages: []

i got a build error later on python_orocos_kdl
Failed << python_orocos_kdl:cmake [ Exited with code 1 ]
Failed <<< python_orocos_kdl [ 2.6 seconds ]

w/ more information
Errors << python_orocos_kdl:cmake /Users/quinn/ros-install-osx/lunar_desktop_full_ws/logs/python_orocos_kdl/build.cmake.000.log
Traceback (most recent call last):
File "/Users/quinn/ros-install-osx/lunar_desktop_full_ws/src/orocos_kinematics_dynamics/python_orocos_kdl/cmake/FindSIP.py", line 8, in
import sipconfig
ImportError: No module named sipconfig
CMake Error at /Users/quinn/ros-install-osx/lunar_desktop_full_ws/src/orocos_kinematics_dynamics/python_orocos_kdl/cmake/FindSIP.cmake:63 (MESSAGE):
Could not find SIP
Call Stack (most recent call first):
CMakeLists.txt:13 (find_package)

I'm going to have to look at it another time

@ejalaa12
Copy link
Author

ejalaa12 commented Feb 8, 2018

@mikepurvis Great! I blanked the dependency as proposed. and it worked! I am now stuck during compilation for xmlrpcpp. I will look into it later. But I guess that's another issue. Thank you 👍

So what could be a long-term solution for Gmock ?

@ejalaa12
Copy link
Author

ejalaa12 commented Feb 9, 2018

@quinnabrvau maybe you need to install SIP with pip: pip install SIP. Were you able to compile the xmlrpcpp package? If so how did you do?

I just had a look for the compilation error for xmlrpcpp, it is actually because it cannot find where I installed gmock. I guess I have to modify the CMakeLists.txt of the xmlrpcpp package, but I'm not sure on how to do that.

So far what I did is to modify the CMakeLists.txt of the xmlrpcpp package to add these two lines:

include_directories(
  include
  libb64/include
  ${catkin_INCLUDE_DIRS}
  # added this line (include folder of my gmock build)
  /Users/ejalaa/Development/ros_installation/googletest-master/mybuild/install_dir/include
)
link_directories(
  ${catkin_LIBRARY_DIRS}
  # added this line (lib folder of my gmock build)
  /Users/ejalaa/Development/ros_installation/googletest-master/mybuild/install_dir/lib
)

but that ends with the following error:

Errors     << xmlrpcpp:make /Users/ejalaa/Development/ros_installation/ros-install-osx/lunar_desktop_full_ws/logs/xmlrpcpp/build.make.010.log
Undefined symbols for architecture x86_64:
  "XmlRpc::XmlRpcValue::invalidate()", referenced from:
      XmlRpc::XmlRpcValue::operator=(char const*) in test_fixtures.cpp.o
  "XmlRpc::XmlRpcValue::operator=(XmlRpc::XmlRpcValue const&)", referenced from:
      XmlRpc::XmlRpcValue::operator=(char const*) in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServer::bindAndListen(int, int)", referenced from:
      XmlRpcTest::SetUp() in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServer::enableIntrospection(bool)", referenced from:
      XmlRpcTest::SetUp() in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServer::work(double)", referenced from:
      XmlRpcTest::work() in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServer::shutdown()", referenced from:
      XmlRpcTest::TearDown() in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServer::XmlRpcServer()", referenced from:
      XmlRpcTest::XmlRpcTest() in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServer::~XmlRpcServer()", referenced from:
      XmlRpcTest::XmlRpcTest() in test_fixtures.cpp.o
      XmlRpcTest::~XmlRpcTest() in test_fixtures.cpp.o
  "XmlRpc::setVerbosity(int)", referenced from:
      XmlRpcTest::TearDown() in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServerMethod::XmlRpcServerMethod(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, XmlRpc::XmlRpcServer*)", referenced from:
      Hello::Hello(XmlRpc::XmlRpcServer*) in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServerMethod::~XmlRpcServerMethod()", referenced from:
      XmlRpcTest::XmlRpcTest() in test_fixtures.cpp.o
      Hello::~Hello() in test_fixtures.cpp.o
      Hello::~Hello() in test_fixtures.cpp.o
      Hello::Hello(XmlRpc::XmlRpcServer*) in test_fixtures.cpp.o
      XmlRpcTest::~XmlRpcTest() in test_fixtures.cpp.o
  "testing::Test::Test()", referenced from:
      XmlRpcTest::XmlRpcTest() in test_fixtures.cpp.o
  "testing::Test::~Test()", referenced from:
      XmlRpcTest::XmlRpcTest() in test_fixtures.cpp.o
      XmlRpcTest::~XmlRpcTest() in test_fixtures.cpp.o
  "typeinfo for XmlRpc::XmlRpcServerMethod", referenced from:
      typeinfo for Hello in test_fixtures.cpp.o
  "typeinfo for testing::Test", referenced from:
      typeinfo for XmlRpcTest in test_fixtures.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/ejalaa/Development/ros_installation/ros-install-osx/lunar_desktop_full_ws/devel/.private/xmlrpcpp/lib/libtest_fixtures.dylib] Error 1
make[1]: *** [test/CMakeFiles/test_fixtures.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
cd /Users/ejalaa/Development/ros_installation/ros-install-osx/lunar_desktop_full_ws/build/xmlrpcpp; catkin build --get-env xmlrpcpp | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
..................................................................................................................................................................................
Failed     << xmlrpcpp:make                                   [ Exited with code 2 ]
Failed    <<< xmlrpcpp                                        [ 17.4 seconds ]

@neomanic
Copy link

@ejalaa12 I'm having the same issue. This isn't because the build can't find gmock but rather because when building the tests it tries to link them against the symbols from libxmlrpcpp.dylib (which is in /ros-install-osx/lunar_desktop_full_ws/devel/.private/xmlrpcpp/lib) but said newly-built library isn't passed to the link command.

I'm not smart enough to quickly figure out how to fix this, so I've just skipped building the tests for xmlrpcpp by commenting out the last 3 lines in CMakelists.txt starting with if (CATKIN_ENABLE_TESTING) and now it builds. (And I'm on to the next error, but that's a different story.)

My build log from running catkin build -v --start-with xmlrpcpp:

cd /Users/Josh/Code/ros-install-osx/lunar_desktop_full_ws/build/xmlrpcpp/test && /usr/local/Cellar/cmake/3.10.2/bin/cmake -E cmake_link_script CMakeFiles/test_fixtures.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names  -o /Users/Josh/Code/ros-install-osx/lunar_desktop_full_ws/devel/.private/xmlrpcpp/lib/libtest_fixtures.dylib -install_name /Users/Josh/Code/ros-install-osx/lunar_desktop_full_ws/devel/.private/xmlrpcpp/lib/libtest_fixtures.dylib CMakeFiles/test_fixtures.dir/test_fixtures.cpp.o  -L/opt/ros/lunar/lib /usr/local/lib/libboost_system-mt.dylib /usr/local/lib/libboost_thread-mt.dylib /usr/local/lib/libboost_chrono-mt.dylib /usr/local/lib/libboost_date_time-mt.dylib /usr/local/lib/libboost_atomic-mt.dylib 
Undefined symbols for architecture x86_64:
  "XmlRpc::XmlRpcValue::invalidate()", referenced from:
      XmlRpc::XmlRpcValue::operator=(char const*) in test_fixtures.cpp.o
  "XmlRpc::XmlRpcValue::operator=(XmlRpc::XmlRpcValue const&)", referenced from:
      XmlRpc::XmlRpcValue::operator=(char const*) in test_fixtures.cpp.o
  "XmlRpc::XmlRpcServer::bindAndListen(int, int)", referenced from:
      XmlRpcTest::SetUp() in test_fixtures.cpp.o

[... snip the rest, it's just more missing symbols ...]

@ejalaa12
Copy link
Author

@neomanic Thank you! I also commented these test so I can continue the installation as well. I managed to solve the next errors and it compiled successfully.

However now that I run the roscore I get the following error:
libc++abi.dylib: terminating with uncaught exception of type std::length_error: vector
I'm still to figure out where it comes from. (also another story i guess)

@Karsten1987
Copy link

I've just run into the same problem (std::length_error). Don't really have a clue yet where it actually comes from.

@vrgimael
Copy link

Running into the same problem... Any news here?

@asimonov
Copy link

asimonov commented May 9, 2018

@mikepurvis,

great work!

but why would you not simply add --skip-keys gtest --skip-keys google-mock to rosdep install? and also set -DCATKIN_ENABLE_TESTING=0 in catkin config

this is what i have to manually do to get it working.

@mikepurvis
Copy link
Owner

There used to be a big raft of --skip-keys flags; adding a rosdep file of overrides is functionally equivalent but IMO more flexible, since it lets you do things like change a key to map to something else (as with Gazebo).

I have a mixed relationship with CATKIN_ENABLE_TESTING— in the past there have been packages which would fail to configure when you set it to zero. If that's better these days, we can add it again.

@Basavaraj-PN
Copy link

rosdep install --from-paths src --ignore-src --skip-keys python-wxtools --skip-keys google-mock --rosdistro kineti

@HochGit
Copy link

HochGit commented Feb 29, 2020

rosdep install --from-paths src --ignore-src --skip-keys python-wxtools --skip-keys google-mock --rosdistro kinetic

Great answer! it works for me, I think you might have missed a letter c at the end.

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

9 participants