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

rostime, sensor_msgs, geometry_msgs and others fail to build because of -lpthread (or cpp_common?) #711

Open
pholthaus opened this issue Dec 3, 2018 · 16 comments

Comments

@pholthaus
Copy link
Contributor

Hi,

I am experiencing strange build errors with various packages on a computer on which I try to install fresh ROS (both kinetic and melodic). Thanks for your help and please tell me what further information you need.

Output for rostime as a reference:

* Package:    ros-kinetic/rostime-0.6.11
 * Repository: ros-overlay
 * Maintainer: hunter@openrobotics.org
 * Upstream:   dthomas@osrfoundation.org https://github.com/ros-gbp/roscpp_core/issues
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python2_7 python_targets_python3_6 userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking rostime-kinetic-release-0.6.11.tar.gz to /var/tmp/portage/ros-kinetic/rostime-0.6.11/work
>>> Source unpacked in /var/tmp/portage/ros-kinetic/rostime-0.6.11/work
>>> Preparing source in /var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11 ...
>>> Working in BUILD_DIR: "/var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11_build"
cmake -C /var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11_build/gentoo_common_config.cmake -G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DCATKIN_ENABLE_TESTING=0 -DCATKIN_BUILD_BINARY_PACKAGE=1 -DCMAKE_PREFIX_PATH=/opt/ros/kinetic -DCMAKE_INSTALL_PREFIX=/opt/ros/kinetic -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11_build/gentoo_toolchain.cmake  /var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11
loading initial cache file /var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11_build/gentoo_common_config.cmake
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11_build/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python (found version "2.7.15") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using default Python package layout
-- Found PY_em: /usr/lib64/python2.7/site-packages/em.pyc  
-- Using empy: /usr/lib64/python2.7/site-packages/em.pyc
-- Using CATKIN_ENABLE_TESTING: 0
-- catkin 0.7.14
CMake Error at /opt/ros/kinetic/share/cpp_common/cmake/cpp_commonConfig.cmake:148 (message):
  Project 'rostime' tried to find library '-lpthread'.  The library is
  neither a target nor built/installed properly.  Did you compile project
  'cpp_common'? Did you find_package() it before the subdirectory containing
  its code is included?
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11_build/CMakeFiles/CMakeOutput.log".
 * ERROR: ros-kinetic/rostime-0.6.11::ros-overlay failed (configure phase):
 *   cmake failed
 * 
 * Call stack:
 *     ebuild.sh, line  124:  Called src_configure
 *   environment, line 4108:  Called ros-cmake_src_configure
 *   environment, line 4005:  Called cmake-utils_src_configure
 *   environment, line 1102:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";
 * 
 * If you need support, post the output of `emerge --info '=ros-kinetic/rostime-0.6.11::ros-overlay'`,
 * the complete build log and the output of `emerge -pqv '=ros-kinetic/rostime-0.6.11::ros-overlay'`.
 * The complete build log is located at '/var/tmp/portage/ros-kinetic/rostime-0.6.11/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/ros-kinetic/rostime-0.6.11/temp/environment'.
 * Working directory: '/var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11_build'
 * S: '/var/tmp/portage/ros-kinetic/rostime-0.6.11/work/rostime-0.6.11'
@allenh1
Copy link
Contributor

allenh1 commented Dec 4, 2018

Hey, not sure what's causing this issue.

allenh1@hunter-laptop ~
$ superflore-check-ebuilds --ros-distro kinetic --pkgs rostime
>>>> testing gentoo package integrity
>>>> Working in temporary directory /tmp/tmp13ss5zu7
>>>> Running container with command string 'bash -c 'emaint sync -r ros-overlay &>> /tmp/tmp13ss5zu7/log.txt && emerge ros-kinetic/rostime &>> /tmp/tmp13ss5zu7/log.txt''...
>>>> Docker container exited.
>>>> Cleaning up temporary directory /tmp/tmp13ss5zu7
>>>>   'ros-kinetic/rostime': building

