[CMake] CMake Error: RPATH_CHANGE

Marcel Loose loose at astron.nl
Mon Nov 9 11:26:15 EST 2009


Hi all,

I encountered the following problem when trying to 'make install' a
statically linked executable on a ppc64 platform. 

CMake Error at cmake_install.cmake:47 (FILE):
  file RPATH_CHANGE could not write new RPATH:

    /tmp/loose/cmake/cmake-rpath/install/lib

  to the file:

    /tmp/loose/cmake/cmake-rpath/install/bin/greetings

  No valid ELF RPATH or RUNPATH entry exists in the file;

I could not reproduce this on a x86_64 platform. It seems that the
generated file cmake_install.cmake is the culprit. Diff-ing the file
generated on the ppc64 system with that generated on the x86_64 system
yields:

@@ -37,8 +37,17 @@
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}"
MATCHES "^(Unspecified)$")

 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES
"^(Unspecified)$")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE
EXECUTABLE FILES
"/tmp/loose/cmake/cmake-rpath/build/CMakeFiles/CMakeRelink.dir/greetings")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/greetings")
+    FILE(RPATH_CHECK
+         FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/greetings"
+         RPATH "/tmp/loose/cmake/cmake-rpath/install/lib")
+  ENDIF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/greetings")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE
EXECUTABLE FILES "/tmp/loose/cmake/cmake-rpath/build/greetings")
+  IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/greetings")
+    FILE(RPATH_CHANGE
+         FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/greetings"
+         OLD_RPATH "::::::::::::::::::::::::::::::::::::::::"
+         NEW_RPATH "/tmp/loose/cmake/cmake-rpath/install/lib")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip"
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/greetings")
     ENDIF(CMAKE_INSTALL_DO_STRIP)

Both cmake 2.6.4 and 2.8.0-rc5 show this behaviour, which looks like a
bug to me.

Best regards,
Marcel Loose.




More information about the CMake mailing list