[CMake] CMake Error: RPATH CHANGE

Alexander Neundorf a.neundorf-work at gmx.net
Tue Sep 10 15:52:40 EDT 2013


On Tuesday 10 September 2013, Jim Leek wrote:
> I'm building a project on Linux x86_64 with 2.8.10.1.  I set up the
> project to build statically and shared.  However, when I run make
> install on a statically built version I get:
> 
> CMake Error at cmake_install.cmake:45 (FILE):
>    file RPATH_CHANGE could not write new RPATH:
> 
>      /usr/gapps/psuade/chaos_5_x86_64/psuade-r0643-t130910_1035/lib
> 
>    to the file:
> 
> /usr/gapps/psuade/chaos_5_x86_64/psuade-r0643-t130910_1035/bin/psuade
> 
>    No valid ELF RPATH or RUNPATH entry exists in the file;
> 
> It makes sense that it can't change the RPATH, it's completely static!
> $ ldd bin/psuade
>      not a dynamic executable
> 
> I looked around, but the only thing I could find on the topic is an old
> thread on this mailing list.  It got no replies.
> 
> http://www.cmake.org/pipermail/cmake/2009-November/033164.html
> 
> Is there anything I can do about this?  I would really like my static
> build to install, since I was planning to release that as the binary
> version to customers. Is this a cmake bug?  When will it, or has it
> already been, fixed?

When building static, it should help if you e.g. set BUILD_WITH_INSTALL_RPATH 
to TRUE, and maybe set INSTALL_RPATH explicitely to empty.
Or set SKIP_BUILD_RPATH to TRUE, this should have a similar effect.

Having said that, if cmake knows that the executable is static, it shouldn't 
try to change the RPATH.
Is the RPATH in the uninstalled executable empty ?

Alex


More information about the CMake mailing list