Currently building in the docker container & on my machine... Maybe rebuild cpp_common?

@pholthaus
Copy link
Contributor Author

I'm not sure either. A rebuild of cpp_common did not help. The system itself has been set up quite a long time ago. Will report back after a system rebuild (--emptytree).

@pholthaus
Copy link
Contributor Author

The problem is related to the new cmake version and will be fixed with newer catkin, see ros/catkin#975
For now, it helped to downgrade to dev-util/cmake-3.13.1 and re-emerge cpp_common. I leave the bug open for reference, maybe we want to create a patch (see catkin PR) in the meantime?

awesomebytes added a commit to awesomebytes/ros-overlay that referenced this issue Dec 6, 2018
@awesomebytes
Copy link
Collaborator

I'm finding the same problem (in Gentoo Prefix, amd64 & x86).

I needed to downgrade from dev-util/cmake-3.13.1 adding package.mask rule for >=dev-util/cmake-3.13.0 (I also tried >=dev-util/cmake-3.13.1 but that wasn't enough). And re-emerging ros-kinetic/cpp_common then ros-kinetic/rostime worked.

And by the looks of the issue ros/catkin#856 where they discuss patching catkin for this case... I don't think this is going to be patched anytime soon. If we are the only affected maybe we should indeed add our patch that does what they do here https://github.com/ros/catkin/pull/975/files . That would really bring the experience more closer to just emerge ros-kinetic/ros_base and it works. So I've just done that: #714

I tested it on Gentoo Prefix amd64 (over Ubuntu 16.04). Soon to have results on x86 too.

@pholthaus
Copy link
Contributor Author

I needed to downgrade from dev-util/cmake-3.13.1 adding package.mask rule for >=dev-util/cmake-3.13.0 (I also tried >=dev-util/cmake-3.13.1 but that wasn't enough). And re-emerging ros-kinetic/cpp_common then ros-kinetic/rostime worked.

Sorry, that's exactly what I meant. However, ros-kinetic/pluginlib for example still doesn't compile. I guess I need to rebuild some other dependency for that to work, too.

So I've just done that: #714

Great, thank you. I will test it later today!

pholthaus added a commit to pholthaus/gentoo-patches that referenced this issue Dec 6, 2018
allenh1 pushed a commit that referenced this issue Dec 6, 2018
@awesomebytes
Copy link
Collaborator

If pluginlib is part of ros_base I can tell you it works (as I setup CI that emerges all ros_base on Gentoo Prefix amd64 and x86 and it currently contains that patch until it's officially merged).

@pholthaus
Copy link
Contributor Author

Great, I can confirm your patch works (applied from /etc/portage/patches) at least for the packages mentioned here. Thank you!

@pholthaus
Copy link
Contributor Author

I still run into trouble with ros-kinetic/qt_gui_core although I have the patch applied and dev-util/cmake-3.12.3:0 installed. Can anyone reproduce this?

x86_64-pc-linux-gnu-g++ -c -std=c++11 -O2 -pipe -march=native -mtune=generic -fPIC -Wall -W -D_REENTRANT -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11/src/qt_gui_cpp_sip/../../include -I/opt/ros/kinetic/include -I/usr/include -I/usr/include/python2.7 -I/usr/share/qt5/mkspecs/linux-g++ -I/usr/include/qt5/QtCore -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5 -I/usr/X11R6/include -o siplibqt_gui_cpp_sipqt_gui_cpp.o siplibqt_gui_cpp_sipqt_gui_cpp.cpp
x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,--as-needed -Wl,-rpath,"/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7/devel/lib" -shared -Wl,-rpath,/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7/devel/lib -Wl,-rpath,/usr/lib64 -Wl,--version-script="/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7/devel/lib64/python2.7/site-packages/qt_gui_cpp/libqt_gui_cpp_sip".exp -o "/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7/devel/lib64/python2.7/site-packages/qt_gui_cpp/libqt_gui_cpp_sip".so siplibqt_gui_cpp_sipcmodule.o siplibqt_gui_cpp_sipQList0101qt_gui_cppPluginProvider.o siplibqt_gui_cpp_sipQList0101qt_gui_cppPluginDescriptor.o siplibqt_gui_cpp_sipQMap0100QString0100QString.o siplibqt_gui_cpp_sipqt_gui_cppSettings.o siplibqt_gui_cpp_sipqt_gui_cppRosPluginlibPluginProvider_ForPlugins.o siplibqt_gui_cpp_sipqt_gui_cppRosPluginlibPluginProvider_ForPluginProviders.o siplibqt_gui_cpp_sipqt_gui_cppRecursivePluginProvider.o siplibqt_gui_cpp_sipqt_gui_cppPluginDescriptor.o siplibqt_gui_cpp_sipqt_gui_cppPluginContext.o siplibqt_gui_cpp_sipqt_gui_cppPluginBridge.o siplibqt_gui_cpp_sipqt_gui_cppPlugin.o siplibqt_gui_cpp_sipqt_gui_cppGenericProxy.o siplibqt_gui_cpp_sipqt_gui_cppCompositePluginProvider.o siplibqt_gui_cpp_sipqt_gui_cppPluginProvider.o siplibqt_gui_cpp_sipqt_gui_cpp.o -L/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7/devel/lib -L/usr/lib64 -L/usr/X11R6/lib -lqt_gui_cpp /usr/lib/libtinyxml2.so /opt/ros/kinetic/lib/libclass_loader.so /usr/lib/libPocoFoundation.so /usr/lib/libdl.so /opt/ros/kinetic/lib/librosconsole.so /opt/ros/kinetic/lib/librosconsole_log4cxx.so /opt/ros/kinetic/lib/librosconsole_backend_interface.so /usr/lib/liblog4cxx.so /usr/lib/libboost_regex-mt.so /opt/ros/kinetic/lib/librostime.so /opt/ros/kinetic/lib/libcpp_common.so /usr/lib/libboost_thread-mt.so -l-lpthread /usr/lib/libboost_chrono-mt.so /usr/lib/libboost_date_time-mt.so /usr/lib/libboost_atomic-mt.so /usr/lib64/libconsole_bridge.so.0.4 /opt/ros/kinetic/lib/libroslib.so /opt/ros/kinetic/lib/librospack.so /usr/lib/libpython2.7.so /usr/lib/libboost_filesystem-mt.so /usr/lib/libboost_program_options-mt.so /usr/lib/libboost_system-mt.so /usr/lib/libtinyxml.so /usr/lib/libboost_filesystem-mt.so /usr/lib/libboost_system-mt.so -lQt5Core -lpthread -lQt5Gui -lQt5Core -lpthread -lQt5Widgets -lQt5PrintSupport -lXext -lX11 -lm -lpthread
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -l-lpthread
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:38: "/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7/devel/lib64/python2.7/site-packages/qt_gui_cpp/libqt_gui_cpp_sip".so] Error 1
make[3]: Leaving directory '/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7/sip/qt_gui_cpp_sip'
make[2]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:61: devel/lib64/python2.7/site-packages/qt_gui_cpp/libqt_gui_cpp_sip.so] Error 2
make[2]: Leaving directory '/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7'
make[1]: *** [CMakeFiles/Makefile2:284: src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7'
make: *** [Makefile:130: all] Error 2
 * ERROR: ros-kinetic/qt_gui_cpp-0.3.11::ros-overlay failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=ros-kinetic/qt_gui_cpp-0.3.11::ros-overlay'`,
 * the complete build log and the output of `emerge -pqv '=ros-kinetic/qt_gui_cpp-0.3.11::ros-overlay'`.
 * The complete build log is located at '/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/temp/environment'.
 * Working directory: '/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11_build-python2_7'
 * S: '/var/tmp/portage/ros-kinetic/qt_gui_cpp-0.3.11/work/qt_gui_cpp-0.3.11'

@pholthaus
Copy link
Contributor Author

The following steps finally got me around this issue:

  • Apply your patch (which is in the overlay now, I guess)
  • Mask >dev-util/cmake-3.12.3 and downgrade it to this version
  • Rebuild everything from the overlay: emerge -av1 $(equery a -F '=$cpv' repository ros-overlay)
  • emerge ros-kinetic/desktop_full

@awesomebytes
Copy link
Collaborator

I still run into trouble with ros-kinetic/qt_gui_core although I have the patch applied and dev-util/cmake-3.12.3:0 installed. Can anyone reproduce this?
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -l-lpthread

I just reproduced this. I needed to downgrade cmake as you said @pholthau . Then re-emerge all the used packages in qt_gui_cpp and it worked. Whenever I finish the full desktop emerge I'll setup CI for it.

@awesomebytes
Copy link
Collaborator

@pholthau @allenh1 have you been able to emerge dev-qt/qtwebkit-5.212.0_pre20180120? It is a dependency for ros-kinetic/desktop and I'm finding no way to get it to compile...

I'm in a loop of ruby failing, adding rubygems, still failing, breaking the ruby setup, changing with eselect the version of ruby but not doing any difference...

The main error I get is:

/home/user/gentoo/usr/lib64/ruby/2.4.0/rubygems.rb:17:in `require': cannot load such file -- rubygems/compatibility (LoadError)
        from /home/user/gentoo/usr/lib64/ruby/2.4.0/rubygems.rb:17:in `<top (required)>'
        from <internal:gem_prelude>:4:in `require'
        from <internal:gem_prelude>:4:in `<internal:gem_prelude>'
 * ERROR: dev-ruby/minitest-5.11.3::gentoo failed (install phase):
 *   Unable to generate gemspec file.

Which I get with ruby 23, 24 and I can't emerge 25 cause it fails on the process with that same error.

Any idea?

@allenh1
Copy link
Contributor

allenh1 commented Dec 13, 2018

No idea... That's likely a 32bit problem or a prefix problem though. I definitely have some version of qtwebkit, just not sure which.

@awesomebytes
Copy link
Collaborator

@allenh1 It's happening on amd64 and x86 on Prefix. I'm re-building with some updates... I hope to have a reproducible docker environment soon if anyone can help at that point.

@pholthaus
Copy link
Contributor Author

@pholthau @allenh1 have you been able to emerge dev-qt/qtwebkit-5.212.0_pre20180120? It is a dependency for ros-kinetic/desktop and I'm finding no way to get it to compile...

I have it installed with the following configuration:

$ emerge -1 qtwebkit

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-qt/qtwebkit-5.212.0_pre20180120:5/5.212::gentoo  USE="X gstreamer hyphen jit opengl printsupport qml -geolocation (-gles2) -multimedia -nsplugin -orientation -webp" 0 KiB

ruby as follows /etc/portage/make.conf:

RUBY_TARGETS="$RUBY_TARGETS ruby24 ruby25"
$ eselect ruby list
Available Ruby profiles:
  [1]   ruby23 (with Rubygems)
  [2]   ruby24 (with Rubygems) *
  [3]   ruby25 (with Rubygems)

Hope that helps. I'm remerging right now. Will report back if it fails, otherwise just assume it compiles fine.

@awesomebytes
Copy link
Collaborator

@pholthau I ended up adding a package.provided for dev-qt/qtwebkit-5.212.0_pre20180120. My ruby packages seem to be broken and I can't find a way to make them work. I need to reproduce it and ask for help in Gentoo.

@jwhendy
Copy link

jwhendy commented Jan 17, 2019

Just wanted to confirm that this affects Arch linux as well. In a recent effort to install ros-melodic-ros-base, I found I needed to downgrade to cmake 3.12.3-1 as well as boost/boost-libs 1.68.0-2 on various packages. I think it's more than just this package, but the fix was the same. Cross-posting to ROS Answers post here as perhaps once there is a known resolution we can work together on it.

Let me know if I can test anything for you in order to help.

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