Gentoo Archives: gentoo-science

From: Danny van Dyk <kugelfang@g.o>
To: gentoo-science@l.g.o, sci@g.o
Subject: [gentoo-science] {blas,lapack}-config versus eselect
Date: Wed, 31 Aug 2005 21:25:33
Message-Id: 431620C9.5010901@gentoo.org
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Greetings,
5
6 [Sorry for my long absence, but I had to prepare for an important and
7 difficult exam that took me more time than I had whished it had.]
8
9 I'd like to get some input from you on my work on eselect[1] modules
10 replacing {blas,lapack}-config. To give you an impressions on the
11 differences between these modules and the current config tools, here
12 comes a short synopsis.
13
14 *-config rely on short bash scripts which are installed alongside the
15 packages. To switch between LAPACK and BLAS implementations, the
16 appropriate config tool sources the script and runs setup(). This is
17 error prone, as the get_libdir() problem has shown :-/
18
19 The corresponding eselect modules approach the setup differently. Each
20 packages that provides either BLAS or LAPACK has a dedicated check_*()
21 and setup_*() routine inside the module. For example, ACML has these
22 functions inside blas.eselect:
23
24 # check_* $libdir
25 # implementation specific check functions
26 check_ACML() {
27 # libacml.so provides C/C++ and FORTRAN 77 support
28 [[ -f ${1}/libacml.so ]] && echo "C F77"
29 }
30 [snip]
31 # is_active_* $lib
32 # return 0 if $lib points to an active BLAS implementation of profile *
33 is_active_ACML() {
34 [[ -L ${1} ]] || return 1
35 local lib=$(readlink -sn ${1})
36 [[ $(basename ${lib}) == libacml.so ]] \
37 && return 0
38 return 1
39 }
40 # setup_* $libdir $profile
41 # Implementation specific activation/setup functions
42 setup_ACML() {
43 if [[ ${2} == C ]] ; then
44 ln -sf ${1}/libacml.so ${1}/libcblas.so
45 ln -sf ${1}/libacml.so ${1}/libcblas.so.0
46 ln -sf ${1}/libacml.a ${1}/libcblas.a
47 elif [[ ${2} == F77 ]] ; then
48 ln -sf ${1}/libacml.so ${1}/libblas.so
49 ln -sf ${1}/libacml.so ${1}/libblas.so.0
50 ln -sf ${1}/libacml.a ${1}/libblas.a
51 else
52 die "Illegal profile: ${2}"
53 fi
54 }
55
56 The eselect modules currently include all features (beside support for
57 threaded-atlas) that blas-config and lapack-config provide. Further, the
58 eselect modules are prepard for BLAS/LAPACK implementations in other
59 programming languages (think of a FORTRAN 90/95 only implementation).
60
61 If nobody objects, I'd like to move all packages in the tree to PDEPEND
62 on eselect instead of {R}DEPENDing on {blas,lapack}-config.
63
64 Danny
65
66 [1] http://www.gentoo.org/proj/en/eselect
67 - --
68 Danny van Dyk <kugelfang@g.o>
69 Gentoo/AMD64 Project, Gentoo Scientific Project
70 -----BEGIN PGP SIGNATURE-----
71 Version: GnuPG v1.4.1 (GNU/Linux)
72
73 iD8DBQFDFiDIaVNL8NrtU6IRAubtAJ9fHKroXyBuGPno7R/4FBycAirorwCdGi/5
74 S6ZvAlZVRfVQrOkj0ehsNF0=
75 =1dNv
76 -----END PGP SIGNATURE-----
77 --
78 gentoo-science@g.o mailing list

Replies

Subject Author
Re: [gentoo-science] {blas,lapack}-config versus eselect Peter Bienstman <pbienst@g.o>