Page 1 of 1

_install TARGETS given no LIBRARY DESTINATION for shared library target simExtROS2Interface

Posted: 19 May 2020, 01:25
by Filipe Rocha
Hi everyone.

I am trying to compile the ROS2 interface .so in ROS2 Dashing on Ubuntu 18.04. By just following the steps on the Github repo (https://github.com/CoppeliaRobotics/simExtROS2Interface) I get the following error:

Code: Select all

> colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DLIBPLUGIN_DIR=$COPPELIASIM_ROOT_DIR/programming/libPlugin
Starting >>> sim_ros2_interface
--- stderr: sim_ros2_interface                         
CMake Error at /opt/ros/dashing/share/ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install_targets.cmake:50 (_install):
  _install TARGETS given no LIBRARY DESTINATION for shared library target
  "simExtROS2Interface".
Call Stack (most recent call first):
  /opt/ros/dashing/share/ament_cmake_core/cmake/symlink_install/install.cmake:37 (ament_cmake_symlink_install_targets)
  CMakeLists.txt:128 (install)


---
Failed   <<< sim_ros2_interface	[ Exited with code 1 ]

Summary: 0 packages finished [1.50s]
  1 package failed: sim_ros2_interface
  1 package had stderr output: sim_ros2_interface

I think I made a workaround by adding

Code: Select all

set(LIBPLUGIN_DIR ${COPPELIASIM_ROOT_DIR}/programming/libPlugin)
to the <ros2_ws>/src/sim_ros2_interface/CMakeLists.txt . Well, I think because the error has changed after that hahaha:

Code: Select all

> colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DLIBPLUGIN_DIR=$COPPELIASIM_ROOT_DIR/programming/libPlugin
Starting >>> sim_ros2_interface
--- stderr: sim_ros2_interface                         
CMake Error at CMakeLists.txt:56 (find_package):
  By not providing "FindCoppeliaSim.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "CoppeliaSim", but CMake did not find one.

  Could not find a package configuration file provided by "CoppeliaSim"
  (requested version 4.0.0.0) with any of the following names:

    CoppeliaSimConfig.cmake
    coppeliasim-config.cmake

  Add the installation prefix of "CoppeliaSim" to CMAKE_PREFIX_PATH or set
  "CoppeliaSim_DIR" to a directory containing one of the above files.  If
  "CoppeliaSim" provides a separate development package or SDK, be sure it
  has been installed.


---
Failed   <<< sim_ros2_interface	[ Exited with code 1 ]

Summary: 0 packages finished [0.69s]
  1 package failed: sim_ros2_interface
  1 package had stderr output: sim_ros2_interface
After that, I have added the redundant

Code: Select all

set(CoppeliaSim_DIR ${COPPELIASIM_ROOT_DIR})
to CMakeLists.txt... nothing have changed. I have also searched for the CoppeliaSimConfig.cmake and coppeliasim-config.cmake files on my computer, but did not found them.

I am not an expert on CMake, so this hard time has been a good time to study some concepts. hahaha
I kindly appreciate any suggestions on how to manage that. :)

Best regards.

Re: Failing on building ROS2 interface on Ubuntu 18.04

Posted: 19 May 2020, 09:45
by fferri
You don't need to change CMakeLists.txt or other files.

Make sure the value of $COPPELIASIM_ROOT_DIR is correct.

Re: Failing on building ROS2 interface on Ubuntu 18.04

Posted: 19 May 2020, 15:26
by Filipe Rocha
Thank you for the quick response.
I see there is no need for modifying CMakeLists. I am probably doing something wrong on my own.

Starting from the beginning for a re-check purpose, I have just downloaded CoppeliaSim 4.0.0. (rev4) and cloned to `<ros2_ws>/src` the ROS2 interface using

Code: Select all

git clone --recursive https://github.com/CoppeliaRobotics/simExtROS2Interface.git sim_ros2_interface
(Additionally, the github repo indicates a "libPlugin's README" link, which is broken.)

The $COPPELIASIM_ROOT_DIR var is set to

Code: Select all

> echo $COPPELIASIM_ROOT_DIR
/home/filipe/bin/coppelia
which is correctly my CoppeliaSim folder.

Now, when I run the compilation command suggested on the github repo i get:

Code: Select all

> colcon build --symlink-install
Starting >>> sim_ros2_interface
--- stderr: sim_ros2_interface                         
CMake Error at /opt/ros/dashing/share/ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install_targets.cmake:50 (_install):
  _install TARGETS given no LIBRARY DESTINATION for shared library target
  "simExtROS2Interface".
Call Stack (most recent call first):
  /opt/ros/dashing/share/ament_cmake_core/cmake/symlink_install/install.cmake:37 (ament_cmake_symlink_install_targets)
  CMakeLists.txt:124 (install)


---
Failed   <<< sim_ros2_interface	[ Exited with code 1 ]

Summary: 0 packages finished [1.45s]
  1 package failed: sim_ros2_interface
  1 package had stderr output: sim_ros2_interface

Changing the compilation command to the one suggested in the official CoppeliaSim website:

Code: Select all

> colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DLIBPLUGIN_DIR=$COPPELIASIM_ROOT_DIR/programming/libPlugin
Starting >>> sim_ros2_interface
--- stderr: sim_ros2_interface                         
CMake Error at /opt/ros/dashing/share/ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install_targets.cmake:50 (_install):
  _install TARGETS given no LIBRARY DESTINATION for shared library target
  "simExtROS2Interface".
Call Stack (most recent call first):
  /opt/ros/dashing/share/ament_cmake_core/cmake/symlink_install/install.cmake:37 (ament_cmake_symlink_install_targets)
  CMakeLists.txt:124 (install)


---
Failed   <<< sim_ros2_interface	[ Exited with code 1 ]

Summary: 0 packages finished [1.44s]
  1 package failed: sim_ros2_interface
  1 package had stderr output: sim_ros2_interface
I understand the additional parameters on the second compilation command is precisely for setting the lib folder. Still, my colcon presents a related error.

Thank you in advance for any tips on how to solve this. :)

Best regards.

Re: Failing on building ROS2 interface on Ubuntu 18.04

Posted: 20 May 2020, 09:22
by fferri
Oh. I think that error is coming from here:

Code: Select all

#cmake
# sim_ros2_interface/CMakeLists.txt
install(
    TARGETS simExtROS2Interface
    EXPORT export_${PROJECT_NAME}
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION ${COPPELIASIM_PLUGINS_DIR}
    RUNTIME DESTINATION bin
)

You need to pull the latest version of libPlugin to have the ${COPPELIASIM_PLUGINS_DIR} variable properly set.

This issue will be fixed once the next release of CoppeliaSim will include also the latest version of libPlugin.

However it is a good habit to have all the CoppeliaSim libraries (include, common, libPlugin, simMath, etc...) to the latest version when building plugins from git.