Closed torbenf closed 3 years ago
Just because we had recently an issue with spdlog and clang (cf. https://github.com/micro-ROS/micro-ROS-Agent/issues/54): Which compiler are you using?
The problem seems to be the /usr/local/lib/libspdlog.a
. Normally, it is built during ros2 run micro_ros_setup build_agent.sh
inside the workspace and this version is used for linking the agent executable. Can you please check whether there is a libspdlog.a
in [your_micro-ROS_workspace]/build
using find . -name libspdlog.a
?
gcc --version
yields:
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
and
g++ --version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
dpkg --list | grep compiler
gives me:
ii clang 1:10.0-50~exp1 amd64 C, C++ and Objective-C compiler (LLVM based)
ii clang-10 1:10.0.0-4ubuntu1 amd64 C, C++ and Objective-C compiler
ii g++ 4:9.3.0-1ubuntu2 amd64 GNU C++ compiler
ii g++-9 9.3.0-17ubuntu1~20.04 amd64 GNU C++ compiler
ii gcc 4:9.3.0-1ubuntu2 amd64 GNU C compiler
ii gcc-7 7.5.0-6ubuntu2 amd64 GNU C compiler
ii gcc-8 8.4.0-3ubuntu2 amd64 GNU C compiler
ii gcc-9 9.3.0-17ubuntu1~20.04 amd64 GNU C compiler
ii gfortran 4:9.3.0-1ubuntu2 amd64 GNU Fortran 95 compiler
ii gfortran-8 8.4.0-3ubuntu2 amd64 GNU Fortran compiler
ii gfortran-9 9.3.0-17ubuntu1~20.04 amd64 GNU Fortran compiler
ii libllvm10:amd64 1:10.0.0-4ubuntu1 amd64 Modular compiler and toolchain technologies, runtime library
ii libllvm11:amd64 1:11.0.0-2~ubuntu20.04.1 amd64 Modular compiler and toolchain technologies, runtime library
ii libllvm6.0:amd64 1:6.0.1-14 amd64 Modular compiler and toolchain technologies, runtime library
ii libluajit-5.1-2:amd64 2.1.0~beta3+dfsg-5.1build1 amd64 Just in time compiler for Lua - library version
ii libluajit-5.1-common 2.1.0~beta3+dfsg-5.1build1 all Just in time compiler for Lua - common files
ii libparams-validationcompiler-perl 0.30-1 all module to build an optimized subroutine parameter validator
ii libprotoc-dev:amd64 3.6.1.3-2ubuntu5 amd64 protocol buffers compiler library (development files)
ii libprotoc17:amd64 3.6.1.3-2ubuntu5 amd64 protocol buffers compiler library
ii libxkbcommon-dev:amd64 0.10.0-1 amd64 library interface to the XKB compiler - development files
ii libxkbcommon0:amd64 0.10.0-1 amd64 library interface to the XKB compiler - shared library
ii llvm-10 1:10.0.0-4ubuntu1 amd64 Modular compiler and toolchain technologies
ii llvm-10-dev 1:10.0.0-4ubuntu1 amd64 Modular compiler and toolchain technologies, libraries and headers
ii llvm-10-runtime 1:10.0.0-4ubuntu1 amd64 Modular compiler and toolchain technologies, IR interpreter
ii llvm-10-tools 1:10.0.0-4ubuntu1 amd64 Modular compiler and toolchain technologies, tools
ii protobuf-compiler 3.6.1.3-2ubuntu5 amd64 compiler for protocol buffer definition files
ii sbcl 2:2.0.1-3 amd64 Common Lisp compiler and development system
Is that what you meant?
find . -name libspdlog.a
inside my build dir gives no results
Kind regards
Could you please give the following a try: Comment out line 146 find_package(spdlog ${_spdlog_version} EXACT QUIET)
in [your_micro-ROS_workspace]/src/eProsima/Micro-XRCE-DDS-Agent/cmake/SuperBuild.cmake
to force a build of spdlog despite the existence of /usr/local/lib/libspdlog.a
.
I have successfully followed the steps in a clean Ubuntu 20.04 docker and I wasn't able to reproduce this.
Hello @torbenf,
I have found this related issue on the spdlog repository: https://github.com/gabime/spdlog/issues/1405
Could you try modifying your build_agent.sh file (path install/micro_ros_setup/lib/micro_ros_setup/build_agent.sh
) and include the mentioned CMake flag, so it looks like this:
#! /bin/bash
set -e
set -o nounset
set -o pipefail
echo "Building micro-ROS Agent"
colcon build --packages-up-to micro_ros_agent $@ --cmake-args \
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON" \
"-DUAGENT_BUILD_EXECUTABLE=OFF" \
"-DUAGENT_P2P_PROFILE=OFF" \
"--no-warn-unused-cli"
Thank you very much for all your suggestions!
@ralph-lange I tried that but got the same error. @Acuadros95 I also tried that and got the same error.
I must have messed something up before trying to install micro-ROS. A clean install will do.
@pablogs9 Thank you
I will just use the docker Image then. =)
Can be closed since it's not a micro-ROS error.
EDIT: I tried @ralph-lange suggestion again on a fresh ROS2 (from deb) and micro-ros install as i was getting he same error and it worked. I just got a detached HEAD an this output:
Finished <<< micro_ros_msgs [16.3s]
[Processing: microxrcedds_agent]
[Processing: microxrcedds_agent]
--- stderr: microxrcedds_agent
Cloning into 'spdlog'...
Cloning into 'sanitizers'...
Already on 'master'
Note: switching to 'v1.4.2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 1549ff12 Replace STRING(PREPEND ..) in CMakeLists.txt to support older CMake versions
---
Finished <<< microxrcedds_agent [1min 47s]
Starting >>> micro_ros_agent
Finished <<< micro_ros_agent [9.18s]
but the ping pong example works now. Thanks again
Seems to me like the tutorial is outdated. Folder structures and package names have changed. After doing a colcon build, the examples are installed but definately not the same as what the tutorial suggests
Hey I have problems building the Ping Pong example from https://micro.ros.org/docs/tutorials/core/first_application_linux/ the following error
occurs during building the firmware and building the agent.
I hope somebody can help me with this because I don't know how to resolve this error.
Setup
Hardware description: I am using just a host PC Ubuntu 20.04.2
Installation type: I installed ROS 2 as explained here: https://docs.ros.org/en/foxy/Installation/Linux-Install-Debians.html and micro-ROS as explained here https://micro.ros.org/docs/tutorials/core/first_application_linux/
Version or commit hash: I'm using foxy as of commit 36a313d8ffd628ea38e204333d31dfc4e2a95187
Steps to reproduce the issue
Following the Tutorial on https://micro.ros.org/docs/tutorials/core/first_application_linux/ and building the firmware with
and then downloading and building the agent
Expected behavior
I expected everything to build fine and be able to do a
afterwards.
Actual behavior
ros2 run micro_ros_setup build_firmware.sh
produced:and
ros2 run micro_ros_setup build_agent.sh
producedBecause the above failed I can't run
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
Additional information
I am happy to provide additional Information if needed.
Thank you very much!