cmake news: RPATH

Alexander Neundorf neundorf at kde.org
Thu Mar 23 20:16:57 CET 2006


On Thursday 23 March 2006 10:22, David Faure wrote:
> On Thursday 23 March 2006 01:21, Brad King wrote:
> > >>"both" - (not on OS X)
> >
> > I really don't like this option.
>
> Me neither. Alex, can we remove it?

Well, since it's not default, do we have to remove it *now* ?

> > FYI, I anticipated this dilemma and provided a "preinstall" target that
> > can be built by the user to do the relinking before changing to root:
> >
> > make && make preinstall && sudo make install
>
> Interesting workaround. Any change to the usual make && [sudo] make install
> will remain an obscure workaround though, since nobody would even guess
> that there is such a solution :)
>
> > As described below, relinking should only be needed for developers that
> > want to run applications from the build tree but still install from the
> > same tree.
>
> Right, this is why "default" is a rather bad default, given that most KDE
> applications do *not* support running from the build tree at this point. (I
> mean the real GUI apps).
>
> > 1.) Executables that are not run during the build but are installed.
> > 2.) Executables that are run during the build and not installed.
> > 3.) Executables that are run during the build and are installed.
>
> Excellent analysis. Indeed we need to do things differently for those 3
> kinds.
>
> > -------------------------------------------------------------------------
> > For #1 there is a choice for developers and a choice for users.  Setting
> > the target property BUILD_WITH_INSTALL_RPATH will cause the executables
> > to get built with an RPATH meant for the install tree.  No relinking is
> > needed for installation but the executables will not run from the build
> > tree (except on RUNPATH platforms with LD_LIBRARY_PATH set properly).
> > This is the choice for users and should be the default.
>
> For now it would be a good default for developers too, as long as running
> from the builddir isn't really supported. It's good to have the option for
> later, of course.
>
> > -------------------------------------------------------------------------
> > For #3 there is potential trouble.  When running from the build tree we
> > need to make sure the build tree libraries are used, and when running
> > from the install tree we need to make sure the install tree libraries
> > are used.
> >
> > If BUILD_WITH_INSTALL_RPATH is set on a non-RUNPATH platform and there
> > is an existing old install the wrong libraries will be used when running
> > during the build.  Even on a RUNPATH platform the environment must have
> > the proper LD_LIBRARY_PATH for the build tree.
>
> Nobody sets LD_LIBRARY_PATH to point to the build tree during compilation;
> wrapper scripts would have to do that.

That's what is currently being done with RPATH_STYLE == "none" and "install".

Ok, I have to go now.

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net


More information about the Kde-buildsystem mailing list