~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot, Sylvestre Ledru, Sébastien Villemot
  • Date: 2013-06-11 15:58:16 UTC
  • mfrom: (1.1.4) (25 sid)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20130611155816-8xeeiziu1iml040c
Tags: 3.10.1-1
[ Sylvestre Ledru ]
* New upstream release (Closes: #609287)

[ Sébastien Villemot ]
* Provide architectural defaults (i.e. precomputed timings) for all
  release archs (except armel and mips for the time being, due to slow
  porterboxes). This will make the package build much faster and should
  eliminate transient build failures due to excessive variance in the
  timings.
* Move symlinks for lib{cblas,f77blas,atlas,lapack_atlas} out of the
  libblas.so.3 alternative and make them always present, so that
  software relying on these libs do not break when another alternative
  is selected for BLAS
* ATLAS now has improved ARM support with native asm constructs. This required
  the following tunes:
  + armel-is-v4t.diff: new patch, prevents FTBFS on armel; otherwise,
    ATLAS uses asm constructs too recent for the platform (armel is only v4t)
  + debian/rules: on armhf, define the ATL_ARM_HARDFP flag; otherwise the asm
    constructs use the soft-float ABI for passing floating points
  + on armhf, ensure that -mfloat-abi=softfp and -mcpu=vfpv3 flags are never
    used; this is implemented via a patch (armhf.diff) and by the use of fixed
    archdefs
* The generic package is now built without multi-threading, because otherwise
  the package fails to build on some single-processor machines (this required
  the introduction of a patch: fix-non-threaded-build.diff). As a side effect,
  the build of the custom package gracefully handles non-threaded
  builds. (Closes: #602524)
* Add libblas.a as slave in the libblas.so alternative (Closes: #701921)
* Add symlinks for lib{f77blas,atlas}.a in /usr/lib (Closes: #666203)
* Modify shlibs file of libatlas3-base, such that packages using
  libblas/liblapack depend on any BLAS/LAPACK alternative, while packages
  depending on ATLAS-specific libraries (e.g. libatlas.so) depend specifically
  on libatlas3-base.
* corei1.diff: remove patch, applied upstream
* Use my @debian.org email address
* Remove obsolete DM-Upload-Allowed flag
* Switch VCS to git
* Remove Conflicts/Replaces against pre-squeeze packages
* libatlas-base-dev now provides libblas.so, as libblas-dev
* No longer use -Wa,--noexecstack in CFLAGS, it makes the package FTBFS
* Do not use POWER3 arch for powerpcspe port (Closes: #701068)
* Bump to debhelper compat level 9
* README.Debian: mention that devscripts is needed to compile the custom
  package (Closes: #697431)
* Bump Standards-Version to 3.9.4. As a consequence, add Built-Using
  fields because the package embeds stuff from liblapack-pic

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# Copyright 2008-2010 Sylvestre Ledru <sylvestre@debian.org>
3
3
 
4
4
include /usr/share/cdbs/1/rules/debhelper.mk
5
 
include /usr/share/cdbs/1/rules/simple-patchsys.mk
6
 
 
7
 
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
8
 
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
9
 
 
10
 
# Pointer bitwidth (default value)
11
 
MODE_BITWIDTH = 32
12
 
 
13
 
# 0 means Unknown CPU. Leave Atlas find out
14
 
# 1 means no extension
 
5
 
 
6
# NB: the following numbers come from xprint_enums (compilable from the build
 
7
# directory with "make xprint_enums); they can change across major releases
 
8
#
 
9
# First number in ARCHS:
 
10
# - 0 means Unknown CPU: leave ATLAS find out; used for archs where a more specific choice is not available
 
11
# - 8 means IBMz9: for s390 and s390x
 
12
# - 1 means POWER3: most generic PowerPC (#680096); cannot be used on powerpcspe (#701068)
 
13
# - 11 means artificial architecture called x86x87, providing you with portable (but slow!) architectural defaults: for *i386
 
14
#   See http://math-atlas.sourceforge.net/atlas_install/node28.html
 
15
# - 13 means generic libraries for P4 and later, with SSE2: for *amd64
 
16
#   See: http://math-atlas.sourceforge.net/atlas_install/node30.html
 
17
# - 36 means IA64Itan: for ia64
 
18
# - 38 means UltraSparc I (USI): for sparc
 
19
# - 46 means ARMv7: for armhf (but not for armel, which is ARM >= v4)
 
20
# Second number in ARCHS:
 
21
# - 1 means no instruction set extension
 
22
# - 384 means SSE1+SSE2 (always available on amd64)
 
23
ifneq (,$(findstring $(DEB_HOST_ARCH),s390 s390x))
 
24
ARCHS=base_8_1
 
25
else ifeq ($(DEB_HOST_ARCH_CPU),i386)
 
26
ARCHS=base_11_1
 
27
else ifeq ($(DEB_HOST_ARCH_CPU),amd64)
 
28
ARCHS=base_13_384
 
29
else ifeq ($(DEB_HOST_ARCH),ia64)
 
30
ARCHS=base_36_1
 
31
else ifeq ($(DEB_HOST_ARCH),sparc)
 
32
ARCHS=base_38_1
 
33
else ifeq ($(DEB_HOST_ARCH),armhf)
 
34
ARCHS=base_46_1
 
35
else ifneq (,$(findstring $(DEB_HOST_ARCH),powerpc ppc64))
 
36
ARCHS=base_1_1
 
37
else
15
38
ARCHS=base_0_1
 
39
endif
 
40
 
 
41
# Pointer bitwidth
 
42
MODE_BITWIDTH = $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
 
43
 
16
44
DEB_SHLIBDEPS_INCLUDE_libatlas3-base := $(CURDIR)/debian/libatlas3-base/usr/lib/atlas-base/:$(CURDIR)/debian/libatlas3-base/usr/lib/atlas-base/atlas/
17
45
 
18
 
# # see what do we do with the amd64 / intel 64
19
 
ifeq ($(DEB_HOST_ARCH_CPU),amd64)
20
 
# # 64 bits
21
 
MODE_BITWIDTH = 64
22
 
endif
23
 
 
24
 
ifeq ($(DEB_HOST_ARCH_CPU),ia64)
25
 
MODE_BITWIDTH = 64
26
 
endif
27
 
 
28
 
ifeq ($(DEB_HOST_ARCH_CPU),ppc64)
29
 
# Power PC 64
30
 
MODE_BITWIDTH = 64
31
 
endif
32
 
 
33
 
GFORTRAN_LIB_PATH=`gcc -print-search-dirs|grep ^install:|awk '{print $$2}'`
 
46
DEB_DH_GENCONTROL_ARGS_ALL := -- -VBuilt-Using="`dpkg-query -W -f='$${source:Package} (= $${source:Version})' liblapack-pic`"
 
47
 
 
48
GFORTRAN_LIB_PATH=`$(CC) -print-search-dirs|grep ^install:|awk '{print $$2}'`
34
49
 
35
50
COMMON_CONFIG_PARAMS := --prefix="$(DEB_DESTDIR)"       \
36
51
        --incdir="$(DEB_DESTDIR)/usr/include/"                  \
39
54
        --cflags="${CFLAGS}"                                                    \
40
55
        -D c -DWALL                                                                     \
41
56
        -b $(MODE_BITWIDTH)                                                     \
42
 
        -Fa alg '-Wa,--noexecstack -fPIC'                               \
 
57
        -Fa alg '-fPIC'                                 \
43
58
        -Ss f77lib "-L$(GFORTRAN_LIB_PATH) -lgfortran -lgcc_s -lpthread"  \
44
59
        -Ss pmake '$(MAKE)'                                     \
45
 
        --with-netlib-lapack=/usr/lib/liblapack_pic.a   \
 
60
        -Ss flapack /usr/lib/liblapack_pic.a    \
46
61
        -A $$atlasArch                                                                  \
47
62
        -V $$atlasISA                                                                   \
48
63
        -v 2
49
 
# ../../configure --cc="cc" --cflags="-g -O2" -D c -DWALL -b 64 -Fa alg '-Wa,--noexecstack -fPIC' -Ss flapack /usr/lib/liblapack_pic.a -Ss f77lib "-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/ -lgfortran -lgcc_s -lpthread" -Ss pmake '/usr/bin/make -j 1' -A 0 -V 1 -v 2 -Si cputhrchk 0 -t 2
 
64
 
 
65
# See http://math-atlas.sourceforge.net/errata.html#armhardfp
 
66
ifeq ($(DEB_HOST_ARCH),armhf)
 
67
COMMON_CONFIG_PARAMS += -D c -DATL_ARM_HARDFP=1
 
68
endif
 
69
 
 
70
# The archdefs provided by ATLAS are unsuitable for armhf (see details in
 
71
# armhf.diff patch)
 
72
#
 
73
# Hence we replace them by new ones without the problematic flags. They are
 
74
# located under debian/archdefs/arm, and used for the generic package.
 
75
#
 
76
# The following rules ensure that these new archdefs are also used for the
 
77
# custom package.
 
78
use-my-armhf-archdef:
 
79
                test -f CONFIG/ARCHS/ARMv732.tar.bz2.old || (mv CONFIG/ARCHS/ARMv732.tar.bz2 CONFIG/ARCHS/ARMv732.tar.bz2.old && cp debian/archdefs/arm/ARMv732.tar.bz2 CONFIG/ARCHS/ARMv732.tar.bz2)
 
80
                test -f CONFIG/ARCHS/ARMv732NEON.tar.bz2.old || (mv CONFIG/ARCHS/ARMv732NEON.tar.bz2 CONFIG/ARCHS/ARMv732NEON.tar.bz2.old && cp debian/archdefs/arm/ARMv732NEON.tar.bz2 CONFIG/ARCHS/ARMv732NEON.tar.bz2)
 
81
 
 
82
restore-armhf-archdef:
 
83
                (test -f CONFIG/ARCHS/ARMv732.tar.bz2.old && mv CONFIG/ARCHS/ARMv732.tar.bz2.old CONFIG/ARCHS/ARMv732.tar.bz2) || true
 
84
                (test -f CONFIG/ARCHS/ARMv732NEON.tar.bz2.old && mv CONFIG/ARCHS/ARMv732NEON.tar.bz2.old CONFIG/ARCHS/ARMv732NEON.tar.bz2) || true
 
85
 
 
86
# Build a custom package optimized for the current arch
50
87
custom: custom-stamp
51
 
 
52
 
# Build a custom package optimized for the current arch
53
 
custom-stamp:
 
88
.PHONY: custom
 
89
custom-stamp: use-my-armhf-archdef
54
90
                rm -f configure-stamp
55
91
 
56
92
                ncpu=$$(LANG=C cpufreq-info | grep "analyzing CPU" -c);\
82
118
                LANG=C debian/rules ARCHS=base__ binary
83
119
                touch $@
84
120
 
 
121
common-configure-arch common-configure-indep:: configure-stamp
85
122
configure-stamp:
86
123
                dh_testdir
87
124
 
91
128
                atlasISA=`echo $(ARCHS)|sed -e "s|.*_.*_\(.*\)|\1|g"`; \
92
129
                mkdir -p build/$$targetName;                                    \
93
130
                cd build/$$targetName;                                                  \
94
 
                ../../configure $(COMMON_CONFIG_PARAMS);                \
 
131
                if test "$(ARCHS)" != "base__"; then            \
 
132
                ../../configure $(COMMON_CONFIG_PARAMS) -t 0 -Ss ADdir ../../../debian/archdefs/$(DEB_HOST_ARCH_CPU);   \
 
133
                else                                            \
 
134
                ../../configure $(COMMON_CONFIG_PARAMS);        \
 
135
                fi;                                             \
95
136
                echo "Configure done. targetName = $$targetName / atlasArch = $$atlasArch / atlasISA = $$atlasISA";                                                             \
96
137
                if test ! -s Make.inc; then echo "Configure failed: Make.inc not found"; exit 1; fi;                                                                                    \
97
138
                cat Make.inc |grep ARCH|head -1|awk '{print $$3}'; \
99
140
                cd -
100
141
                touch $@
101
142
 
102
 
 
103
 
build: build-arch build-indep
104
 
 
105
 
build-indep: build-indep-stamp
106
 
build-indep-stamp: configure-stamp
107
 
                touch $@
108
 
 
109
 
build-arch: build-arch-stamp
110
 
build-arch-stamp: configure-stamp
 
143
common-build-arch common-build-indep:: build-stamp
 
144
build-stamp:
111
145
                dh_testdir
112
146
                set -e;                                                                                                 \
113
147
                targetName=`echo $(ARCHS)|sed -e "s|\(.*\)_.*_.*|atlas-\1|g"`; \
114
148
                cd build/$$targetName;                                                                  \
115
149
                $(MAKE) build;                                                                                  \
116
 
                cd lib;                                                                                                 \
117
 
                $(MAKE) shared;                                                                                 \
118
 
                $(MAKE) ptshared;                                                                               \
119
 
                cd ..;                                                                                                  \
120
150
                $(MAKE) check;                                                                                  \
121
 
                $(MAKE) ptcheck;                                                                                \
 
151
                test -f build/$$targetName/lib/libptcblas.a && $(MAKE) ptcheck;                                                                         \
122
152
                echo "==============================================";  \
123
153
                cd ../../../
124
154
                # Do not build the help when building the custom package
127
157
                fi
128
158
                touch $@
129
159
 
130
 
clean:: clean-work #unpatch
131
 
clean-work:
 
160
clean:: clean-work
 
161
clean-work: restore-armhf-archdef
132
162
                dh_testdir
133
163
                dh_testroot
134
164
                rm -rf build check 
135
 
                rm -f build-arch-stamp build-indep-stamp
136
 
                rm -f install-arch-stamp install-indep-stamp configure-stamp
137
 
 
 
165
                rm -f configure-stamp build-stamp
 
166
                rm -f TexDoc/*.pdf
138
167
                [ ! -f Makefile ] || $(MAKE) distclean
139
 
                # some additional cleanups
140
 
                dh_clean 
141
 
 
142
 
 
143
 
install: install-arch install-indep
144
 
 
145
 
install-indep: configure build install-indep-stamp
146
 
install-indep-stamp:
147
 
                dh_testdir
148
 
                dh_testroot
149
 
                dh_installdirs -i
150
 
 
151
 
install-arch: configure build  install-arch-stamp
152
 
install-arch-stamp:
 
168
.PHONY: clean-work
 
169
 
 
170
common-install-arch common-install-indep::
153
171
                dh_testdir
154
172
                dh_testroot
155
173
 
175
193
                cp -R $(CURDIR)/doc/* $(CURDIR)/TexDoc/*.pdf $(CURDIR)/debian/libatlas-doc/usr/share/doc/libatlas-doc/; \
176
194
        fi
177
195
 
178
 
binary: binary-indep binary-arch
179
 
 
180
 
binary-indep: build install
181
 
                dh_testdir -i
182
 
                dh_testroot -i
183
 
                dh_installchangelogs  -i
184
 
#               dh_installexamples -patlas-doc examples/*
185
 
                dh_installman -i
186
 
                dh_link -i
187
 
                dh_strip -i
188
 
                dh_compress  -i -X.pdf
189
 
                dh_fixperms -i
190
 
                dh_makeshlibs -i -n
191
 
                dh_installdeb -i
192
 
                dh_shlibdeps -i -l $$(pwd)
193
 
#               dh_shlibdeps -i
194
 
                dh_gencontrol -i
195
 
                dh_md5sums -i
196
 
                dh_builddeb -i
197
 
 
198
 
binary-arch: build install
199
 
                dh_testdir -a
200
 
                dh_testroot -a
201
 
                dh_installchangelogs  -a
202
 
                dh_installexamples -a
203
 
                dh_installman -a
204
 
                dh_link -a
205
 
                dh_compress  -a
206
 
                dh_fixperms -a
207
 
                dh_installdeb -a
208
 
 
209
 
.PHONY: build build-indep build-indep-stamp build-arch build-arch-stamp check clean binary binary-indep binary-arch configure-stamp configure custom custom-stamp
210
 
 
 
196
# We want packages using libblas/liblapack to depend on any BLAS/LAPACK
 
197
# alternative, and we want packages depending on ATLAS-specific libraries
 
198
# (e.g. libatlas.so) to depend specifically on libatlas3-base.
 
199
#
 
200
# Such a setting is not supported by dh_makeshlibs, so we ship a hand-crafted
 
201
# shlibs file.
 
202
binary-predeb/libatlas3-base::
 
203
        cp debian/libatlas3-base.shlibs debian/libatlas3-base/DEBIAN/shlibs
211
204
 
212
205
get-orig-source:
213
206
        -uscan --upstream-version 0