ROS2 colcon build failure - cmake

Win10 x64, ROS 2 - Humble, VS 2019
I'm going through the ROS beginners tutorials but I've run into problem building packages with colcon and got as far as the Using colcon to build packages tutorial.
I'm running as admin from a VS 2019 command line, I sourced ros2 by running the local_setup.bat file. I installed the colcon extensions, downloaded the examples & set up the directory structure as outlined in the tutorial.
I then tried to build colcon using colcon build --symlink-install --merge-install
Which after installing a few packages complains & aborts the build with,
--- stderr: examples_rclcpp_minimal_publisher
Traceback (most recent call last):
File "C:\ROS_Humble\ros2\share\ament_cmake_core\cmake\core\package_xml_2_cmake.py", line 22, in <module>
from catkin_pkg.package import parse_package_string
ModuleNotFoundError: No module named 'catkin_pkg'
CMake Error at C:/ROS_Humble/ros2/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:95 (message):
execute_process(C:/ProgramData/Anaconda3/python.exe
C:/ROS_Humble/ros2/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py
D:/ROS_scratch/dev/ros2_ws/src/examples/rclcpp/topics/minimal_publisher/package.xml
D:/ROS_scratch/build/examples_rclcpp_minimal_publisher/ament_cmake_core/package.cmake)
returned error code 1
Call Stack (most recent call first):
C:/ROS_Humble/ros2/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:49 (_ament_package_xml)
C:/ROS_Humble/ros2/share/ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake:31 (ament_package_xml)
CMakeLists.txt:47 (ament_lint_auto_find_test_dependencies)
Anyone know what this is about? I've seen a few posts around about people not sourcing ros2 in the right environment but that isn't the issue here.

I would start by trying to obtain the catkin_pkg module and making sure it's installed, based on:
ModuleNotFoundError: No module named 'catkin_pkg'
Apparently this should do the trick: pip install -U catkin_pkg
If that doesn't help then I will update my answer with hints on how to debug this to get more information for us.

Related

Colcon build error in px4_ros_com package for ros2 humble on ubuntu 22.04

As specified in the title I am trying to build px4_ros_com for ros2 humble. I went through the px4 tutorial and followed it pretty closely, however when I colcon build px4_ros_com I get the following error
CMake Error at /home/XXXX/px4_ros_com_ros2/install/px4_msgs/share/px4_msgs/cmake/ament_cmake_export_targets-extras.cmake:18 (message):
Failed to find exported target names in
'/home/XXXX/px4_ros_com_ros2/install/px4_msgs/share/px4_msgs/cmake/export_px4_msgs__rosidl_generator_cExport.cmake'
Call Stack (most recent call first):
/home/XXXX/px4_ros_com_ros2/install/px4_msgs/share/px4_msgs/cmake/px4_msgsConfig.cmake:41 (include)
CMakeLists.txt:24 (find_package)
Any help would be appreciated!
I made sure of the following:
Fast-RTPS-Gen is version 1.0.4
Java version is 11.0.17
ros2 is sourced
This was a bug in ament_cmake that was fixed in the most recent version of ament_cmake (1.3.3).
Make sure you upgrade your packages with:
apt update
apt upgrade
After upgrading, check your ament_cmake version with:
ros2 pkg xml ament_cmake | grep version
If you see the following, or a newer version, this bug should be fixed:
<version>1.3.3</version>

Poetry installed but `poetry: command not found` on Google Colab

