eProsima / Micro-XRCE-DDS

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

fastdds fail to build on Ubuntu 20.04 #54

Closed tieugiang91 closed 3 years ago

tieugiang91 commented 3 years ago

I tried to build and install XRCE-DDS on Ubuntu 20.04 following the instructions: https://micro-xrce-dds.docs.eprosima.com/en/latest/installation.html It is expected to compiled but stopped while buiding fastdds as below:

[ 24%] Performing test step for 'fastcdr'
[ 25%] Completed 'fastcdr'
[ 25%] Built target fastcdr
Scanning dependencies of target fastdds
[ 27%] Creating directories for 'fastdds'
[ 28%] Performing download step (git clone) for 'fastdds'
Cloning into 'fastdds'...
Switched to a new branch '2.0.x'
Branch '2.0.x' set up to track remote branch '2.0.x' from 'origin'.
Submodule 'thirdparty/android-ifaddrs' (https://github.com/michalsrb/android-ifaddrs.git) registered for path 'thirdparty/android-ifaddrs'
Submodule 'thirdparty/asio' (https://github.com/chriskohlhoff/asio.git) registered for path 'thirdparty/asio'
Submodule 'thirdparty/fastcdr' (https://github.com/eProsima/Fast-CDR.git) registered for path 'thirdparty/fastcdr'
Submodule 'thirdparty/tinyxml2' (https://github.com/leethomason/tinyxml2.git) registered for path 'thirdparty/tinyxml2'
Cloning into '/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/thirdparty/android-ifaddrs'...
Cloning into '/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/thirdparty/asio'...
Cloning into '/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/thirdparty/fastcdr'...
Cloning into '/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/thirdparty/tinyxml2'...
Submodule path 'thirdparty/android-ifaddrs': checked out '7b1ce82817226e481d3cda0a5d06b66ebcc211f8'
Submodule path 'thirdparty/asio': checked out '22afb86087a77037cd296d27134756c9b0d2cb75'
Submodule path 'thirdparty/fastcdr': checked out 'cc27c2490b694e97ca1bbcc169172fd63209bb90'
Submodule path 'thirdparty/tinyxml2': checked out '8c8293ba8969a46947606a93ff0cb5a083aab47a'
[ 30%] No patch step for 'fastdds'
[ 31%] Performing update step for 'fastdds'
[ 33%] Performing configure step for 'fastdds'
loading initial cache file /home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/tmp/fastdds-cache-Release.cmake
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.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
-- Configuring Fast RTPS
-- Version: 2.0.1
-- To change the version modify the file configure.ac
-- Performing Test SUPPORTS_CXX14
-- Performing Test SUPPORTS_CXX14 - Success
-- Performing Test SUPPORTS_CXX1Y
-- Performing Test SUPPORTS_CXX1Y - Success
-- Performing Test SUPPORTS_CXX11
-- Performing Test SUPPORTS_CXX11 - Success
-- 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
-- fastcdr library found...
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_kill
-- Looking for pthread_kill - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Thirdparty/boost compiled OK
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1f")  
-- OpenSSL library 1.1.1f found...
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) 
-- Could NOT find GMock (missing: GMOCK_LIBRARY GMOCK_INCLUDE_DIR GMOCK_MAIN_LIBRARY) 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds-build
[ 34%] Performing build step for 'fastdds'
Scanning dependencies of target fastrtps
[  0%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/fastdds/log/Log.cpp.o
[  1%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/fastdds/log/StdoutConsumer.cpp.o
[  1%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/fastdds/log/FileConsumer.cpp.o
[  2%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/common/Time_t.cpp.o
[  3%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/resources/ResourceEvent.cpp.o
[  3%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/resources/TimedEvent.cpp.o
[  4%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/resources/TimedEventImpl.cpp.o
[  4%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/resources/AsyncWriterThread.cpp.o
[  5%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/resources/AsyncInterestTree.cpp.o
[  5%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/writer/LivelinessManager.cpp.o
[  6%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/writer/RTPSWriter.cpp.o
[  7%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/writer/StatefulWriter.cpp.o
[  7%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/writer/ReaderProxy.cpp.o
[  8%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/writer/StatelessWriter.cpp.o
[  8%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/writer/ReaderLocator.cpp.o
[  9%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/history/CacheChangePool.cpp.o
[  9%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/history/History.cpp.o
[ 10%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/history/WriterHistory.cpp.o
[ 11%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/history/ReaderHistory.cpp.o
[ 11%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/rtps/reader/WriterProxy.cpp.o
In file included from /home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/src/cpp/rtps/reader/WriterProxy.cpp:36:
/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/include/fastrtps/utils/collections/foonathan_memory_helpers.hpp: In instantiation of ‘std::size_t eprosima::fastrtps::memory_pool_block_size(std::size_t, const eprosima::fastrtps::ResourceLimitedContainerConfig&) [with MemoryPool = foonathan::memory::memory_pool<foonathan::memory::node_pool>; std::size_t = long unsigned int]’:
/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/src/cpp/rtps/reader/WriterProxy.cpp:70:87:   required from here
/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/include/fastrtps/utils/collections/foonathan_memory_helpers.hpp:56:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   53 |     return num_elems
      |            ~~~~~~~~~
   54 |            * ((node_size > MemoryPool::min_node_size ? node_size : MemoryPool::min_node_size) // Room for elements
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   55 |            * (foonathan::memory::detail::debug_fence_size ? 3 : 1))                           // Room for debug info
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   56 |            + foonathan::memory::detail::memory_block_stack::implementation_offset;            // Room for padding
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tyna/Data110220/Ubuntu/Makino/DDS/xrcedds/Micro-XRCE-DDS/build/agent/src/agent-build/fastdds/src/fastdds/include/fastrtps/utils/collections/foonathan_memory_helpers.hpp:56:12: error: invalid conversion from ‘std::size_t (*)() noexcept’ {aka ‘long unsigned int (*)()’} to ‘std::size_t’ {aka ‘long unsigned int’} [-fpermissive]
make[8]: *** [src/cpp/CMakeFiles/fastrtps.dir/build.make:310: src/cpp/CMakeFiles/fastrtps.dir/rtps/reader/WriterProxy.cpp.o] Error 1
make[7]: *** [CMakeFiles/Makefile2:959: src/cpp/CMakeFiles/fastrtps.dir/all] Error 2
make[6]: *** [Makefile:163: all] Error 2
make[5]: *** [CMakeFiles/fastdds.dir/build.make:116: fastdds/src/fastdds-stamp/fastdds-build] Error 2
make[4]: *** [CMakeFiles/Makefile2:204: CMakeFiles/fastdds.dir/all] Error 2
make[3]: *** [Makefile:84: all] Error 2
make[2]: *** [CMakeFiles/agent.dir/build.make:113: agent/src/agent-stamp/agent-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/agent.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Steps to Reproduce

  1. git clone https://github.com/eProsima/Micro-XRCE-DDS.git
  2. cd Micro-XRCE-DDS/
  3. mkdir build && cd build
  4. cmake .. (neither cmake -DTHIRDPARTY=ON -DEPROSIMA_BUILD_EXAMPLES=ON .. nor cmake .. works)
  5. make

System information

pablogs9 commented 3 years ago

Hello @tieugiang91, would you mind to install Client and Agent in a separate manner? We have found a middleware third-party incompatibility and it may take some time to be resolved.

I kindly suggest you to use:

git clone -b v1.5.0 https://github.com/eProsima/Micro-XRCE-DDS-Agent
cd Micro-XRCE-DDS-Agent/
mkdir build; cd build;
cmake ..
make

git clone -b v1.2.5 https://github.com/eProsima/Micro-XRCE-DDS-Client
cd Micro-XRCE-DDS-Client/
mkdir build; cd build;
cmake .. -DUCLIENT_BUILD_EXAMPLES=ON
make

Now you have a working executable of the agent places in Micro-XRCE-DDS-Agent/build/MicroXRCEAgent and several examples under Micro-XRCE-DDS-Client/examples.

Please let me know if you have any other problem or question, close the issue if this solution is ok for you.

Thanks!

tieugiang91 commented 3 years ago

The source code has been successfully built, thank you!