Gentoo Archives: gentoo-dev

From: Benda Xu <heroxbd@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: BLAS and LAPACK runtime switching
Date: Wed, 29 May 2019 14:00:37
Message-Id: 878supwebp.fsf@proton.d.airelinux.org
In Reply to: Re: [gentoo-dev] RFC: BLAS and LAPACK runtime switching by David Seifert
1 Dear David,
2
3 David Seifert <soap@g.o> writes:
4
5 > We already have such a solution in the sci-overlay. It has proven
6 > extremely brittle and shaky.
7
8 What's more, using eselect set which library to link to was regarded
9 harmful.
10
11 > The plan is to do this via USE flags similar to python-single-r1
12 > flags.
13
14 Yes, that was the conclusion in 2017.
15
16 But now there is something to be renewed, see below.
17
18 > Optionally, we can leave a "virtual" USE flag, where users can switch
19 > implementation at runtime, but this will not be a supported
20 > configuration.
21
22 [...]
23
24 > While I understand that runtime-switching sounds like a great feature,
25 > it has proven too difficult to get right and too hard to enforce
26 > invariants on correct symlinks.
27
28 I thought so, too. Back in 2017, I did an investigate of Debian runtime
29 switching, and concluded the patches were too heavy for us. That was the
30 main reason we did not consider the Debian runtime switching way.[0, 1]
31
32 However, I have made a deeper study this year, and concluded it is quite
33 doable in a simple way in Gentoo.
34
35
36 Historically, in alternative{,-2}.eclass of the science overlay,
37 "alternative" is a name from Debian[2]. We have made it too complex over
38 the years, and now there is a good chance to make it simple again.
39
40 > People that want this can go the virtual+eselect approach in the
41 > overlay,
42
43 Which is brittle and shaky as we agree.
44
45 > but 99% of Gentoo users will be happy with just linking against
46 > OpenBLAS/reference-lapack and not having to fix weird stale symlinks
47 > that eselect-alternatives somehow lost track of.
48
49 With the simplified approach Mo is after, there will no longer be weird
50 stale symlinks issues. The solution has been successfully proved by the
51 update-alternative mechanism in Debian. Actually, by adopting mgorny's
52 LDPATH way of handing gcc runtime, we don't need symlinks at all![3]
53
54 For more details, please refer to
55 https://people.debian.org/~lumin/gsoc19-gentoo.pdf
56
57 > See also:
58 > https://bugs.gentoo.org/632624
59 > https://bugs.gentoo.org/348843#c30
60
61 Thanks. That reminded me of all the discussions we all along.
62
63 Yours,
64 Benda
65
66 0. https://github.com/gentoo/sci/issues/805#issuecomment-345690034
67 1. https://github.com/gentoo/sci/issues/805#issuecomment-345701064
68 2. https://github.com/gentoo/sci/issues/805#issuecomment-332887691
69 3. https://bugs.gentoo.org/632618