Gentoo Archives: gentoo-science

From: Aisha Tammy <gentoo.science@×××××.cc>
To: gentoo-science@l.g.o
Subject: Re: [gentoo-science] .la files harmful to BLAS/LAPACK structure
Date: Thu, 22 Oct 2020 00:23:30
Message-Id: bc6603bb-e5e9-4488-719f-cefd7fb0a637@aisha.cc
In Reply to: [gentoo-science] .la files harmful to BLAS/LAPACK structure by "François Bissey"
1 On 10/21/20 6:21 PM, François Bissey wrote:
2 > Hi all,
3 >
4 > So on and off removal of la files generated by libtool is discussed.
5 > science packages have now a strong incentive to remove them everywhere
6 > they can.
7 >
8 > It all started when I was examining the output of ldd -r on libgiac.so
9 > in the sage-on-gentoo overlay and I noticed that my selected openblas
10 > wasn’t the one being picked up. Netlib’s blas and lapack was picked up
11 > instead. There was still an instance of openblas via gsl.
12 >
13 > I had to ask myself why that was. The ldso selection works by putting
14 > a path to implementation library before /usr/lib{,64} in /etc/ld.so.conf.
15 > That way when library are resolved at runtime your blas/lapack implementation
16 > is chosen first.
17 >
18 > This mechanism can be thrown off if the library/executable has any RUNPATH
19 > set as those are resolved first. And there it was, in libgiac.so I had
20 > RUNPATH=//usr/lib64/ [yes with a double / not a mistake].
21 > I inspected giac’s code for a couple of days trying to see where it was coming from.
22 > In the end it wasn’t from anything in the code. The final clue was that
23 > when linking, not only did I have -Wl,-rpath //usr/lib64 coming out of
24 > nowhere libnauty was linked as /usr/lib64/libnauty.so instead of -lnauty.
25 >
26 Indeed, you are correct, this is not something we want.
27 We are actively working to remove these wherever we find them.
28 Unfortunately we are very short on volunteers and helpers.
29
30 > And indeed our new nauty ebuild, following debian’s lead, ship a library
31 > and installs .la files. Removing those .la files resulted in libgiac.so
32 > linking properly, the RUNPATH being removed and my choice of blas/lapack
33 > being respected.
34 >
35 > So what packages still ship .la files that would be of concern to us as they
36 > interfere with blas/lapack?
37 >
38 > * All the suitesparse ebuilds - that are not explicitly multibuild (messes up glpk).
39 > * All the coinor ebuilds - probably with the same exceptions for mutlibuild.
40 > * dev-libs/igraph (0.7.1-r2 at least, concerning as it links to blas/lapack)
41
42 I am maintaining igraph, the new versions don't install .la files, they use
43 proper pkg-config .pc files.
44
45 > * libsemigroup [sage-on-gentoo]
46 > * gap [sage-on-gentoo]
47 This package is messed up.
48 I am currently trying to upgrade this one for the ::science overlay
49 but the outlook is bleak. I might just tell people to use the package
50 in ::sage-on-gentoo, though currently my ebuild does manually remove
51 the .la files.
52 Theres just too many subpackages...
53
54 > * sci-libs/iml (concerning since it links to cblas)
55 > * sys-cluster/mpich
56 I am doubtful this package has any problems, the cluster team ebuilds are good
57 and there are active people in the project.
58
59 > * dev-libs/libltdl
60 > There are more installed here that look less dangerous but we never know,
61 > we should pursue elimination across the tree.
62 >
63 > Anything using libtool to build and depending on any of these, will inherit
64 > //usr/lib{,64}/ as a RUNPATH.
65 >
66 > François
67 >
68
69 Thanks a lot for the information, unfortunately this is cumbersome work and
70 ultimately we are very short on people.
71 If you could open bugs on bugs.gentoo.org that would be helpful to keep
72 track of these. Emails tend to be forgotten.
73
74 If you are interested, sending patches to fix this in a PR would be the best
75 solution and we would really appreciate the help :)
76
77 In any case, there is little we can do in a short amount of time, this is in
78 for the long haul.
79
80 Best,
81 Aisha

Replies

Subject Author
Re: [gentoo-science] .la files harmful to BLAS/LAPACK structure "François Bissey" <fbissey@××××××××××××.nz>