From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] build: cmake: Add input libraries to the rpath. Date: Sat, 26 Apr 2014 10:52:52 +0200 Message-ID: <87fvl0v5ej.fsf@gnu.org> References: <20140425071346.GA12585@debian> <87mwf9718f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdyM1-0007io-Vp for guix-devel@gnu.org; Sat, 26 Apr 2014 04:53:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdyLv-0003w8-Kk for guix-devel@gnu.org; Sat, 26 Apr 2014 04:53:01 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:45002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdyLv-0003w3-EF for guix-devel@gnu.org; Sat, 26 Apr 2014 04:52:55 -0400 In-Reply-To: <87mwf9718f.fsf@gmail.com> (Eric Bavier's message of "Fri, 25 Apr 2014 12:44:32 -0500") 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 Eric Bavier skribis: > Andreas Enge writes: > >> In a discussion we had yesterday, Ludovic mentioned the need to pass a >> special flag to the cmake configure phase to modify the rpath of install= ed >> libraries, as done for the package slim. I then noticed I needed the same >> flag for clucene. The attached patch applies it globally in the cmake bu= ild >> system. > > We can't set CMAKE_SKIP_BUILD_RPATH=3DOFF 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). OK, that=E2=80=99s what I feared. > 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=3DON" > ,(string-append "-DCMAKE_INSTALL_RPATH=3D" > (assoc-ref %outputs "out") > "/lib") [...] > 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. Good, it looks like this is what =E2=80=98cmake-build-system=E2=80=99 shoul= d do by default. One concern though: if a package installs libraries in a place other than $out/lib, like $out/lib/PACKAGE, this will break. In practice, do CMake packages always install libraries in $libdir? Thanks for helping out, Ludo=E2=80=99.