[ros2] opening some of the rclcpp examples in CLion [closed]

asked 2018-01-22 17:14:29 -0500

real_complex gravatar image

Hey guys!

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

in CLion 2017.3.

What i did:

  • open the terminal
  • source my workspace
  • run the startup shell script for clion
  • opened the publisher example and the client example successfully (everything working fine, all symbols got imported and work).

The problems start when i tried to open the minimal_composition example. CMake fails during opening. However, i can build the workspace using 'ament build' and i can run cmake on the CMakeLists.txt from minimal_composition 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 ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by real_complex
close date 2018-01-23 14:34:38.828211

Comments

1

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.

William gravatar image William  ( 2018-01-22 20:22:40 -0500 )edit

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 .

real_complex gravatar image real_complex  ( 2018-01-23 14:32:05 -0500 )edit

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

real_complex gravatar image real_complex  ( 2018-01-23 14:32:36 -0500 )edit