[lapack] 16/17: Build libblas* binary packages (taken over from src:blas).

Sébastien Villemot sebastien at debian.org
Thu Dec 24 20:40:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastien pushed a commit to branch master
in repository lapack.

commit 4b86b91da9921668a14331e0f31b06f9acbe6856
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Thu Dec 24 21:28:26 2015 +0100

    Build libblas* binary packages (taken over from src:blas).
    
    + New patches:
      - cblas-makerule.patch
      - cblas-test-output.patch
      - cblas-zblat2.patch
      - icamax-izamax-extended-precision.patch
    + libblas-doc is now a transitional package (depends on
      liblapack-doc-man). Unmaintained cinterface.pdf and faq.html have
      been dropped.
    + libblas-test: ship test data files in /usr/lib/libblas.
    + libblas-dev now suggests liblapack-doc{,-man}.
    + Patches not taken from src:blas:
      - an apparently wrong patch for crotg.
      - the big patch for dealing with info codes in cblas routines when
        used in row major order, when xerbla was overriden by the user.
        The modified behavior was debatable, and at any rate, it is not
        implemented in ATLAS and OpenBLAS.
    
    Gbp-Dch: Full
---
 .gitignore                                         | 43 +++++++++++
 debian/control                                     | 83 ++++++++++++++++++++--
 debian/libblas-dev.install                         |  6 ++
 debian/libblas-dev.postinst                        | 16 +++++
 debian/libblas-dev.prerm                           | 12 ++++
 debian/libblas-test.examples                       |  1 +
 debian/libblas-test.install                        | 40 +++++++++++
 debian/libblas3.install                            |  1 +
 debian/libblas3.postinst                           | 14 ++++
 debian/libblas3.prerm                              | 12 ++++
 debian/patches/cblas-makerule.patch                | 42 +++++++++++
 debian/patches/cblas-test-output.patch             | 67 +++++++++++++++++
 debian/patches/cblas-zblat2.patch                  | 60 ++++++++++++++++
 .../patches/icamax-izamax-extended-precision.patch | 23 ++++++
 debian/patches/series                              |  4 ++
 debian/rules                                       | 80 ++++++++++++++++-----
 debian/run_blas_tests.sh                           | 30 ++++++++
 debian/shlibs.local                                |  1 +
 18 files changed, 513 insertions(+), 22 deletions(-)

diff --git a/.gitignore b/.gitignore
index c7b10b7..11ed95b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,6 +41,21 @@ debian/libtmglib-dev/
 debian/libtmglib3.debhelper.log
 debian/libtmglib3.substvars
 debian/libtmglib3/
+debian/libblas-common.debhelper.log
+debian/libblas-common.substvars
+debian/libblas-common/
+debian/libblas-dev.debhelper.log
+debian/libblas-dev.substvars
+debian/libblas-dev/
+debian/libblas-test.debhelper.log
+debian/libblas-test.substvars
+debian/libblas-test/
+debian/libblas3.debhelper.log
+debian/libblas3.substvars
+debian/libblas3/
+debian/libblas-doc.debhelper.log
+debian/libblas-doc.substvars
+debian/libblas-doc/
 debian/.debhelper/
 lapack-netlib.pc
 DOCS/explore-html/
@@ -70,4 +85,32 @@ TESTING/xlintstrfd
 TESTING/xlintstrfs
 TESTING/xlintstrfz
 TESTING/xlintstzc
+BLAS/blas-netlib.pc
+BLAS/xblat1c
+BLAS/xblat1d
+BLAS/xblat1s
+BLAS/xblat1z
+BLAS/xblat2c
+BLAS/xblat2d
+BLAS/xblat2s
+BLAS/xblat2d
+BLAS/xblat2s
+BLAS/xblat2z
+BLAS/xblat3c
+BLAS/xblat3d
+BLAS/xblat3s
+BLAS/xblat3z
+CBLAS/include/cblas_mangling.h
+CBLAS/testing/xccblat1
+CBLAS/testing/xccblat2
+CBLAS/testing/xccblat3
+CBLAS/testing/xdcblat1
+CBLAS/testing/xdcblat2
+CBLAS/testing/xdcblat3
+CBLAS/testing/xscblat1
+CBLAS/testing/xscblat2
+CBLAS/testing/xscblat3
+CBLAS/testing/xzcblat1
+CBLAS/testing/xzcblat2
+CBLAS/testing/xzcblat3
 output_err
diff --git a/debian/control b/debian/control
index 4ab52bd..755de17 100644
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,7 @@ Section: libs
 Priority: optional
 Maintainer: Debian Science Team <debian-science-maintainers at lists.alioth.debian.org>
 Uploaders: Sébastien Villemot <sebastien at debian.org>
-Build-Depends: debhelper (>= 9), gfortran, libblas-dev (>= 1.2.20110419-3),
- python, dpkg-dev (>= 1.16.1~)
+Build-Depends: debhelper (>= 9), gfortran, python, dpkg-dev (>= 1.16.1~)
 Build-Depends-Indep: doxygen, graphviz
 Standards-Version: 3.9.6
 Homepage: http://www.netlib.org/lapack/
@@ -108,9 +107,10 @@ Package: liblapack-dbg
 Section: debug
 Priority: extra
 Architecture: any
-Depends: ${misc:Depends}, liblapack3 (= ${binary:Version}),
+Depends: ${misc:Depends}, libblas3 (= ${binary:Version}),
+         liblapack3 (= ${binary:Version}),
          liblapacke (= ${binary:Version}), libtmglib3 (= ${binary:Version}),
-         liblapack-test
+         libblas-test, liblapack-test
 Description: Library of linear algebra routines 3 - debugging symbols
  LAPACK version 3.X is a comprehensive FORTRAN library that does
  linear algebra operations including matrix inversions, least
@@ -119,8 +119,8 @@ Description: Library of linear algebra routines 3 - debugging symbols
  comprehensive and reputable package that has found extensive
  use in the scientific community.
  .
- This package contains the debugging symbols for LAPACK, the companion
- libraries LAPACKE and tmglib, and the test programs.
+ This package contains the debugging symbols for reference BLAS, LAPACK, the
+ companion libraries LAPACKE and tmglib, and the test programs.
 
 Package: liblapack-test
 Section: devel
@@ -174,3 +174,74 @@ Description: Library of linear algebra routines 3 - documentation (manual pages)
  use in the scientific community.
  .
  This package contains manpages for all BLAS and LAPACK routines.
