RoBoLoG

ROS CMake 오류: error: option --install-layout not recognized 본문

Error Solution/ROS

ROS CMake 오류: error: option --install-layout not recognized

SKJun 2024. 2. 19. 11:29

 

ROS CMake 오류: error: option --install-layout not recognized

아래와 같이 오류가 발생

error: option --install-layout not recognized
CMake Error at context_recognizer/catkin_generated/safe_execute_install.cmake:4 (message):
  
  execute_process(/home/user/catkin_ws/build/ros_node/catkin_generated/python_distutils_install.sh)
  returned error code
Call Stack (most recent call first):
  context_recognizer/cmake_install.cmake:41 (include)
  cmake_install.cmake:134 (include)

make: *** [Makefile:86: install] Error 1
Invoking "make install -j20 -l20" failed

 

해결 방법

1. Python setuptools 다운그레이드

pip3 install setuptools==45.2.0

 

  • 버전 호환성: setuptools==45.2.0 같은 구버전으로 다운그레이드하는 것은, 해당 버전이 여전히 distutils를 사용하는 구조와 호환되기 때문에 유용할 수 있습니다. distutils는 Python 패키징 및 설치를 위한 오래된 도구이며, 최신 setuptools 버전에서는 distutils의 일부 기능이 대체되거나 제거되었습니다. 따라서, 특정 구버전의 setuptools는 오래된 코드나 빌드 스크립트와의 호환성을 유지할 수 있습니다.
  • 구버전 프로젝트와의 호환성: ROS 프로젝트나 다른 Python 기반 프로젝트가 오래된 setuptools 버전에 의존하는 경우가 있습니다. 이러한 프로젝트는 특정 setuptools 버전이나 기능을 가정하고 구축될 수 있으며, 최신 버전으로 업그레이드하면 예상치 못한 문제가 발생할 수 있습니다.

 

2. 위에 방법으로 안 된다면 다음을 시도

catkin config --cmake-args -DSETUPTOOLS_DEB_LAYOUT=OFF
catkin_build
  • SETUPTOOLS_DEB_LAYOUT 옵션: 이 옵션은 setuptools가 Debian 기반 시스템에서 패키지를 설치할 때 사용하는 디렉토리 레이아웃을 조정합니다. 기본적으로, setuptools는 Debian 시스템에서 특정 설치 레이아웃을 사용할 수 있도록 설정되어 있으며, 이는 다른 배포판이나 사용 사례에서는 문제를 일으킬 수 있습니다.
  • 옵션 비활성화: -DSETUPTOOLS_DEB_LAYOUT=OFF를 사용하면, 이 레이아웃을 비활성화하여 setuptools가 보다 일반적인 Python 패키지 설치 메커니즘을 사용하도록 합니다. 이는 --install-layout 옵션이 인식되지 않는 문제를 우회하는 방법으로, 특히 ROS 프로젝트와 같은 복잡한 빌드 환경에서 유용할 수 있습니다.
728x90
반응형

'Error Solution > ROS' 카테고리의 다른 글

[ROS2] OSError: [Errno 8] Exec format error  (1) 2024.09.25