Gentoo Archives: gentoo-dev

From: Dominik Schmidt <schmidom@××××××××××××.ch>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Eclasses for BLAS and Lapack
Date: Mon, 04 Dec 2017 09:44:21
Message-Id: 1512376222.y199rz5qfl.astroid@X200.none
1 Hi there
3 Gentoo does not yet have a (proper) way of selecting a BLAS or Lapack implementation at compile time.
4 Hence I wrote two eclasses, which can be found in my fork of the science overlay:
6 *
7 *
9 They introduce blas_* and lapack_* USE flags. Ebuilds can specify BLAS_COMPAT and LAPACK_COMPAT, deciding what USE flags get added to IUSE and what (conditional) dependencies to DEPEND and RDEPEND.
10 pkgconfig is used to enforce the USE flag selected implementation during compilation.
12 But they do _not_ enforce library consistency at dynamic link time, e.g.
13 when Program A (dynamically) links to BLAS B1 and to Library C, which in turn links to BLAS B2, then executing A will result in symbol clashes and either B1 or B2 will overwrite the others symbols.
15 Dynamic linking consistency has been implemented at some point with a BLAS_USEDEP approach similar to python, i.e. ebuild A propagates a USE constraint to its dependencies via foo-bar/baz[blas_$impl?,blas_$impl2?,...], but there are issues with this. For example, packages might not depend on BLAS themselves but on two libraries which do depend on BLAS. There we would be unable to enforce a consistent implementation down the dependency graph.
16 Also, the complexity for writing ebuilds with this approach explodes, since you have to look up for every package whether they depend on BLAS and, if so, add the ${BLAS_USEDEP} to their USE constraints (and do the same for LAPACK).
18 The current eselect-mechanism would have to be left in place, since we probably want to provide a global default for non-portage built software.
20 Additional discussion on the sci-overlay GitHub issue:
21 The corresponding bugreport:
23 Any commentary and improvements would be greatly appreciated.
24 In fact, I do have a question at this point: I'm not sure whether to enforce a particular EAPI or not, and if so, which one.
26 Thank you for your attention,
27 Doeme


Subject Author
Re: [gentoo-dev] Eclasses for BLAS and Lapack Benda Xu <heroxbd@g.o>