+
+Package: libblas3
+Architecture: any
+Provides: libblas.so.3
+Depends: ${shlibs:Depends}, ${misc:Depends}, libblas-common
+Description: Basic Linear Algebra Reference implementations, shared library
+ BLAS (Basic Linear Algebra Subroutines) is a set of efficient
+ routines for most of the basic vector and matrix operations.
+ They are widely used as the basis for other high quality linear
+ algebra software, for example lapack and linpack.  This
+ implementation is the Fortran 77 reference implementation found
+ at netlib.
+ .
+ This package contains a shared version of the library.
+
+Package: libblas-common
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Dependency package for all BLAS implementations
+ The only purpose of this empty package is to ensure multi-arch safety of
+ different BLAS implementations. See bug #760936 for more details.
+
+Package: libblas-dev
+Architecture: any
+Section: libdevel
+Provides: libblas.so
+Depends: libblas3 (= ${binary:Version}), ${misc:Depends}, gfortran
+Suggests: liblapack-doc-man, liblapack-doc
+Description: Basic Linear Algebra Subroutines 3, static library
+ This package is a binary incompatible upgrade to the blas-dev
+ package. Several minor changes to the C interface have been
+ incorporated.
+ .
+ BLAS (Basic Linear Algebra Subroutines) is a set of efficient
+ routines for most of the basic vector and matrix operations.
+ They are widely used as the basis for other high quality linear
+ algebra software, for example lapack and linpack.  This
+ implementation is the Fortran 77 reference implementation found
+ at netlib.
+ .
+ This package contains a static version of the library.
+
+Package: libblas-test
+Architecture: any
+Section: devel
+Priority: extra
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Basic Linear Algebra Subroutines 3, testing programs
+ BLAS (Basic Linear Algebra Subroutines) is a set of efficient
+ routines for most of the basic vector and matrix operations.
+ They are widely used as the basis for other high quality linear
+ algebra software, for example lapack and linpack.  This
+ implementation is the Fortran 77 reference implementation found
+ at netlib.
+ .
+ This package contains a set of programs which test the integrity of an
+ installed blas-compatible shared library. These programs may therefore be used
+ to test the libraries provided by the blas package as well as those provided
+ by the libatlas3-base and libopenblas-base packages. The programs are
+ dynamically linked -- one can explicitly select a library to test by setting
+ the libblas.so.3 alternative, or by using the LD_LIBRARY_PATH or LD_PRELOAD
+ environment variables. Likewise, one can display the library selected using
+ the ldd program in an identical environment.
+
+Package: libblas-doc
+Architecture: all
+Section: oldlibs
+Priority: extra
+Depends: ${misc:Depends}, liblapack-doc-man
+Description: Transitional package for BLAS manpages
+ This is a transitional dummy package. It can be safely removed.
diff --git a/debian/libblas-dev.install b/debian/libblas-dev.install
new file mode 100644
index 0000000..58b0a87
--- /dev/null
+++ b/debian/libblas-dev.install
@@ -0,0 +1,6 @@
+libblas.so usr/lib/libblas/
+libblas.a usr/lib/libblas/
+CBLAS/include/cblas.h usr/include/
+CBLAS/include/cblas_mangling.h usr/include/
+CBLAS/include/cblas_f77.h usr/include/
+BLAS/blas-netlib.pc usr/lib/pkgconfig
diff --git a/debian/libblas-dev.postinst b/debian/libblas-dev.postinst
new file mode 100644
index 0000000..bac876b
--- /dev/null
+++ b/debian/libblas-dev.postinst
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+set -e
+
+update-alternatives --install /usr/lib/libblas.so libblas.so /usr/lib/libblas/libblas.so 10 \
+     --slave /usr/lib/libblas.a libblas.a /usr/lib/libblas/libblas.a \
+     --slave /usr/lib/pkgconfig/blas.pc blas.pc /usr/lib/pkgconfig/blas-netlib.pc
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/libblas-dev.prerm b/debian/libblas-dev.prerm
new file mode 100644
index 0000000..a6cc0b3
--- /dev/null
+++ b/debian/libblas-dev.prerm
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "upgrade" ]
+then
+    update-alternatives --remove libblas.so /usr/lib/libblas/libblas.so
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/libblas-test.examples b/debian/libblas-test.examples
new file mode 100644
index 0000000..c766507
--- /dev/null
+++ b/debian/libblas-test.examples
@@ -0,0 +1 @@
+debian/run_blas_tests.sh
diff --git a/debian/libblas-test.install b/debian/libblas-test.install
new file mode 100644
index 0000000..cf55e09
--- /dev/null
+++ b/debian/libblas-test.install
@@ -0,0 +1,40 @@
+BLAS/xblat1c /usr/lib/libblas/
+BLAS/xblat2c /usr/lib/libblas/
+BLAS/xblat3c /usr/lib/libblas/
+BLAS/xblat1d /usr/lib/libblas/
+BLAS/xblat2d /usr/lib/libblas/
+BLAS/xblat3d /usr/lib/libblas/
+BLAS/xblat1s /usr/lib/libblas/
+BLAS/xblat2s /usr/lib/libblas/
+BLAS/xblat3s /usr/lib/libblas/
+BLAS/xblat1z /usr/lib/libblas/
+BLAS/xblat2z /usr/lib/libblas/
+BLAS/xblat3z /usr/lib/libblas/
+BLAS/cblat2.in /usr/lib/libblas/
+BLAS/cblat3.in /usr/lib/libblas/
+BLAS/dblat2.in /usr/lib/libblas/
+BLAS/dblat3.in /usr/lib/libblas/
+BLAS/sblat2.in /usr/lib/libblas/
+BLAS/sblat3.in /usr/lib/libblas/
+BLAS/zblat2.in /usr/lib/libblas/
+BLAS/zblat3.in /usr/lib/libblas/
+CBLAS/testing/xccblat1 /usr/lib/libblas/
+CBLAS/testing/xccblat2 /usr/lib/libblas/
+CBLAS/testing/xccblat3 /usr/lib/libblas/
+CBLAS/testing/xdcblat1 /usr/lib/libblas/
+CBLAS/testing/xdcblat2 /usr/lib/libblas/
+CBLAS/testing/xdcblat3 /usr/lib/libblas/
+CBLAS/testing/xscblat1 /usr/lib/libblas/
+CBLAS/testing/xscblat2 /usr/lib/libblas/
+CBLAS/testing/xscblat3 /usr/lib/libblas/
+CBLAS/testing/xzcblat1 /usr/lib/libblas/
+CBLAS/testing/xzcblat2 /usr/lib/libblas/
+CBLAS/testing/xzcblat3 /usr/lib/libblas/
+CBLAS/testing/cin2 /usr/lib/libblas/
+CBLAS/testing/cin3 /usr/lib/libblas/
+CBLAS/testing/din2 /usr/lib/libblas/
+CBLAS/testing/din3 /usr/lib/libblas/
+CBLAS/testing/sin2 /usr/lib/libblas/
+CBLAS/testing/sin3 /usr/lib/libblas/
+CBLAS/testing/zin2 /usr/lib/libblas/
+CBLAS/testing/zin3 /usr/lib/libblas/
diff --git a/debian/libblas3.install b/debian/libblas3.install
new file mode 100644
index 0000000..ded6b76
--- /dev/null
+++ b/debian/libblas3.install
@@ -0,0 +1 @@
+libblas.so.* usr/lib/libblas/
diff --git a/debian/libblas3.postinst b/debian/libblas3.postinst
new file mode 100644
index 0000000..89028f6
--- /dev/null
+++ b/debian/libblas3.postinst
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+
+update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 /usr/lib/libblas/libblas.so.3 10
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/libblas3.prerm b/debian/libblas3.prerm
new file mode 100644
index 0000000..ea30455
--- /dev/null
+++ b/debian/libblas3.prerm
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "upgrade" ]
+then
+    update-alternatives --remove libblas.so.3 /usr/lib/libblas/libblas.so.3
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/patches/cblas-makerule.patch b/debian/patches/cblas-makerule.patch
new file mode 100644
index 0000000..4e80a05
--- /dev/null
+++ b/debian/patches/cblas-makerule.patch
@@ -0,0 +1,42 @@
+Description: Misc fixes for CBLAS build system
+ - the "cblaslib" make rule from toplevel now creates the cblas_mangling.h
+   header
+ - the "cleancblas_testing" make rule from toplevel now cleans all testing data
+ - the "clean" make rul from CBLAS/testing now cleans the *.out files generated
+   by test programs
+Author: Sébastien Villemot <sebastien at debian.org>
+Forwarded: no
+Last-Update: 2015-12-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,7 @@ blaslib:
+ 	( cd BLAS/SRC; $(MAKE) )
+ 
+ cblaslib:
+-	( cd CBLAS/src; $(MAKE) )
++	( cd CBLAS; $(MAKE) )
+ 
+ lapacklib:	lapack_install
+ 	( cd SRC; $(MAKE) )
+@@ -117,7 +117,7 @@ cleanblas_testing:
+ 	( cd BLAS; rm -f xblat* )
+ 
+ cleancblas_testing:
+-	( cd CBLAS; $(MAKE) cleanexe )
++	( cd CBLAS/testing; $(MAKE) clean )
+ 
+ cleantesting:
+ 	( cd TESTING/LIN; $(MAKE) clean )
+--- a/CBLAS/testing/Makefile
++++ b/CBLAS/testing/Makefile
+@@ -41,7 +41,7 @@ all2: stest2 dtest2 ctest2 ztest2
+ all3: stest3 dtest3 ctest3 ztest3
+ 
+ clean:
+-	rm -f core *.o a.out x*
++	rm -f core *.o *.out x*
+ cleanobj:
+ 	rm -f core *.o a.out 
+ cleanexe:
diff --git a/debian/patches/cblas-test-output.patch b/debian/patches/cblas-test-output.patch
new file mode 100644
index 0000000..60c8c6a
--- /dev/null
+++ b/debian/patches/cblas-test-output.patch
@@ -0,0 +1,67 @@
+Description: Fix output descriptors of c_{s,d,c,z}blat3
+ The NTRA argument can be equal to -1 if one does not want a snapshot file
+ (and this is the case with sample data {s,d,c,z}in3).
+ The routines {S,D,C,Z}PRCN3 will try to use their first argument as an output
+ unit number, so we avoid calling them when NTRA < 0.
+Author: Camm Maguire <camm at enhanced.com>
+Author: Sébastien Villemot <sebastien at debian.org>
+Forwarded: no
+Last-Update: 2015-12-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/CBLAS/testing/c_cblat3.f
++++ b/CBLAS/testing/c_cblat3.f
+@@ -1365,8 +1365,9 @@
+ *
+   150 CONTINUE
+       WRITE( NOUT, FMT = 9996 )SNAME
+-      CALL CPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
+-     $      M, N, ALPHA, LDA, LDB)
++      IF( TRACE )
++     $   CALL CPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
++     $         M, N, ALPHA, LDA, LDB)
+ *
+   160 CONTINUE
+       RETURN
+--- a/CBLAS/testing/c_dblat3.f
++++ b/CBLAS/testing/c_dblat3.f
+@@ -1335,8 +1335,9 @@
+ *
+   150 CONTINUE
+       WRITE( NOUT, FMT = 9996 )SNAME
+-      CALL DPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
+-     $      M, N, ALPHA, LDA, LDB)
++      IF( TRACE )
++     $   CALL DPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
++     $         M, N, ALPHA, LDA, LDB)
+ *
+   160 CONTINUE
+       RETURN
+--- a/CBLAS/testing/c_sblat3.f
++++ b/CBLAS/testing/c_sblat3.f
+@@ -1339,8 +1339,9 @@
+ *
+   150 CONTINUE
+       WRITE( NOUT, FMT = 9996 )SNAME
+-      CALL SPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
+-     $      M, N, ALPHA, LDA, LDB)
++      IF( TRACE )
++     $   CALL SPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
++     $         M, N, ALPHA, LDA, LDB)
+ *
+   160 CONTINUE
+       RETURN
+--- a/CBLAS/testing/c_zblat3.f
++++ b/CBLAS/testing/c_zblat3.f
+@@ -1366,8 +1366,9 @@
+ *
+   150 CONTINUE
+       WRITE( NOUT, FMT = 9996 )SNAME
+-      CALL ZPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
+-     $      M, N, ALPHA, LDA, LDB)
++      IF( TRACE )
++     $   CALL ZPRCN3( NTRA, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG,
++     $         M, N, ALPHA, LDA, LDB)
+ *
+   160 CONTINUE
+       RETURN
diff --git a/debian/patches/cblas-zblat2.patch b/debian/patches/cblas-zblat2.patch
new file mode 100644
index 0000000..2dd9da6
--- /dev/null
+++ b/debian/patches/cblas-zblat2.patch
@@ -0,0 +1,60 @@
+Description: Fix CBLAS double complex level 2 tests
+ The SNAME variable contains names of C functions like "cblas_dgemv".
+ Apparently the code was not taking into account the 6-letter "cblas_"
+ prefix when determining the task to be done.
+ .
+ The issue does not affect c_{s,d,c}blat2.f, which use the correct
+ offsetting.
+Author: Camm Maguire <camm at enhanced.com>
+Forwarded: no
+Reviewed-by: Sébastien Villemot <sebastien at debian.org>
+Last-Update: 2015-12-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/CBLAS/testing/c_zblat2.f
++++ b/CBLAS/testing/c_zblat2.f
+@@ -1350,7 +1350,7 @@
+ *
+ *                       Call the subroutine.
+ *
+-                        IF( SNAME( 4: 5 ).EQ.'mv' )THEN
++                        IF( SNAME( 10: 11 ).EQ.'mv' )THEN
+                            IF( FULL )THEN
+                               IF( TRACE )
+      $                           WRITE( NTRA, FMT = 9993 )NC, SNAME,
+@@ -1376,7 +1376,7 @@
+                               CALL CZTPMV( IORDER, UPLO, TRANS, DIAG,
+      $                                    N, AA, XX, INCX )
+                            END IF
+-                        ELSE IF( SNAME( 4: 5 ).EQ.'sv' )THEN
++                        ELSE IF( SNAME( 10: 11 ).EQ.'sv' )THEN
+                            IF( FULL )THEN
+                               IF( TRACE )
+      $                           WRITE( NTRA, FMT = 9993 )NC, SNAME,
+@@ -1465,7 +1465,7 @@
+                         END IF
+ *
+                         IF( .NOT.NULL )THEN
+-                           IF( SNAME( 4: 5 ).EQ.'mv' )THEN
++                           IF( SNAME( 10: 11 ).EQ.'mv' )THEN
+ *
+ *                             Check the result.
+ *
+@@ -1473,7 +1473,7 @@
+      $                                    INCX, ZERO, Z, INCX, XT, G,
+      $                                    XX, EPS, ERR, FATAL, NOUT,
+      $                                    .TRUE. )
+-                           ELSE IF( SNAME( 4: 5 ).EQ.'sv' )THEN
++                           ELSE IF( SNAME( 10: 11 ).EQ.'sv' )THEN
+ *
+ *                             Compute approximation to original vector.
+ *
+@@ -1611,7 +1611,7 @@
+ *     .. Common blocks ..
+       COMMON             /INFOC/INFOT, NOUTC, OK
+ *     .. Executable Statements ..
+-      CONJ = SNAME( 5: 5 ).EQ.'c'
++      CONJ = SNAME( 11: 11 ).EQ.'c'
+ *     Define the number of arguments.
+       NARGS = 9
+ *
diff --git a/debian/patches/icamax-izamax-extended-precision.patch b/debian/patches/icamax-izamax-extended-precision.patch
new file mode 100644
index 0000000..ad8bc48
--- /dev/null
+++ b/debian/patches/icamax-izamax-extended-precision.patch
@@ -0,0 +1,23 @@
+Description: Fix i{c,z}amax behavior on any-i386 and m68k
+ On arches with extended precision (any-i386 and m68k), the icamax and izamax
+ routines must be compiled with -ffloat-store, in order to avoid the extra
+ precision bits which make the test fails.
+ .
+ The FFLAGS_FLOAT_STORE variable is set by debian/rules.
+Author: Sébastien Villemot <sebastien at debian.org>
+Forwarded: not-needed
+Last-Update: 2015-12-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/BLAS/SRC/Makefile
++++ b/BLAS/SRC/Makefile
+@@ -169,3 +169,9 @@ clean:
+ 
+ .f.o: 
+ 	$(FORTRAN) $(OPTS) -c $< -o $@
++
++icamax.o: icamax.f
++	$(FORTRAN) $(OPTS) $(FFLAGS_FLOAT_STORE) -c $< -o $@
++
++izamax.o: izamax.f
++	$(FORTRAN) $(OPTS) $(FFLAGS_FLOAT_STORE) -c $< -o $@
diff --git a/debian/patches/series b/debian/patches/series
index 1028f12..d694930 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,7 @@
 lapack_testing.patch
 parallel_build.patch
 doxygen-exclude-binary-objects.patch
+cblas-makerule.patch
+icamax-izamax-extended-precision.patch
+cblas-test-output.patch
+cblas-zblat2.patch
diff --git a/debian/rules b/debian/rules
index 36ef7e2..0aa0dd3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 
-include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/default.mk
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
@@ -20,17 +20,26 @@ CC:=/usr/bin/cc
 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
 
-ARCH:=$(shell dpkg --print-architecture)
-
-ifeq ($(ARCH),alpha)
+ifeq ($(DEB_HOST_ARCH),alpha)
   FFLAGS += -mieee
   FFLAGS_NOOPT += -mieee
 endif
 
+# On arches with extended precision, this flag is used
+# for BLAS when compiling i{c,z}amax.f and the BLAS testsuite,
+# in order to avoid test failures.
+# See also debian/patches/icamax-izamax-extended-precision.patch
+ifneq (,$(filter $(DEB_HOST_ARCH_CPU),i386 m68k))
+  FFLAGS_FLOAT_STORE := -ffloat-store
+  export FFLAGS_FLOAT_STORE
+endif
+
+FFLAGS_BLAS_TESTSUITE := $(FFLAGS) $(FFLAGS_FLOAT_STORE)
+
 # Using the -frecursive flag is the solution recommended by upstream for #693269
-# However, we don't want to use -frecursive for the testsuite, it leads to
+# However, we don't want to use -frecursive for the LAPACK testsuite, it leads to
 #  segfaults on mips{,el} (xeigtstz allocates too much space on the stack)