I was following this github, where it gave me the following instructions:
Project was built with poetry (https://python-poetry.org/), so it is
recommended to get poetry first to install all the dependencies. After
poetry installation you can simply clone this repo, navigate to the
root directory, and run:
From the website I ran this command:
!curl -sSL https://install.python-poetry.org | python3 -
After executing this I get the following prompt:
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
/root/.local/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing Poetry (1.1.15)
Installing Poetry (1.1.15): Creating environment
Installing Poetry (1.1.15): Installing Poetry
Installing Poetry (1.1.15): Creating script
Installing Poetry (1.1.15): Done
Poetry (1.1.15) is installed now. Great!
To get started you need Poetry's bin directory (/root/.local/bin) in your `PATH`
environment variable.
Add `export PATH="/root/.local/bin:$PATH"` to your shell configuration file.
Alternatively, you can call Poetry explicitly with `/root/.local/bin/poetry`.
You can test that everything is set up by executing:
`poetry --version`
Thus, I ran the following command next:
!export PATH="/root/.local/bin:$PATH"
This gave no issues. But, after running poetry --version. It gave me the following error prompt:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-25-4666e7fa95ae> in <module>
----> 1 poetry --version
NameError: name 'poetry' is not defined
Can anyone help how to run this? I am new to colab. I got a similar question here. But, it is not working in my case.
Using something like this: !/root/.local/bin/poetry --version is working, but how do I add that $PATH in the shell configuration file in colab, so I don't have to call it by using the path before it every time?

Building OSRM on Ubuntu, CMake fails with "Intel TBB NOT found!" message

I am following this tutorial to build OSRM-backend from source.
When it says:
cd build
cmake /srv/osrm/osrm-backend/
I got this error message:
ERROR: Intel TBB NOT found!
-- Looked for Threading Building Blocks in /usr
CMake Error at cmake/FindTBB.cmake:274 (message):
Could NOT find TBB library.
Call Stack (most recent call first):
CMakeLists.txt:533 (find_package)
I have installed TBB:
sudo apt install -y libtbb
And it looks good:
/usr/lib/x86_64-linux-gnu/libtbb.so
/usr/lib/x86_64-linux-gnu/libtbb.so.2
(...)
But cmake fails.
I'd go to the file from the error message and see that it can't find the library at some default paths.
It means we have to help cmake a bit. At the beginning we can see that this module respects TBB_INSTALL_DIR. So I'd try setting it while configuring the project.
It's hard to find the solution, althought, it says, there're duplications:
This is a duplicate of #6248 and #6253. Building with
cmake -DENABLE_MASON=ON will fix it.
Surprisingly, on MacOS, there's a simple workaround:
brew install osrm-backend

Tensorflow Install and Bezel Problems at Last Step

Trying to install Tensorflow with Bezel and having a tough time at this final build step. Ubuntu 16.04, Cuda 8, cuDNN 5.1.
Here are the official install instructions I'm following:
https://www.tensorflow.org/install/install_sources#ConfigureInstallation
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package':
error loading package 'tensorflow/tools/pip_package': Encountered
error while reading extension file 'cuda/build_defs.bzl': no such
package '#local_config_cuda//cuda': Traceback (most recent call last):
I'm not sure what the '//tensorflow' directory is, but it actually picks up packages if I use '~/tensorflow' instead. It still fails though trying to pick up more than 3, and I'm assuming it's because of some path issue. I could really use another set of eyes.

lxml on python-3.3.0 ImportError: undefined symbol: xmlBufContent

I am having a hard time installing lxml(3.1.0) on python-3.3.0. It installs without errors and I can see the lxml-3.1.0-py3.3-linux-i686.egg in the correct folder (/usr/local/lib/python3.3/site-packages/), but when I try to import etree, I get this:
from lxml import etree
Traceback (most recent call last):
File "", line 1, in
ImportError: /usr/local/lib/python3.3/site-packages/lxml-3.1.0-py3.3-linux-i686.egg/lxml/etree.cpython-33m.so: undefined symbol: xmlBufContent
I did try to install with apt-get, I tried "python3 setup.py install" and I did via easy_install. I have to mention that I have 3 versions installed (2.7, 3.2.3 and 3.3.0.), but I am too much of a beginner to tell if this has to do with it.
I did search all over, but I could not find any solution to this.
Any help is greatly appreciated!
best,
Uhru
You should probably mention the specific operating system you're trying to install on, but I'll assume it's some form of Linux, perhaps Ubuntu or Debian since you mention apt-get.
The error message you mention is typical on lxml when the libxml2 and/or libxslt libraries are not installed for it to link with. For whatever reason, the install procedure does not detect when these are not present and can give the sense the install has succeeded even though those dependencies are not satisfied.
If you issue apt-get install libxml2 libxml2-dev libxslt libxslt-dev that should eliminate this error.