From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Re: [PATCH] build: cmake: Add input libraries to the rpath. Date: Sun, 27 Apr 2014 10:59:27 +0200 Message-ID: <20140427085927.GA4380@debian> References: <20140425071346.GA12585@debian> <87mwf9718f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeKw5-00061J-4r for guix-devel@gnu.org; Sun, 27 Apr 2014 04:59:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WeKvx-0008Iy-MB for guix-devel@gnu.org; Sun, 27 Apr 2014 04:59:45 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeKvx-0008Is-Cl for guix-devel@gnu.org; Sun, 27 Apr 2014 04:59:37 -0400 Content-Disposition: inline In-Reply-To: <87mwf9718f.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Eric Bavier Cc: guix-devel@gnu.org On Fri, Apr 25, 2014 at 12:44:32PM -0500, Eric Bavier wrote: > We can't set CMAKE_SKIP_BUILD_RPATH=OFF as it prevents tests from > working, since the executables and libraries would not have references > to libraries in the build tree (I ran the lapack build e.g. with your > patch, and all the tests fail). Yes, I noticed the same problem with lapack. > Your post prompted me to look into this matter a bit more. I found for > the gmsh package I posted yesterday that I could add the following to > #:configuration-flags instead of using the add-libs-to-runpath phase:: > "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON" > ,(string-append "-DCMAKE_INSTALL_RPATH=" > (assoc-ref %outputs "out") > "/lib") > > I would defer to the cmake wiki page you linked above for a full > explanation, but briefly: The CMAKE_INSTALL_RPATH_USE_LINK_PATH tells > cmake to include in the installed rpath all of the directories of > libraries it has linked into the library or executable, and the > CMAKE_INSTALL_RPATH tells cmake that in addition there are libraries in > the current project whose directory also needs to be added to the rpath. Excellent, so we could drop all patchelf occurrences! On Sat, Apr 26, 2014 at 10:52:52AM +0200, Ludovic Courtès wrote: > One concern though: if a package installs libraries in a place other > than $out/lib, like $out/lib/PACKAGE, this will break. I think that Eric's following sentence gives the answer: > I tried substituting the above two flags in for the lapack, gmsh, and > slim builds, and the RUNPATHS seem to be at least as good as when using > the manual augment-rpath method. There is still the possibility of adding an augment-rpath phase manually if a problem occurs, or maybe simply adding a second flag "-DCMAKE_INSTALL_RPATH". I will give it a try and commit a corresponding patch if everything works. Andreas