S�bastien Villemot <[email protected]> writes: > Le lundi 20 mars 2017 � 00:12 -0700, Dima Kogan a �crit: > >> I'm attaching a patch series that applies this idea here. The patches >> mostly work. There're at least two bugs here that need to be dealt >> with, and I can work on those. But in the meantime, let's decide that >> this is the approach we want to pursue. > > I agree with the general approach, and I have committed your patches on > a new git branch named "multiarch".
Cool! > I have also added two commits, for fixing a bug in your patches, and > for removing the libblas-common package which will be obsoleted by this > move. > >> 2. There's now a separate set of alternatives for each arch called >> something like blas-ARCH. Installing one of the new packages creates >> these new alternatives, but doesn't remove the old alternatives, >> which end up as a broken link. > > Indeed. If you have time, don't hesitate to provide a patch (or even > better, to commit it directly to the git branch). OK. I'll take a look at some point. >> Clearly, we'd also need to update the other packages that provide >> BLAS implementations, but let's do this one step at a time. > > Indeed, once we have agreed on an implementation for lapack, we need to > apply similar changes to openblas and atlas, and also add versioned > breaks between the various packages (to avoid coexistence of the old > and the new alternatives system). > > Then we will do a simultaneous upload of the 3 packages, first to > experimental. Great. I have two more patches (attached), that were needed for cross-building.
>From 468609426ab37e7c64170443e20b6baa77d1d51c Mon Sep 17 00:00:00 2001 From: Dima Kogan <[email protected]> Date: Sat, 6 May 2017 21:01:41 -0700 Subject: [PATCH 1/3] using arch-specific compilers, binutils --- debian/patches/series | 1 + debian/patches/using-arch-specific-compilers.patch | 39 ++++++++++++++++++++++ debian/rules | 6 ++-- 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 debian/patches/using-arch-specific-compilers.patch diff --git a/debian/patches/series b/debian/patches/series index e396170..3130da1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ icamax-izamax-extended-precision.patch doxygen-strip-source.patch fix-typos.patch test-numbering.patch +using-arch-specific-compilers.patch diff --git a/debian/patches/using-arch-specific-compilers.patch b/debian/patches/using-arch-specific-compilers.patch new file mode 100644 index 0000000..7ba01a8 --- /dev/null +++ b/debian/patches/using-arch-specific-compilers.patch @@ -0,0 +1,39 @@ +diff --git a/INSTALL/make.inc.gfortran b/INSTALL/make.inc.gfortran +index ccd0994..1c5bd62 100644 +--- a/INSTALL/make.inc.gfortran ++++ b/INSTALL/make.inc.gfortran +@@ -16,11 +16,11 @@ SHELL = /bin/sh + # and handle these quantities appropriately. As a consequence, one + # should not compile LAPACK with flags such as -ffpe-trap=overflow. + # +-FORTRAN = gfortran ++FORTRAN = $(DEB_HOST_GNU_TYPE)-gfortran + OPTS = -O2 -frecursive + DRVOPTS = $(OPTS) + NOOPT = -O0 -frecursive +-LOADER = gfortran ++LOADER = $(DEB_HOST_GNU_TYPE)-gfortran + LOADOPTS = + # + # Timer for the SECOND and DSECND routines +@@ -46,7 +46,7 @@ TIMER = INT_ETIME + # + # CC is the C compiler, normally invoked with options CFLAGS. + # +-CC = gcc ++CC = $(DEB_HOST_GNU_TYPE)-gcc + CFLAGS = -O3 + # + # LAPACKE has also the interface to some routines from tmglib, +@@ -56,9 +56,9 @@ CFLAGS = -O3 + # The archiver and the flag(s) to use when building archive (library) + # If you system has no ranlib, set RANLIB = echo. + # +-ARCH = ar ++ARCH = $(DEB_HOST_GNU_TYPE)-ar + ARCHFLAGS= cr +-RANLIB = ranlib ++RANLIB = $(DEB_HOST_GNU_TYPE)-ranlib + # + # Location of the extended-precision BLAS (XBLAS) Fortran library + # used for building and testing extended-precision routines. The diff --git a/debian/rules b/debian/rules index d917bbf..e4c0f6a 100755 --- a/debian/rules +++ b/debian/rules @@ -12,11 +12,11 @@ SO:=3 BUILDFLAGS_ENV:=DEB_LDFLAGS_MAINT_STRIP="-Wl,-Bsymbolic-functions" LDFLAGS:=$(shell $(BUILDFLAGS_ENV) dpkg-buildflags --get LDFLAGS) -F77:=gfortran +F77:=$(DEB_HOST_GNU_TYPE)-gfortran FFLAGS:=$(shell dpkg-buildflags --get FFLAGS) FFLAGS_NOOPT:=$(shell DEB_BUILD_OPTIONS=noopt dpkg-buildflags --get FFLAGS) -CC:=/usr/bin/cc +CC:=$(DEB_HOST_GNU_TYPE)-gcc CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) @@ -53,7 +53,7 @@ endif dh $@ make.inc: INSTALL/make.inc.gfortran - sed -e "s,\(^CC *=\).*,\1 /usr/bin/cc,1" \ + sed -e "s,\(^CC *=\).*,\1 $(DEB_HOST_GNU_TYPE)-gcc,1" \ -e "s,\(^NOOPT *=\).*,\1 \$$(PICOPTS) $(FFLAGS_NOOPT),1" \ -e "s,\(^OPTS *=\).*,\1 \$$(PICOPTS) $(FFLAGS),1" \ -e "s/\(^LOADOPTS *=\).*/\1 $(LDFLAGS)/1" \ -- 2.11.0
>From b49b70f7073c601d95238499ee6234094a5fa8c3 Mon Sep 17 00:00:00 2001 From: Dima Kogan <[email protected]> Date: Sat, 6 May 2017 21:27:53 -0700 Subject: [PATCH 2/3] not building or running tests if DEB_BUILD_OPTIONS=nocheck --- debian/patches/no_tests_if_nocheck.patch | 32 ++++++++++++++++++++++++++++++++ debian/patches/series | 3 +++ 2 files changed, 35 insertions(+) create mode 100644 debian/patches/no_tests_if_nocheck.patch diff --git a/debian/patches/no_tests_if_nocheck.patch b/debian/patches/no_tests_if_nocheck.patch new file mode 100644 index 0000000..fc84468 --- /dev/null +++ b/debian/patches/no_tests_if_nocheck.patch @@ -0,0 +1,32 @@ +diff --git a/Makefile b/Makefile +index 497fc3c..5eccbf7 100644 +--- a/Makefile ++++ b/Makefile +@@ -6,7 +6,16 @@ + + include make.inc + +-all: lapack_install lib blas_testing lapack_testing ++all: lapack_install lib ++ ++ifeq ($(filter $(DEB_BUILD_OPTIONS),nocheck),) ++all: blas_testing lapack_testing ++RUNTESTS := ./testlsame; ./testslamch; ./testdlamch; \ ++ ./testsecond; ./testdsecnd; ./testieee; ./testversion ++else ++RUNTESTS := true ++endif ++ + + lib: lapacklib tmglib + #lib: blaslib variants lapacklib tmglib +@@ -14,8 +23,7 @@ lib: lapacklib tmglib + clean: cleanlib cleantesting cleanblas_testing cleancblas_testing + + lapack_install: +- ( cd INSTALL; $(MAKE); ./testlsame; ./testslamch; ./testdlamch; \ +- ./testsecond; ./testdsecnd; ./testieee; ./testversion ) ++ ( cd INSTALL; $(MAKE) && $(RUNTESTS) ) + + blaslib: + ( cd BLAS/SRC; $(MAKE) ) diff --git a/debian/patches/series b/debian/patches/series index 3130da1..4c03a8e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,6 @@ doxygen-strip-source.patch fix-typos.patch test-numbering.patch using-arch-specific-compilers.patch +no_tests_if_nocheck.patch + + -- 2.11.0

