Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake issue with the release on noetic #43

Open
jmirabel opened this issue Apr 15, 2021 · 11 comments · May be fixed by #44
Open

CMake issue with the release on noetic #43

jmirabel opened this issue Apr 15, 2021 · 11 comments · May be fixed by #44

Comments

@jmirabel
Copy link

After having installed ros-noetic-collada-urdf, using find_package(catkin REQUIRED COMPONENTS collada_urdf) fails with error

CMake Error at /opt/ros/noetic/share/collada_urdf/cmake/collada_urdfConfig.cmake:113 (message):
Project 'collada_urdf' specifies '/usr/../include/include' as an include
dir, which is not found. It does neither exist as an absolute directory
nor in '${prefix}//usr/../include/include'. Check the issue tracker
'https://github.com/ros/collada_urdf/issues' and consider creating a ticket
if the problem has not been reported yet.
Call Stack (most recent call first):
/opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
CMakeLists.txt:7 (find_package)

@werner291
Copy link

werner291 commented Jul 20, 2021

Same on my system, can't get anything that depends on collada-urdf to compile.

@jmirabel
Copy link
Author

Dirty workaround, acceptable in docker containers, are

  • mkdir -p /include/include
  • sed -i 's#/usr/../include/include;##' /opt/ros/noetic/share/collada_urdf/cmake/collada_urdfConfig.cmake

@werner291
Copy link

Seems related to this portion in the file it's complaining about:

if(NOT "/home/werner/catkin_test/src/collada_urdf/collada_urdf/include;/usr/../include/include;/usr/include/collada-dom2.4/1.5;/usr/include/collada-dom2.4;/usr/include " STREQUAL " ")
  set(collada_urdf_INCLUDE_DIRS "")
  set(_include_dirs "/home/werner/catkin_test/src/collada_urdf/collada_urdf/include;/usr/../include/include;/usr/include/collada-dom2.4/1.5;/usr/include/collada-dom2.4;/usr/include")
  if(NOT "https://github.com/ros/collada_urdf/issues " STREQUAL " ")
    set(_report "Check the issue tracker 'https://github.com/ros/collada_urdf/issues' and consider creating a ticket if the problem has not been reported yet.")
  elseif(NOT "http://ros.org/wiki/collada_urdf " STREQUAL " ")
    set(_report "Check the website 'http://ros.org/wiki/collada_urdf' for information and consider reporting the problem.")
  else()
    set(_report "Report the problem to the maintainer 'Chris Lalancette <[email protected]>, Shane Loretz <[email protected]>' and request to fix the problem.")
  endif()
  foreach(idir ${_include_dirs})
    if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir})
      set(include ${idir})
    elseif("${idir} " STREQUAL "include ")
      get_filename_component(include "${collada_urdf_DIR}/../../../include" ABSOLUTE)
      if(NOT IS_DIRECTORY ${include})
        message(FATAL_ERROR "Project 'collada_urdf' specifies '${idir}' as an include dir, which is not found.  It does not exist in '${include}'.  ${_report}")
      endif()
    else()
      message(FATAL_ERROR "Project 'collada_urdf' specifies '${idir}' as an include dir, which is not found.  It does neither exist as an absolute directory nor in '/home/werner/catkin_test/src/collada_urdf/collada_urdf/${idir}'.  ${_report}")
    endif()
    _list_append_unique(collada_urdf_INCLUDE_DIRS ${include})
  endforeach()
endif()

It's as if collada_urdf_DIR is set to some weird value.

@werner291
Copy link

Actually, this seems to be the offending line:

set(_include_dirs "/home/werner/catkin_test/src/collada_urdf/collada_urdf/include;/usr/../include/include;/usr/include/collada-dom2.4/1.5;/usr/include/collada-dom2.4;/usr/include") if(NOT "https://github.com/ros/collada_urdf/issues " STREQUAL " ")

Now to find out where that's coming from...

@werner291
Copy link

@werner291
Copy link

werner291 commented Jul 20, 2021

Looks like some package named ASSIMP is drawing in the non-existing directory /usr/../include/include.

Tested by inserting the line: message(WARNING "Dependency: ${depend} DEPENDS ON DIRECTORIES ${${depend_name}_INCLUDE_DIRS}") in the file collada_urdfConfig.cmake wherever PROJECT_DEPENDENCIES_INCLUDE_DIRS gets changed.

@werner291
Copy link

werner291 commented Jul 20, 2021

Notably, catkin also produced this warning:

Starting  >>> collada_urdf                                                                              
________________________________________________________________________________________________________
Warnings   << collada_urdf:cmake /home/werner/catkin_test/logs/collada_urdf/build.cmake.000.log         
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/assimp-5.0/assimpTargets.cmake:54 (if):
  if given arguments:

    "ON"

  An argument named "ON" appears in a conditional statement.  Policy CMP0012
  is not set: if() recognizes numbers and boolean constants.  Run "cmake
  --help-policy CMP0012" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/assimp-5.0/assimp-config.cmake:1 (include)
  CMakeLists.txt:16 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

@werner291
Copy link

CMakeCache indeed shows the nonsensical include path: ASSIMP_INCLUDE_DIRS:INTERNAL=/usr/../include/include

@werner291
Copy link

werner291 commented Jul 20, 2021

This appears to be the offending part of the CMakeLists.txt

message(ERROR "Assimp: ${ASSIMP_INCLUDE_DIRS}") # Outputs /usr/include

if ( NOT ASSIMP_FOUND )
  find_package(Assimp QUIET)
  if ( NOT ASSIMP_FOUND )
    find_package(PkgConfig REQUIRED)
    pkg_check_modules(ASSIMP assimp)
  endif()
endif()

message(ERROR "Assimp: ${ASSIMP_INCLUDE_DIRS}") # Gets overwritten to /usr/../include/include!

@werner291
Copy link

Dammit...

CMake is case-sensitive: it should be assimp_FOUND, not ASSIMP_FOUND!

@werner291
Copy link

Yup. Tested it with a project that depends on collada_urdf; it compiles fine once i make the change.

werner291 added a commit to werner291/collada_urdf that referenced this issue Jul 20, 2021
Attempted fix ros#43, seems to work AFAIK, but please review.
k-okada added a commit to k-okada/jsk_model_tools that referenced this issue Dec 2, 2021
k-okada added a commit to k-okada/jsk_model_tools that referenced this issue Dec 15, 2021
k-okada added a commit to k-okada/jsk_model_tools that referenced this issue Dec 15, 2021
k-okada added a commit to k-okada/jsk_model_tools that referenced this issue Dec 15, 2021
kazuki0824 added a commit to kazuki0824/rtmros_common that referenced this issue Aug 6, 2022
kazuki0824 added a commit to kazuki0824/rtmros_common that referenced this issue Aug 11, 2022
k-okada added a commit to k-okada/jsk_robot that referenced this issue Sep 27, 2022
k-okada added a commit to k-okada/jsk_robot that referenced this issue Sep 27, 2022
k-okada added a commit to k-okada/jsk_robot that referenced this issue Sep 30, 2022
k-okada added a commit to k-okada/jsk_robot that referenced this issue Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants