tag 351646 + patch

quit

Dear DD,

During my NM process I have to work on fixing one of the RC bugs and for
some reason I stopped at some point at this bug...

It seems that the bug is really caused by a bug of make. To overcome the
bug, simple patch is provided which let me to build atlas3 packages in
an unstable chroot. The patch is really just a shortcut to make "make"
happy, and I believe it should not have side effects even when make gets
fixed. 

I will file a bug against make, or should this bug better be
reassigned to make after you apply the bug so atlas3 could build
properly?

Below you can find description of the logic which led me to
develop this patch.


First I thought about backward incompatibilities of given version of
make mentioned in NEWS.gz file, but they seems to be irrelevant. Now
I bet that the version of make shipped at the moment
(3.80+3.81.rc1-1) has some issues with exploring the tree of implicit
rules:

Why do I think so: it seems that make use of the implicit rules which
lead to reported bug

lib%.so.$(SO): lib%.so.$(VER)
        ln -snf $$(basename $<) $@

lib%.so: lib%.so.$(SO)
        ln -snf $$(basename $<) $@

So they MUST take care about symlinking shlibs.

I already played with build environment for a while, so liblapack got
generated... but the same issue happens with other libraries, so look:

[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# dpkg-buildpackage -uc -us -nc
dpkg-buildpackage: source package is atlas3
dpkg-buildpackage: source version is 3.6.0-20
dpkg-buildpackage: source changed by Camm Maguire <[EMAIL PROTECTED]>
dpkg-buildpackage: host architecture i386
 debian/rules build
make: *** No rule to make target `debian/tmp/usr/lib/sse2/libcblas.so', needed 
by `build'.  Stop.
[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# make -f debian/rules 
debian/tmp/usr/lib/sse2/libcblas.so
make: *** No rule to make target `debian/tmp/usr/lib/sse2/libcblas.so'.  Stop.

so indeed it can't find a sequence of rules to generate .so, lets
specify version:

[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# make -f debian/rules 
debian/tmp/usr/lib/sse2/libcblas.so.3
make: *** No rule to make target `debian/tmp/usr/lib/sse2/libcblas.so.3'.  Stop.
[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# make -f debian/rules 
debian/tmp/usr/lib/sse2/libcblas.so.3.0
ln -snf $(basename lib/Linux_sse2_shared/libatlas.so.3.0) 
lib/Linux_sse2_shared/libatlas.so.3
ln -snf $(basename lib/Linux_sse2_shared/libatlas.so.3) 
lib/Linux_sse2_shared/libatlas.so
mkdir tmp;
cd tmp && ar x ../lib/Linux_sse2_shared/libcblas.a;
rm -f tmp/ilaenv.o
cc -shared -Wl,-soname=libcblas.so.3 -o lib/Linux_sse2_shared/libcblas.so.3.0 
tmp/*.o -L lib/Linux_sse2_shared -latlas;
rm -fr tmp;
mkdir -p $(dirname debian/tmp/usr/lib/sse2/libcblas.so.3.0)
install lib/Linux_sse2_shared/libcblas.so.3.0 
debian/tmp/usr/lib/sse2/libcblas.so.3.0

[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# make -f debian/rules 
debian/tmp/usr/lib/sse2/libcblas.so
ln -snf $(basename debian/tmp/usr/lib/sse2/libcblas.so.3.0) 
debian/tmp/usr/lib/sse2/libcblas.so.3
ln -snf $(basename debian/tmp/usr/lib/sse2/libcblas.so.3) 
debian/tmp/usr/lib/sse2/libcblas.so

now it builds and if then it links without a problem;-)

Lets now go backwards and start removing target files until we hit the
point when it doesn't build any more

[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# rm 
debian/tmp/usr/lib/sse2/libcblas.so* lib/Linux_sse2_shared/libcblas.so.3.0
[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# make -f debian/rules 
debian/tmp/usr/lib/sse2/libcblas.so
mkdir tmp;
cd tmp && ar x ../lib/Linux_sse2_shared/libcblas.a;
rm -f tmp/ilaenv.o
cc -shared -Wl,-soname=libcblas.so.3 -o lib/Linux_sse2_shared/libcblas.so.3.0 
tmp/*.o -L lib/Linux_sse2_shared -latlas;
rm -fr tmp;
mkdir -p $(dirname debian/tmp/usr/lib/sse2/libcblas.so.3.0)
install lib/Linux_sse2_shared/libcblas.so.3.0 
debian/tmp/usr/lib/sse2/libcblas.so.3.0
ln -snf $(basename debian/tmp/usr/lib/sse2/libcblas.so.3.0) 
debian/tmp/usr/lib/sse2/libcblas.so.3
ln -snf $(basename debian/tmp/usr/lib/sse2/libcblas.so.3) 
debian/tmp/usr/lib/sse2/libcblas.so

BUT if we remove linked libcblas.so, it breaks again:

[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# rm 
debian/tmp/usr/lib/sse2/libcblas.so* lib/Linux_sse2_shared/libcblas.so.3.0 
lib/Linux_sse2_shared/libatlas.so
[EMAIL PROTECTED]:/var/tmp/atlas3-3.6.0# make -f debian/rules
debian/tmp/usr/lib/sse2/libcblas.so
make: *** No rule to make target `debian/tmp/usr/lib/sse2/libcblas.so'.
Stop.

So apparently make could not handle mixed implicit rules of a length
longer than X (lazy to count at the moment). Thus the patch I am
providing creates a shortcut to go from .so.$(VER) to .so which resolves
the issue.  Also the same bug reproduced itself in a simple test
case:


> cat  Makefile
SO=1
T=2
VER=$(SO).$(T)

lib%.so:lib%.so.$(SO)
        ln -snf $$(basename $<) $@

lib%.so.$(SO):lib%.so.$(VER)
        ln -snf $$(basename $<) $@

a/b/c/lib%.so.1.2: a/b/c/libz%.so
        cat $< >| $@
        
> rm a/b/c/* -f
> /var/tmp/test# echo 1 > a/b/c/libzz.so.1.2
> /var/tmp/test# make a/b/c/libz.so
make: *** No rule to make target `a/b/c/libz.so'.  Stop.
> /var/tmp/test# make a/b/c/libz.so.1.2
ln -snf $(basename a/b/c/libzz.so.1.2) a/b/c/libzz.so.1
ln -snf $(basename a/b/c/libzz.so.1) a/b/c/libzz.so
cat a/b/c/libzz.so >| a/b/c/libz.so.1.2
rm a/b/c/libzz.so a/b/c/libzz.so.1
> /var/tmp/test# make a/b/c/libz.so
ln -snf $(basename a/b/c/libz.so.1.2) a/b/c/libz.so.1
ln -snf $(basename a/b/c/libz.so.1) a/b/c/libz.so
rm a/b/c/libz.so.1

-- 
                                  .-.
=------------------------------   /v\  ----------------------------=
Keep in touch                    // \\     (yoh@|www.)onerussian.com
Yaroslav Halchenko              /(   )\               ICQ#: 60653192
                   Linux User    ^^-^^    [175555]


--- debian/rules.b      2006-03-21 05:48:25.000000000 +0000
+++ debian/rules        2006-03-21 05:49:43.000000000 +0000
@@ -677,6 +677,10 @@
 lib%.so: lib%.so.$(SO)
        ln -snf $$(basename $<) $@
 
+lib%.so: lib%.so.$(VER)
+       ln -snf $$(basename $<).$(VER) $<.$(SO)
+       ln -snf $$(basename $<) $<.$(VER)
+
 
 #
 #

Attachment: pgpPq9JduNZyM.pgp
Description: PGP signature

Reply via email to