Robotics StackExchange | Archived questions

[ros2] opening some of the rclcpp examples in CLion

Hey guys!

I am struggling with opening the rclcpp examples provided from here: https://github.com/ros2/examples/tree/master/rclcpp

in CLion 2017.3.

What i did:

The problems start when i tried to open the minimalcomposition example. CMake fails during opening. However, i can build the workspace using 'ament build' and i can run cmake on the CMakeLists.txt from minimalcomposition manually using the exact same command as CLion gives in the log window. However, this is the output from CLion:

/home/xx/Downloads/clion-2017.3.2/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix             Makefiles" /home/xx/ros2_ws/src/ros2/examples/rclcpp/minimal_composition
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.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
-- Found ament_cmake: 0.4.0 (/home/xx/ros2_ws/install/share/ament_cmake/cmake)
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "3") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Found class_loader: 1.0.0 (/home/xx/ros2_ws/install/share/class_loader/cmake)
-- Found poco_vendor: 1.0.0 (/home/xx/ros2_ws/install/share/poco_vendor/cmake)
-- Searching for Poco library...
-- Found Poco version (< 1.4.0) is too old, building from source instead CMake Error at /home/xx/ros2_ws/install/share/poco_vendor/cmake/Modules/FindPoco.cmake:209 (message): Poco was not found.  Set the Poco_INCLUDE_DIR cmake cache entry to the top-level directory containing the poco include directories.  E.g  /usr/local/include/ or c:\poco\include\poco-1.3.2 
Call Stack (most recent call first):
/home/xx/ros2_ws/install/share/class_loader/cmake/class_loader-extras.cmake:4 (find_package)
/home/xx/ros2_ws/install/share/class_loader/cmake/class_loaderConfig.cmake:30 (include)
CMakeLists.txt:14 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/xx/ros2_ws/src/ros2/examples/rclcpp/minimal_composition/cmake-build-debug/CMakeFilesCMakeOutput.log".

and this is the output from manual cmake from within a build folder located in the minimal_composition package:

xx@xx-xxxxx:~/ros2_ws/src/ros2/examples/rclcpp/minimal_composition/build$ cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.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
-- Found ament_cmake: 0.4.0 (/home/xx/ros2_ws/install/share/ament_cmake/cmake)
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "3") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Found class_loader: 1.0.0 (/home/xx/ros2_ws/install/share/class_loader/cmake)
-- Found poco_vendor: 1.0.0 (/home/xx/ros2_ws/install/share/poco_vendor/cmake)
-- Searching for Poco library...
--   Found Poco!
-- components found: Foundationd.
-- Found rclcpp: 0.4.0 (/home/xx/ros2_ws/install/share/rclcpp/cmake)
-- Found rmw_implementation_cmake: 0.4.0 (/home/xx/ros2_ws/install/share/rmw_implementation_cmake/cmake)
-- Found std_msgs: 0.4.0 (/home/xx/ros2_ws/install/share/std_msgs/cmake)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xx/ros2_ws/src/ros2/examples/rclcpp/minimal_composition/build

Since some of the packages work just fine, i am quite sure that is set up the environment properly for CLion. Any ideas what can go wrong on this things?

Asked by real_complex on 2018-01-22 18:14:29 UTC

Comments

What does the /home/xx/Downloads/clion-2017.3.2/bin/cmake/bin/cmake do differently from just cmake? I guess it must be modifying the CMAKE_PREFIX_PATH such that a different poco is found which doesn't work.

Asked by William on 2018-01-22 21:22:40 UTC

thanks for that hint, i have not seen the fact that clion brings its own cmake. Instead of modifying the path of the CLion cmake version, i changed the CLion toolchain to use the cmake located under /usr/bin/cmake .

Asked by real_complex on 2018-01-23 15:32:05 UTC

This can be done from File --> Settings --> Build, Execution, Deployment --> Toolchain --> CMake Worked out of the box afterwards.

Asked by real_complex on 2018-01-23 15:32:36 UTC

Answers