-FFLAGS_TESTSUITE := $(FFLAGS)
+FFLAGS_LAPACK_TESTSUITE := $(FFLAGS)
 FFLAGS += -frecursive
 FFLAGS_NOOPT += -frecursive
 
@@ -49,7 +58,7 @@ make.inc: INSTALL/make.inc.gfortran
 	    -e "s,\(^OPTS  *=\).*,\1 \$$(PICOPTS) $(FFLAGS),1" \
 	    -e "s/\(^LOADOPTS  *=\).*/\1 $(LDFLAGS)/1" \
 	    -e "s,\(^CFLAGS  *=\).*,\1 $(CPPFLAGS) \$$(PICOPTS) $(CFLAGS),1" \
-	    -e "s,[^ ]*blas[^ ]*\.a,-lblas,1" < $< > $@
+	    < $< > $@
 
 override_dh_auto_clean: make.inc
 	$(MAKE) cleanall
@@ -57,9 +66,10 @@ override_dh_auto_clean: make.inc
 	rm -rf debian/test/ debian/time/
 	rm -f TESTING/tmp TESTING/testing_results.txt
 	rm -f LAPACKE/include/lapacke_mangling.h
+	rm -f CBLAS/include/cblas_mangling.h
 	rm -rf DOCS/explore-html/ DOCS/man/
 	rm -f output_err
-	rm -f lapack-netlib.pc LAPACKE/lapacke.pc
+	rm -f lapack-netlib.pc LAPACKE/lapacke.pc BLAS/blas-netlib.pc
 	rm -f make.inc
 
 override_dh_auto_configure: make.inc
@@ -73,14 +83,30 @@ override_dh_auto_configure: make.inc
 	    -e "s%@prefix@%/usr%"  \
 	    -e "s%@libdir@%/usr/lib%" < LAPACKE/lapacke.pc.in > LAPACKE/lapacke.pc
 
+	# Create blas-netlib.pc
+	sed -e "s%@LAPACK_VERSION@%$(DEB_VERSION_UPSTREAM)%" \
+	    -e "s%@prefix@%/usr%"  \
+	    -e "s%@libdir@%/usr/lib%" < BLAS/blas.pc.in > BLAS/blas-netlib.pc
+
 override_dh_auto_build-arch:
 	# Build pic libraries
 	$(MAKE) cleanlib
-	$(MAKE) lapacklib tmglib lapackelib PICOPTS=-fPIC
+	$(MAKE) blaslib cblaslib lapacklib tmglib lapackelib PICOPTS=-fPIC
+	mv librefblas.a librefblas_pic.a
+	mv libcblas.a libcblas_pic.a
 	mv liblapack.a liblapack_pic.a
 	mv libtmglib.a libtmglib_pic.a
 	mv liblapacke.a liblapacke_pic.a
 
