I mostly followed mikepurvis's notes and plusk01's notes.
- https://github.com/mikepurvis/ros-install-osx
- https://gist.github.com/plusk01/bb92f6159c0818000865784abfd2a584
- http://wiki.ros.org/kinetic/Installation/OSX/Homebrew/Source
- mikepurvis/ros-install-osx#74
- mikepurvis/ros-install-osx#73 (comment)
brew install qt
https://github.com/cartr/homebrew-qt4
CMake Error at src/qt_gui_cpp/CMakeLists.txt:3 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake
Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.
Qt5Widgets is not new in Qt (http://stackoverflow.com/questions/23979798/include-qtwidgets-not-working-in-qt-4) so we can ignore / fallback on previous version.
Try 4.4 from the unofficial official tutorial:
More Qt naming issues During the build process, ld complains about
-lQtCore
et al. In bothbuild_isolated/qt_gui_cpp/sip/qt_gui_cpp_sip/Makefile
and >devel_isolated/rviz/bin/sip/rviz_sip/Makefile
, the LIBS variable needs the-lQtX
flags changed to/usr/local/lib/QtX.framework/QtX
(were at end of line).
The PyQt4 way
This one is straightforward, but the fix I used was hacky. I have downloaded PyQt4 (brew install pyqt4-no-webkit
), and PyQt5 (brew install pyqt5
). I noticed that using python
in the console, I could get import PyQt4
to work since qmake --version
was telling me I had 4.8.7
. So I decided to go into src/python_qt_binding/cmake/sip_configure.py
and change from PyQt5 import QtCore
to from PyQt4 import QtCore
. That seemed to fix this issue. Also in the same file on line 58, changed it to sip_dir = ls ['default_sip_dir'] + '/PyQt4'
The PyQt5 way
i did
brew uninstall pyqt5
then i did
brew install pyqt5 --with-python --without-python3
because ROS kinetic is built with python 2.7
RuntimeError: the sip module implements API v12.0 but the PyQt5.QtCore module requires API v12.1
make sure that sip
is the same version. mine was not. comapre sip -V
with
from sip import SIP_VERSION_STR
print("SIP version:", SIP_VERSION_STR)
go to /src/src/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/qt_gui_cpp.sip
and delete the line %Import QtWidgets/QtWidgetsmod.sip
.
If this comes back to haunt me later, include the old Qt4 version of QtWidgets (I think it's called like QClass
or something
Errors << nodelet_tutorial_math:make /Users/clloyd/ros-install-t2/indigo_desktop_full_ws/logs/nodelet_tutorial_math/build.make.001.log
In file included from /Users/clloyd/ros-install-t2/indigo_desktop_full_ws/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /opt/ros/indigo/include/pluginlib/class_list_macros.h:40:
In file included from /opt/ros/indigo/include/class_loader/class_loader.h:33:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:23:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:610:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:79:9: error: no member named 'strcoll' in the global namespace
using ::strcoll;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:80:9: error: no member named 'strxfrm' in the global namespace
using ::strxfrm;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:82:9: error: no member named 'memchr' in the global namespace; did you mean 'wmemchr'?
using ::memchr;
~~^
/usr/include/wchar.h:150:10: note: 'wmemchr' declared here
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
^
I followed (mikepurvis/ros-install-osx#73 (comment)) and did:
catkin config --install --install-space ${ROS_INSTALL_DIR} --cmake-args \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCATKIN_ENABLE_TESTING=1 \
...
Which seemed to do the trick and fix it.
rosdep install --from-paths src --ignore-src --rosdistro kinetic -y --as-root pip:yes --skip-keys "libqt5-core libqt5-gui libqt5-opengl libqt5-opengl-dev libqt5-widgets qt5-qmake qtbase5-dev gazebo"
build command 1 (as per unofficial official guide)
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_BUILD_TYPE=Release
build command 2 (as per mikepurvis install script)
catkin config --install --cmake-args \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCATKIN_ENABLE_TESTING=1 \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_LIBRARY=$(python -c "import sys; print sys.prefix")/lib/libpython2.7.dylib \
-DPYTHON_INCLUDE_DIR=$(python -c "import sys; print sys.prefix")/include/python2.7
catkin build --limit-status-rate 1