ros-install-osx icon indicating copy to clipboard operation
ros-install-osx copied to clipboard

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

Open ejalaa12 opened this issue 7 years ago • 13 comments

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.

ejalaa12 avatar Feb 07 '18 16:02 ejalaa12

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

quinnabrvau avatar Feb 07 '18 20:02 quinnabrvau

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

mikepurvis avatar Feb 07 '18 21:02 mikepurvis

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

quinnabrvau avatar Feb 08 '18 07:02 quinnabrvau

@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 avatar Feb 08 '18 13:02 ejalaa12

@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 ]

ejalaa12 avatar Feb 09 '18 22:02 ejalaa12

@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 ...]

neomanic avatar Feb 13 '18 01:02 neomanic

@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)

ejalaa12 avatar Feb 17 '18 12:02 ejalaa12

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

Karsten1987 avatar Feb 18 '18 06:02 Karsten1987

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

vrgimael avatar Apr 13 '18 01:04 vrgimael

@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.

asimonov avatar May 09 '18 20:05 asimonov

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.

mikepurvis avatar May 09 '18 20:05 mikepurvis

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

Basavaraj-PN avatar Sep 12 '19 04:09 Basavaraj-PN

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.

HochGit avatar Feb 29 '20 06:02 HochGit