+	# Build libblas.so.*
+	ar d librefblas_pic.a xerbla.o # We want to use the xerbla.o from libcblas_pic.a
+	mkdir -p tmp
+	cd tmp && ar x ../librefblas_pic.a && ar x ../libcblas_pic.a
+	$(F77) -shared -Wl,-soname=libblas.so.$(SO) -o libblas.so.$(DEB_VERSION_UPSTREAM) tmp/*.o $(LDFLAGS)
+	rm -rf tmp
+	ln -s libblas.so.$(DEB_VERSION_UPSTREAM) libblas.so.$(SO)
+	ln -s libblas.so.$(DEB_VERSION_UPSTREAM) libblas.so
+
 	# Build liblapack.so.*
 	mkdir -p tmp
 	cd tmp && ar x ../liblapack_pic.a
@@ -107,10 +133,21 @@ override_dh_auto_build-arch:
 
 	# Build static versions
 	$(MAKE) cleanlib
-	$(MAKE) lapacklib tmglib lapackelib
+	$(MAKE) blaslib cblaslib lapacklib tmglib lapackelib
+
+	# Build libblas.a
+	ar d librefblas.a xerbla.o # We want to use the xerbla.o from libcblas.a
+	mkdir -p tmp
+	cd tmp && ar x ../librefblas.a && ar x ../libcblas.a
+	ar r libblas.a tmp/*.o
+	rm -rf tmp
 
 	# Build the test programs, in order to avoid FTBFS if DEB_BUILD_OPTIONS contains nocheck
-	$(MAKE) OPTS="$(FFLAGS_TESTSUITE)" LAPACKLIB="liblapack.so" TMGLIB="libtmglib.so" -C TESTING xeigtstc xeigtstd xeigtsts xeigtstz xlintstc xlintstd xlintsts xlintstz xlintstds xlintstrfc xlintstrfd xlintstrfs xlintstrfz xlintstzc
+	$(MAKE) OPTS="$(FFLAGS_BLAS_TESTSUITE)" BLASLIB="../../libblas.so" -C BLAS/TESTING -f Makeblat1
+	$(MAKE) OPTS="$(FFLAGS_BLAS_TESTSUITE)" BLASLIB="../../libblas.so" -C BLAS/TESTING -f Makeblat2
+	$(MAKE) OPTS="$(FFLAGS_BLAS_TESTSUITE)" BLASLIB="../../libblas.so" -C BLAS/TESTING -f Makeblat3
+	$(MAKE) OPTS="$(FFLAGS_BLAS_TESTSUITE)" BLASLIB="../../libblas.so" CBLASLIB="" -C CBLAS/testing
+	$(MAKE) OPTS="$(FFLAGS_LAPACK_TESTSUITE)" BLASLIB="../../libblas.so" LAPACKLIB="liblapack.so" TMGLIB="libtmglib.so" -C TESTING xeigtstc xeigtstd xeigtsts xeigtstz xlintstc xlintstd xlintsts xlintstz xlintstds xlintstrfc xlintstrfd xlintstrfs xlintstrfz xlintstzc
 
 override_dh_auto_build-indep:
 	$(MAKE) html
@@ -118,17 +155,28 @@ override_dh_auto_build-indep:
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 override_dh_auto_test-arch:
-	LD_LIBRARY_PATH=$$(pwd):$$LD_LIBRARY_PATH \
-		$(MAKE) PICOPTS= OPTS="$(FFLAGS_TESTSUITE)" \
-		LLIB="-L $$(pwd) -llapack -lblas" lapack_testing
+	# Run BLAS tests, output the result, and stop if one test fails
+	LD_LIBRARY_PATH=$$(pwd):$$LD_LIBRARY_PATH $(MAKE) blas_testing
+	cat BLAS/*.out
+	! grep -q -i fail BLAS/*.out
+
+	# Run CBLAS tests, output the result, and stop if one test fails
+	LD_LIBRARY_PATH=$$(pwd):$$LD_LIBRARY_PATH $(MAKE) cblas_testing
+	cat CBLAS/testing/*.out
+	! grep -q -i fail CBLAS/testing/*.out
+
+	# Run LAPACK tests, but don't stop if one test fails
+	# Only a summary is displayed; full test results in TESTING/testing_results.txt
+	LD_LIBRARY_PATH=$$(pwd):$$LD_LIBRARY_PATH $(MAKE) lapack_testing
 else
 override_dh_auto_test-arch:
 	touch TESTING/testing_results.txt
 endif
 
 override_dh_makeshlibs:
-	dh_makeshlibs -a -pliblapack3 -V "liblapack3 | liblapack.so.3" -n
-	dh_makeshlibs -a -Nliblapack3
+	dh_makeshlibs -pliblapack3 -V "liblapack3 | liblapack.so.3" -n
+	dh_makeshlibs -plibblas3 -V "libblas3 | libblas.so.3" -n
+	dh_makeshlibs -a -Nliblapack3 -Nlibblas3
 
 override_dh_shlibdeps:
 	dh_shlibdeps -a -l $$(pwd)
diff --git a/debian/run_blas_tests.sh b/debian/run_blas_tests.sh
new file mode 100755
index 0000000..2c9e05c
--- /dev/null
+++ b/debian/run_blas_tests.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This scripts runs all BLAS tests against the BLAS implementation currently
+# selected through the alternatives system
+# (see "update-alternatives --display libblas.so.3").
+# The BLAS implentation can be overriden using LD_LIBRARY_PATH.
+
+# This script creates a few temporary files in the current directory.
+
+PATH=$PATH:/usr/lib/libblas
+
+DATADIR=/usr/lib/libblas
+
+# Test Fortran BLAS
+for p in s d c z
+do
+    xblat1${p}
+    xblat2${p} < $DATADIR/${p}blat2.in
+    cat ${p}blat2.out
+    xblat3${p} < $DATADIR/${p}blat3.in
+    cat ${p}blat3.out
+done
+
+# Test CBLAS
+for p in s d c z
+do
+    x${p}cblat1
+    x${p}cblat2 < $DATADIR/${p}in2
+    x${p}cblat3 < $DATADIR/${p}in3
+done
diff --git a/debian/shlibs.local b/debian/shlibs.local
index d832cac..850e7cd 100644
--- a/debian/shlibs.local
+++ b/debian/shlibs.local
@@ -1 +1,2 @@
+libblas 3 libblas3 | libblas.so.3
 liblapack 3 liblapack3 | liblapack.so.3

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/lapack.git



More information about the debian-science-commits mailing list