Gentoo Archives: gentoo-science

From: "François Bissey" <f.r.bissey@×××××××××.nz>
To: gentoo-science@l.g.o
Subject: Re: [gentoo-science] [sage-on-gentoo]sage is now cleanly independent of ATLAS
Date: Sat, 17 Jul 2010 05:10:52
Message-Id: 201007171710.23163.f.r.bissey@massey.ac.nz
In Reply to: [gentoo-science] [sage-on-gentoo]sage is now cleanly independent of ATLAS by "François Bissey"
1 > Hi,
2 >
3 > I think I got the last bit of hardcoding of atlas in the building of sage.
4 > You can now use any (c)blas you want - including ATLAS if you wish.
5 > I know it will be a relief to some of you.
6 >
7 There are a few points that should be made clear I think.
8
9 If you want everything to work properly you need to compile everything
10 with one set up of cblas/blas/lapack otherwise some inconsistency will
11 appear. Also switching implementation on the fly may not necessarilly
12 work.
13
14 As an example I just switched from ATLAS to cblas=gsl, blas=goto
15 lapack=reference. However I had compiled everything against ATLAS.
16 Lets have a look at a library from numpy:
17 ldd /usr/lib/python2.6/site-packages/numpy/linalg/lapack_lite.so
18 linux-gate.so.1 => (0xb781c000)
19 liblapack.so.0 => /usr/lib/liblapack.so.0 (0xb727b000)
20 libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0xb7121000)
21 libc.so.6 => /lib/libc.so.6 (0xb6fb3000)
22 libblas.so.0 => /usr/lib/blas/atlas/libblas.so.0 (0xb6f93000)
23 libgfortran.so.3 => /usr/lib/gcc/i686-pc-linux-
24 gnu/4.4.4/libgfortran.so.3 (0xb6ecb000)
25 libm.so.6 => /lib/libm.so.6 (0xb6ea4000)
26 libgcc_s.so.1 => /usr/lib/gcc/i686-pc-linux-gnu/4.4.4/libgcc_s.so.1
27 (0xb6e86000)
28 libpthread.so.0 => /lib/libpthread.so.0 (0xb6e6c000)
29 libdl.so.2 => /lib/libdl.so.2 (0xb6e68000)
30 libutil.so.1 => /lib/libutil.so.1 (0xb6e63000)
31 /lib/ld-linux.so.2 (0xb781d000)
32 libatlas.so.0 => /usr/lib/libatlas.so.0 (0xb67a4000)
33
34 As you can see atlas path seems to be hardcoded for blas. If I compile
35 something against this numpy library now that I have switched problems
36 may occur.
37
38 scipy is another case that may misbehave, we even have an atlas_version.so
39 library produced.
40 ldd /usr/lib/python2.6/site-packages/scipy/linalg/atlas_version.so
41 linux-gate.so.1 => (0xb7726000)
42 libatlas.so.0 => /usr/lib/libatlas.so.0 (0xb7039000)
43 libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0xb6edf000)
44 libc.so.6 => /lib/libc.so.6 (0xb6d71000)
45 libm.so.6 => /lib/libm.so.6 (0xb6d4a000)
46 libpthread.so.0 => /lib/libpthread.so.0 (0xb6d30000)
47 libdl.so.2 => /lib/libdl.so.2 (0xb6d2b000)
48 libutil.so.1 => /lib/libutil.so.1 (0xb6d27000)
49 /lib/ld-linux.so.2 (0xb7727000)
50
51 And scipy rely on numpy too.
52 Anyway a recompile later with cblas from gsl:
53 ldd /usr/lib/python2.6/site-packages/scipy/linalg/cblas.so
54 linux-gate.so.1 => (0xb784f000)
55 libgslcblas.so.0 => /usr/lib/libgslcblas.so.0 (0xb77de000)
56 libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0xb7684000)
57 libc.so.6 => /lib/libc.so.6 (0xb7516000)
58 libm.so.6 => /lib/libm.so.6 (0xb74ef000)
59 libpthread.so.0 => /lib/libpthread.so.0 (0xb74d5000)
60 libdl.so.2 => /lib/libdl.so.2 (0xb74d0000)
61 libutil.so.1 => /lib/libutil.so.1 (0xb74cc000)
62 /lib/ld-linux.so.2 (0xb7850000)
63
64 Now we link to libgslcblas directly. Stand alone it may work (or not since I
65 didn't recompile numpy). Switching cblas won't affect that linking either.
66 But changing cblas with eselect and compiling against scipy without
67 recompiling it first may land you into trouble.
68
69 Francois