From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2bzr-00041y-0G for guix-patches@gnu.org; Sun, 01 Apr 2018 08:22:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2bzm-0004NB-CN for guix-patches@gnu.org; Sun, 01 Apr 2018 08:22:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:53894) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f2bzm-0004Mu-8O for guix-patches@gnu.org; Sun, 01 Apr 2018 08:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f2bzm-0003I0-2a for guix-patches@gnu.org; Sun, 01 Apr 2018 08:22:02 -0400 Subject: [bug#30801] [PATCH 0/1] Add opencv Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180313175809.7d782c1a@alma-ubu> <87po45rqx5.fsf@gnu.org> <20180401002649.37231b47@alma-ubu> Date: Sun, 01 Apr 2018 14:21:38 +0200 In-Reply-To: <20180401002649.37231b47@alma-ubu> ("=?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?="'s message of "Sun, 1 Apr 2018 00:26:49 +0200") Message-ID: <87a7unglrh.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?= Cc: 30801@debbugs.gnu.org Hello Bj=C3=B6rn, Bj=C3=B6rn H=C3=B6fling skribis: > On Thu, 15 Mar 2018 22:04:54 +0100 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > >> Hi Bj=C3=B6rn, >>=20 >> Bj=C3=B6rn H=C3=B6fling skribis: >>=20 >> > The test suite consists of an extra package, weighting 465MB >> > compressed. It runs very well. I think the size is worth it. It >> > consists of proprietary things (i.e. lena.jpg). As far as I >> > understand, that is OK, if it doesn't get in the final src/bin >> > store output. Right?=20=20 >>=20 >> As a rule of thumb, there should not be non-free stuff in the >> derivation graph. >>=20 >> If there=E2=80=99s non-free software, that=E2=80=99s not OK, even if it = doesn=E2=80=99t show >> up in the output. >>=20 >> If it=E2=80=99s =E2=80=9Cjust=E2=80=9D data (pictures) that are non-free= , that=E2=80=99s OK per the >> FSDG: >> . >> If we could replace it with a free variant, I think we should clearly >> encourage it, but lena.jpg is hardly replaceable in this context (I=E2= =80=99d >> hope it weren=E2=80=99t around for what it tells about CS, but that=E2= =80=99s another >> story=E2=80=A6). > > What is being downloaded is in the store of cause, but it is only > images and videos, no code. And it is not linked against. > > The suite is 400 MB in size and replacing Lena with Linus or even > better pictures and videos of trees would need a fundamental idea of > the algorithms behind OpenCV, with I don't have. So for now I just leave > it as is, though I agree with your fundamental ideas :-) OK, sounds good. > Most are 50MB, one is 265MB, I suppose that was the latest with all > dependencies and all (free) OpenCV modules. So the 1.1GB was > definitively the convex hull including all dependencies. > > The whole thing is more or less only "lib". > > I forgot to mention that I ignored the "doc" package: It built one when > I added doxygen as a dependency, but it did not install it. Now that I > know how to manually copy/install files, I could give that another try. > But that would add (to a :doc output, of cause), not substract. > > The "bin" part is only 7 MB, so not worth mentioning. There are some > examples which I did not include, because they are not very interesting > in the compiled version, but more for understanding the programming > part from the source code. OK. > OK, I looked into some other packages and tried to split it into pieces > (one piece for now). What I do is just add a phase after install and > copy things manually (copied from the git package definition): > > + (add-after 'install 'split > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((outputs-out (assoc-ref outputs "out")) > + (outputs-feature2d (assoc-ref outputs "feature2d")) > + (outputs-face (assoc-ref outputs "face")) > + (outputs-core (assoc-ref outputs "core")) > + (libface (string-append outputs-out "/lib/libopenc= v_face.so")) > + (libface* (string-append outputs-face "/lib/libopen= cv_face.so")) > + (libface3.4 (string-append outputs-out "/lib/libop= encv_face.so.3.4")) > + (libface3.4* (string-append outputs-face "/lib/libo= pencv_face.so.3.4")) > + (libface3.4.1 (string-append outputs-out "/lib/lib= opencv_face.so.3.4.1")) > + (libface3.4.1* (string-append outputs-face "/lib/li= bopencv_face.so.3.4.1"))) > + > +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > + (mkdir-p (string-append outputs-face "/lib")) > +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > + (for-each (lambda (old new) > + (copy-file old new) > + (delete-file old) > + (chmod new #o555)) > + (list libface libface3.4 libface3.4.1) > + (list libface* libface3.4* libface3.4.1*)) > + ) > + #t ; TODO: Implement it. > + )) > + ))) > > The problem here is that this doesn't correct the RPATHS and I will get > problems with dependent library parts (The python modules in that case): > > phase `strip' succeeded after 0.5 seconds > starting phase `validate-runpath' > validating RUNPATH of 46 binaries in "/gnu/store/f7aqk1my2bdprhgp3gxmnl92= 27gxf43m-opencv-3.4.1/lib"... > /gnu/store/f7aqk1my2bdprhgp3gxmnl9227gxf43m-opencv-3.4.1/lib/python3.6/si= te-packages/cv2.cpython-36m-x86_64-linux-gnu.so: error: depends on 'libopen= cv_face.so.3.4', which cannot be found in RUNPATH ("/gnu/store/f7aqk1my2bdp= rhgp3gxmnl9227gxf43m-opencv-3.4.1/lib" "/gnu/store/124ymrzp0dwx6qfh4r4r4763= sa5k48sv-libsm-1.2.2/lib" "/gnu/store/dbdjmralkrzqn6b093hp69bjljvfr7zm-libi= ce-1.0.9/lib" "/gnu/store/g7sak8qzk7lk06ggn38xpfv5mb8da6kk-libxt-1.1.5/lib"= "/gnu/store/n6acaivs0jwiwpidjr551dhdni5kgpcr-glibc-2.26.105-g0890d5379c/li= b" "/gnu/store/xfjba1kww8ngdc6nxldd8ly93nh13ayy-gcc-5.5.0-lib/lib" "/gnu/st= ore/xfjba1kww8ngdc6nxldd8ly93nh13ayy-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-l= inux-gnu/5.5.0/../../..") Right, you cannot just move .so files after the fact because cv2.cpython-36m-x86_64-linux-gnu.so, for instance, has =E2=80=A6/lib in its RUNPATH, not =E2=80=A6-lib/lib. If you wanted to do that, the right way to= do it would be by modifying the makefiles/cmakelists so that they explicitly install libopencv_face to =E2=80=A6-lib/lib. That said, it may be safer/easier to keep all libraries in the same output. BTW, are .a files installed? It would probably help save space to not install them. Thanks for the update & have a nice week-end! Ludo=E2=80=99.