eProsima / Micro-XRCE-DDS

An XRCE DDS implementation. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
158 stars 15 forks source link

Problem building on Ubuntu 18.04 #14

Closed KurtE closed 5 years ago

KurtE commented 6 years ago

I have tried installing/building with the instructions up at: https://micro-xrce-dds.readthedocs.io/en/latest/installation.html

If I try building for both agent and client, the build fails with compile error.

kurt@kurt-Linux:~$ git clone --recursive https://github.com/eProsima/micro-XRCE-DDS.git
Cloning into 'micro-XRCE-DDS'...
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 152 (delta 13), reused 24 (delta 8), pack-reused 117
Receiving objects: 100% (152/152), 284.11 KiB | 1020.00 KiB/s, done.
Resolving deltas: 100% (52/52), done.
Submodule 'agent' (https://github.com/eProsima/Micro-XRCE-DDS-Agent.git) registered for path 'agent'
Submodule 'client' (https://github.com/eProsima/Micro-XRCE-DDS-Client.git) registered for path 'client'
Submodule 'gen' (https://github.com/eProsima/Micro-XRCE-DDS-Gen.git) registered for path 'gen'
Cloning into '/home/kurt/micro-XRCE-DDS/agent'...
remote: Enumerating objects: 59, done.        
remote: Counting objects: 100% (59/59), done.        
remote: Compressing objects: 100% (45/45), done.        
remote: Total 5308 (delta 26), reused 33 (delta 12), pack-reused 5249        
Receiving objects: 100% (5308/5308), 1.35 MiB | 927.00 KiB/s, done.
Resolving deltas: 100% (2999/2999), done.
Cloning into '/home/kurt/micro-XRCE-DDS/client'...
remote: Enumerating objects: 216, done.        
remote: Counting objects: 100% (216/216), done.        
remote: Compressing objects: 100% (129/129), done.        
remote: Total 6486 (delta 92), reused 143 (delta 63), pack-reused 6270        
Receiving objects: 100% (6486/6486), 1.56 MiB | 935.00 KiB/s, done.
Resolving deltas: 100% (3751/3751), done.
Cloning into '/home/kurt/micro-XRCE-DDS/gen'...
remote: Enumerating objects: 173, done.        
remote: Counting objects: 100% (173/173), done.        
remote: Compressing objects: 100% (78/78), done.        
remote: Total 722 (delta 45), reused 139 (delta 27), pack-reused 549        
Receiving objects: 100% (722/722), 245.23 KiB | 951.00 KiB/s, done.
Resolving deltas: 100% (276/276), done.
Submodule path 'agent': checked out '20241ba7709c5de663fc40a8bc7fa4e4140cf55c'
Submodule 'thirdparty/asio' (https://github.com/chriskohlhoff/asio.git) registered for path 'agent/thirdparty/asio'
Submodule 'thirdparty/fastcdr' (https://github.com/eProsima/Fast-CDR.git) registered for path 'agent/thirdparty/fastcdr'
Submodule 'thirdparty/fastrtps' (https://github.com/eProsima/Fast-RTPS.git) registered for path 'agent/thirdparty/fastrtps'
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/asio'...
remote: Enumerating objects: 4, done.        
remote: Counting objects: 100% (4/4), done.        
remote: Total 45510 (delta 3), reused 3 (delta 3), pack-reused 45506        
Receiving objects: 100% (45510/45510), 15.40 MiB | 930.00 KiB/s, done.
Resolving deltas: 100% (30520/30520), done.
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/fastcdr'...
remote: Enumerating objects: 5, done.        
remote: Counting objects: 100% (5/5), done.        
remote: Compressing objects: 100% (5/5), done.        
remote: Total 3370 (delta 0), reused 0 (delta 0), pack-reused 3365        
Receiving objects: 100% (3370/3370), 3.45 MiB | 924.00 KiB/s, done.
Resolving deltas: 100% (1652/1652), done.
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/fastrtps'...
remote: Enumerating objects: 1179, done.        
remote: Counting objects: 100% (1179/1179), done.        
remote: Compressing objects: 100% (526/526), done.        
remote: Total 51049 (delta 696), reused 957 (delta 563), pack-reused 49870        
Receiving objects: 100% (51049/51049), 68.72 MiB | 598.00 KiB/s, done.
Resolving deltas: 100% (34013/34013), done.
Submodule path 'agent/thirdparty/asio': checked out '230c0d2ae035c5ce1292233fcab03cea0d341264'
Submodule path 'agent/thirdparty/fastcdr': checked out 'c690b15e6670de46104ebacad7a2cb067b996c6c'
Submodule path 'agent/thirdparty/fastrtps': checked out 'd52a4a94e29cf50033bb74ae9d49cb4d1a98acee'
Submodule 'thirdparty/android-ifaddrs' (https://github.com/michalsrb/android-ifaddrs.git) registered for path 'agent/thirdparty/fastrtps/thirdparty/android-ifaddrs'
Submodule 'thirdparty/asio' (https://github.com/chriskohlhoff/asio.git) registered for path 'agent/thirdparty/fastrtps/thirdparty/asio'
Submodule 'thirdparty/fastcdr' (https://github.com/eProsima/Fast-CDR.git) registered for path 'agent/thirdparty/fastrtps/thirdparty/fastcdr'
Submodule 'thirdparty/idl' (https://github.com/eProsima/IDL-Parser.git) registered for path 'agent/thirdparty/fastrtps/thirdparty/idl'
Submodule 'thirdparty/tinyxml2' (https://github.com/leethomason/tinyxml2.git) registered for path 'agent/thirdparty/fastrtps/thirdparty/tinyxml2'
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/fastrtps/thirdparty/android-ifaddrs'...
remote: Enumerating objects: 40, done.        
remote: Total 40 (delta 0), reused 0 (delta 0), pack-reused 40        
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/fastrtps/thirdparty/asio'...
remote: Enumerating objects: 4, done.        
remote: Counting objects: 100% (4/4), done.        
remote: Total 45510 (delta 3), reused 3 (delta 3), pack-reused 45506        
Receiving objects: 100% (45510/45510), 15.40 MiB | 475.00 KiB/s, done.
Resolving deltas: 100% (30520/30520), done.
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/fastrtps/thirdparty/fastcdr'...
remote: Enumerating objects: 5, done.        
remote: Counting objects: 100% (5/5), done.        
remote: Compressing objects: 100% (5/5), done.        
remote: Total 3370 (delta 0), reused 0 (delta 0), pack-reused 3365        
Receiving objects: 100% (3370/3370), 3.45 MiB | 460.00 KiB/s, done.
Resolving deltas: 100% (1652/1652), done.
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/fastrtps/thirdparty/idl'...
remote: Enumerating objects: 57, done.        
remote: Counting objects: 100% (57/57), done.        
remote: Compressing objects: 100% (45/45), done.        
remote: Total 1317 (delta 17), reused 24 (delta 1), pack-reused 1260        
Receiving objects: 100% (1317/1317), 326.41 KiB | 471.00 KiB/s, done.
Resolving deltas: 100% (514/514), done.
Cloning into '/home/kurt/micro-XRCE-DDS/agent/thirdparty/fastrtps/thirdparty/tinyxml2'...
remote: Enumerating objects: 9, done.        
remote: Counting objects: 100% (9/9), done.        
remote: Compressing objects: 100% (9/9), done.        
remote: Total 3596 (delta 2), reused 4 (delta 0), pack-reused 3587        
Receiving objects: 100% (3596/3596), 2.65 MiB | 501.00 KiB/s, done.
Resolving deltas: 100% (2325/2325), done.
Submodule path 'agent/thirdparty/fastrtps/thirdparty/android-ifaddrs': checked out '7b1ce82817226e481d3cda0a5d06b66ebcc211f8'
Submodule path 'agent/thirdparty/fastrtps/thirdparty/asio': checked out 'b3d2ab7255fabe46a49b24a584c9fd797c8248e5'
Submodule path 'agent/thirdparty/fastrtps/thirdparty/fastcdr': checked out 'd998f853376bce42f15f10e565fca6d5e1839bdd'
Submodule path 'agent/thirdparty/fastrtps/thirdparty/idl': checked out '5256a902ffc94617480a5f769849f12deed06e79'
Submodule path 'agent/thirdparty/fastrtps/thirdparty/tinyxml2': checked out '8c8293ba8969a46947606a93ff0cb5a083aab47a'
Submodule path 'client': checked out 'c4dc2190103a01a64824f3f96197aa7fb835023e'
Submodule 'thirdparty/microcdr' (https://github.com/eProsima/micro-CDR.git) registered for path 'client/thirdparty/microcdr'
Cloning into '/home/kurt/micro-XRCE-DDS/client/thirdparty/microcdr'...
remote: Enumerating objects: 44, done.        
remote: Counting objects: 100% (44/44), done.        
remote: Compressing objects: 100% (33/33), done.        
remote: Total 1369 (delta 17), reused 23 (delta 7), pack-reused 1325        
Receiving objects: 100% (1369/1369), 618.58 KiB | 467.00 KiB/s, done.
Resolving deltas: 100% (739/739), done.
Submodule path 'client/thirdparty/microcdr': checked out '2f438e2faf08da12a6481efd164020fc33a7e559'
Submodule path 'gen': checked out '2df753e10b0397bdac556729861e5a4de6043bf9'
Submodule 'thirdparty/IDL-Parser' (https://github.com/eProsima/IDL-Parser.git) registered for path 'gen/thirdparty/IDL-Parser'
Cloning into '/home/kurt/micro-XRCE-DDS/gen/thirdparty/IDL-Parser'...
remote: Enumerating objects: 57, done.        
remote: Counting objects: 100% (57/57), done.        
remote: Compressing objects: 100% (45/45), done.        
remote: Total 1317 (delta 17), reused 24 (delta 1), pack-reused 1260        
Receiving objects: 100% (1317/1317), 326.41 KiB | 470.00 KiB/s, done.
Resolving deltas: 100% (514/514), done.
Submodule path 'gen/thirdparty/IDL-Parser': checked out '9e36ac4b18c8083ac7106761a8a6e908e04ae458'
kurt@kurt-Linux:~$ git clone --recursive https://github.com/eProsima/micro-XRCE-DDS.git
fatal: destination path 'micro-XRCE-DDS' already exists and is not an empty directory.
kurt@kurt-Linux:~$ cd micro-XRCE-DDS/
kurt@kurt-Linux:~/micro-XRCE-DDS$ mkdir build
kurt@kurt-Linux:~/micro-XRCE-DDS$ cd build
kurt@kurt-Linux:~/micro-XRCE-DDS/build$ cmake -DTHIRDPARTY=ON ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- fastcdr library found...
-- fastrtps library found...
-- Found Asio: /home/kurt/micro-XRCE-DDS/agent/thirdparty/asio/asio/include  
-- microcdr thirdparty is being updated...
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- microcdr library found...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kurt/micro-XRCE-DDS/build
kurt@kurt-Linux:~/micro-XRCE-DDS/build$ make
Scanning dependencies of target microxrcedds_agent
[  1%] Building CXX object agent/CMakeFiles/microxrcedds_agent.dir/src/cpp/Root.cpp.o
[  3%] Building CXX object agent/CMakeFiles/microxrcedds_agent.dir/src/cpp/processor/Processor.cpp.o
[  4%] Building CXX object agent/CMakeFiles/microxrcedds_agent.dir/src/cpp/client/ProxyClient.cpp.o
[  6%] Building CXX object agent/CMakeFiles/microxrcedds_agent.dir/src/cpp/participant/Participant.cpp.o
/home/kurt/micro-XRCE-DDS/agent/src/cpp/participant/Participant.cpp: In member function ‘virtual bool eprosima::uxr::Participant::matched(const dds::xrce::ObjectVariant&) const’:
/home/kurt/micro-XRCE-DDS/agent/src/cpp/participant/Participant.cpp:152:43: error: no match for ‘operator==’ (operand types are ‘eprosima::fastrtps::ParticipantAttributes’ and ‘const eprosima::fastrtps::ParticipantAttributes’)
     return parser_cond && (new_attributes == old_attributes);
                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
agent/CMakeFiles/microxrcedds_agent.dir/build.make:134: recipe for target 'agent/CMakeFiles/microxrcedds_agent.dir/src/cpp/participant/Participant.cpp.o' failed
make[2]: *** [agent/CMakeFiles/microxrcedds_agent.dir/src/cpp/participant/Participant.cpp.o] Error 1
CMakeFiles/Makefile2:124: recipe for target 'agent/CMakeFiles/microxrcedds_agent.dir/all' failed
make[1]: *** [agent/CMakeFiles/microxrcedds_agent.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
kurt@kurt-Linux:~/micro-XRCE-DDS/build$ ^C
kurt@kurt-Linux:~/micro-XRCE-DDS/build$ 

I have tried this on two different machines/boards. My old desktop computer and an UP board (both 64 bit Ubuntu 18.04.1 installs

julionce commented 6 years ago

Hi @KurtE,

I seems that you have already a Fast RTPS distribution installed in your machine, but the operator== has been implemented later. You can try to uninstall Fast RTPS and install it with -DTHIRDPARTY=ON from Micro XRCE-DDS.

ghost commented 6 years ago

Hello @julianbermudez,

thanks to your help I could solve this error. Since ROS2 is using your rtps stack as well, I had it already installed. Are you planning to provide ROS2 with the same distribution of the code?

KurtE commented 6 years ago

@ToRaVe @julianbermudez

For what it is worth, I am setting up the UP board to run ROS2 for Turtlebot3 and some of the issues I ran into were because the Turtlebot3 code has not yet been updated to the changes in the APIs between the Beta 2 release and the new current release.

So I was able to get the code to now build, by getting back to Beta 2... I did this like:

$ cd && git clone https://github.com/eProsima/micro-RTPS-agent.git
$ cd  micro-RTPS-agent
$  git checkout tags/v1.0.0beta2
$ mkdir build && cd build
$ cmake -DTHIRDPARTY=ON -DCONFIG_UDP_TRANSPORT_MTU=4096 -DCONFIG_SERIAL_TRANSPORT_MTU=4096 ..
$ sudo make install

Likewise for the other one...

Hopefully they will update the ROS2/Turtlebot3 code/instructions soon to go up to this released version.

Kurt

OpusK commented 5 years ago

Hi, @ToRaVe, @KurtE

I solved this problem in the following way. This solution refers to the following issues.

The problem is that the version of FastRTPS master is not 1.7.0. Therefore, you need to remove the global FastRTPS installed in OS and install correct version. The problem here is that FastRTPS of ROS2 can also be global. Normally we set bashrc to automatically run the bash file shown below, which makes it possible to use a different version of FastRTPS.

source $HOME/workspace/ros2/install/local_setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash

So, comment out this in bashrc and run the cmake -DTHIRDPARTY command again to download the version of FastRTPS required by Agent 1.0.0 automatically. Then, you can see that the Agent is installed normally because the version matches. (I have not yet touched ROS2 and Agent at the same time, so I'll check tomorrow to see if it works)

+Update: It works with ROS2 well!

BorjaOuterelo commented 5 years ago

The issue is solved in the last tag v1.0.2: 268a65d