File: rules

package info (click to toggle)
trilinos 12.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 471,528 kB
  • ctags: 314,491
  • sloc: cpp: 2,747,334; ansic: 420,675; fortran: 158,691; xml: 30,440; python: 25,109; f90: 24,661; sh: 14,133; makefile: 5,739; perl: 4,248; csh: 3,791; lex: 1,060; lisp: 810; yacc: 456; awk: 364; sed: 3
file content (261 lines) | stat: -rwxr-xr-x 8,642 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
#!/usr/bin/make -f
# -*- makefile -*-

# dirnames deviate from package names...
LIB_PACKAGES = \
    amesos \
    amesos2 \
    anasazi \
    aztecoo \
    belos \
    epetra \
    epetraext \
    galeri \
    globipack \
    ifpack \
    ifpack2 \
    intrepid \
    isorropia \
    kokkos \
    komplex \
    ml \
    moertel \
    muelu \
    nox \
    optipack \
    pamgen \
    phalanx \
    pike \
    piro \
    pliris \
    rol \
    rtop \
    rythmos \
    sacado \
    shards \
    shylu \
    stokhos \
    stratimikos \
    teko \
    teuchos \
    thyra \
    tpetra \
    trilinoscouplings \
    triutils \
    xpetra \
    zoltan \
    zoltan2

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export OMPI_MCA_plm_rsh_agent=/bin/false
export OMPI_MCA_rmaps_base_oversubscribe=1

DEB_HOST_MULTIARCH?=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_GNU_TYPE?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DOC_TRUE=
DOC_FALSE=
ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
   DOC_TRUE=\#
else
   DOC_FALSE=\#
endif

%:
	dh $@

clean:
	rm -f *-stamp
	rm -rf debian/tmp_*
	rm -rf packages/*/doc/html
	rm -rf packages/*/browser/doc/html
	rm -rf packages/rtop/src/*/doc/html
	dh clean

override_dh_auto_build-arch:
	dh_auto_build -a --parallel

override_dh_auto_build-indep:
	dh_auto_build -i --parallel

override_dh_auto_configure: configure-stamp

configure-stamp:
	dh_auto_configure -- \
   -DCMAKE_C_COMPILER=mpicc \
   -DCMAKE_CXX_COMPILER=mpicxx \
   -DCMAKE_Fortran_COMPILER=mpif90 \
   -DBUILD_SHARED_LIBS:BOOL=ON \
   -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
   -DTrilinos_LIBRARY_NAME_PREFIX:STRING="trilinos_" \
   -DTrilinos_INSTALL_INCLUDE_DIR:PATH=include/trilinos/ \
   -DTrilinos_INSTALL_TriBITS:BOOL=OFF \
   -DTrilinos_USE_GNUINSTALLDIRS:BOOL=ON \
   -DTrilinos_ENABLE_DEVELOPMENT_MODE:BOOL=OFF \
   -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
   -DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=ON \
   -DTrilinos_ASSERT_MISSING_PACKAGES:BOOL=OFF \
   -DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON \
   -DTrilinos_ENABLE_CTrilinos:BOOL=OFF \
   -DTrilinos_ENABLE_FEI:BOOL=OFF \
   -DTrilinos_ENABLE_ForTrilinos:BOOL=OFF \
   -DTrilinos_ENABLE_Gtest:BOOL=OFF \
   -DTrilinos_ENABLE_Mesquite:BOOL=OFF \
   -DTrilinos_ENABLE_MOOCHO:BOOL=OFF \
   -DTrilinos_ENABLE_Optika:BOOL=OFF \
   -DTrilinos_ENABLE_Panzer:BOOL=OFF \
   -DTrilinos_ENABLE_PyTrilinos:BOOL=OFF \
   -DTrilinos_ENABLE_SEACAS:BOOL=OFF \
   -DTrilinos_ENABLE_Sundance:BOOL=OFF \
   -DTrilinos_ENABLE_STK:BOOL=OFF \
   -DTrilinos_ENABLE_STKClassic:BOOL=OFF \
   -DTrilinos_ENABLE_STKDoc_tests:BOOL=OFF \
   -DTrilinos_ENABLE_STKSearch:BOOL=OFF \
   -DTrilinos_ENABLE_STKUnit_tests:BOOL=OFF \
   -DTrilinos_ENABLE_ThreadPool:BOOL=OFF \
   -DTrilinos_ENABLE_EXAMPLES:BOOL=OFF \
   -DTrilinos_ENABLE_TESTS:BOOL=ON \
     -DAmesos2_ENABLE_TESTS:BOOL=OFF \
     -DAnasazi_ENABLE_TESTS:BOOL=OFF \
     -DBelos_ENABLE_TESTS:BOOL=OFF \
     -DDomi_ENABLE_TESTS:BOOL=OFF \
     -DEpetra_ENABLE_TESTS:BOOL=OFF \
     -DIfpack_ENABLE_TESTS:BOOL=OFF \
     -DIsorropia_ENABLE_TESTS:BOOL=OFF \
     -DMueLu_ENABLE_TESTS:BOOL=OFF \
     -DNOX_ENABLE_TESTS:BOOL=OFF \
     -DPiro_ENABLE_TESTS:BOOL=OFF \
     -DShyLU_ENABLE_TESTS:BOOL=OFF \
     -DShyLUCore_ENABLE_TESTS:BOOL=OFF \
     -DStratimikos_ENABLE_TESTS:BOOL=OFF \
     -DTeko_ENABLE_TESTS:BOOL=OFF \
     -DTeuchos_ENABLE_TESTS:BOOL=OFF \
     -DTeuchosComm_ENABLE_TESTS:BOOL=OFF \
     -DTeuchosCore_ENABLE_TESTS:BOOL=OFF \
     -DXpetra_ENABLE_TESTS:BOOL=OFF \
     -DZoltan_ENABLE_TESTS:BOOL=OFF \
     -DZoltan2_ENABLE_TESTS:BOOL=OFF \
   -DTPL_ENABLE_BinUtils:BOOL=OFF \
   -DTPL_ENABLE_Boost:BOOL=ON \
   -DTPL_ENABLE_HDF5:BOOL=ON \
     -DHDF5_INCLUDE_DIRS:PATH=/usr/include/hdf5/openmpi/ \
     -DHDF5_LIBRARY_DIRS:PATH=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/openmpi/ \
   -DTPL_ENABLE_Matio:BOOL=OFF \
   -DTPL_ENABLE_MATLAB:BOOL=OFF \
   -DTPL_ENABLE_MPI:BOOL=ON \
   -DTPL_ENABLE_MUMPS:BOOL=ON \
   -DTPL_ENABLE_Netcdf:BOOL=OFF \
   -DTPL_ENABLE_ParMETIS:BOOL=OFF \
   -DTPL_ENABLE_Scotch:BOOL=OFF \
   -DTPL_ENABLE_SuperLU:BOOL=OFF \
   -DTPL_ENABLE_TBB:BOOL=ON \
   -DTPL_ENABLE_X11:BOOL=OFF \
   -DTPL_ENABLE_Zlib:BOOL=ON
	touch $@

BUILDDIR=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)

doc_build-stamp: $(DOC_TRUE)$(LIB_PACKAGES:%=%_doc-stamp)
	touch $@

# ignoring return code. some parts just fail!
$(LIB_PACKAGES:%=%_doc-stamp): %_doc-stamp:
	-cd packages/$*/doc && ./build_docs
	touch $@

override_dh_auto_install-indep: auto_install-indep-stamp
override_dh_auto_install-arch: auto_install-arch-stamp

auto_install-indep-stamp: doc_build-stamp
	mkdir -p $(CURDIR)/debian/tmp_trilinos-doc/usr/share/doc/trilinos;
	for i in $(LIB_PACKAGES); do \
	  echo "cp -r packages/$$i/doc/html/ $(CURDIR)/debian/tmp_trilinos-doc/usr/share/doc/trilinos/$$i"; \
	  cp -r packages/$$i/doc/html/ $(CURDIR)/debian/tmp_trilinos-doc/usr/share/doc/trilinos/$$i || :; \
	done
	touch $@

auto_install-arch-stamp:
	for i in $(LIB_PACKAGES); do \
     if [ -d $(BUILDDIR)/packages/$$i ]; then \
	    $(MAKE) -C $(BUILDDIR)/packages/$$i install DESTDIR=$(CURDIR)/debian/tmp_$$i || exit 1; \
	  else \
	    echo "WARNING: $@, no $$i has been built" >&2; \
       sleep 3; \
	  fi; \
	done
	$(MAKE) -C $(BUILDDIR) install/local DESTDIR=$(CURDIR)/debian/tmp_trilinos-dev
	touch $@

V = $(shell grep -Po 'Trilinos_MAJOR_VERSION \K[\d\.]*' Version.cmake)
MV = $(shell grep -Po 'Trilinos_MAJOR_MINOR_VERSION \K[\d\.]*' Version.cmake)

SOVERSION=$(V)

debian/Trilinos_version.h: debian/Trilinos_version.h.in auto_install-arch-stamp
	test -f $(TV)
	sed -e 's/%V/$(V)/' \
	    -e 's/%MV/$(MV)/' $< > $@

LO_DIR = /usr/share/lintian/overrides

override_dh_install-indep: install-indep-stamp
install-indep-stamp: auto_install-indep-stamp
	@for i in $(LIB_PACKAGES); do \
	  echo "dh_install --sourcedir=debian/tmp_trilinos-doc -ptrilinos-doc --autodest usr/share/ || exit 1;" \
	  dh_install --sourcedir=debian/tmp_trilinos-doc -ptrilinos-doc --autodest usr/share/ || exit 1; \
	done
	dh_install --sourcedir=debian/tmp_trilinos-doc -ptrilinos-doc --autodest usr/share/doc
	if [ ! -d debian/trilinos-doc ]; then \
		echo it should really be there...; \
	fi
	find debian/trilinos-doc -type f -name *.html -print0 | xargs -0 \
		sed -i -e 's_http\(s\|\)://cdn.mathjax.org/mathjax/latest_/usr/share/javascript/mathjax_g' \
		       -e 's#jquery\.js#/usr/share/javascript/jquery/jquery.js#'; \
	find debian/trilinos-doc/usr/share -name jquery.js -delete; \
	touch $@

override_dh_install-arch: install-arch-stamp
install-arch-stamp: SHELL=/bin/bash
install-arch-stamp: auto_install-arch-stamp debian/Trilinos_version.h
	@for i in $(LIB_PACKAGES); do \
     if [ -d $(BUILDDIR)/packages/$$i ]; then \
	    echo "dh_install --sourcedir=debian/tmp_$$i -plibtrilinos-$${i/2/2-}"$(SOVERSION)" usr/lib/*/*.so.*"; \
	    dh_install --sourcedir=debian/tmp_$$i -plibtrilinos-$${i/2/2-}"$(SOVERSION)" usr/lib/*/*.so.* || exit 1; \
	    echo "dh_install --sourcedir=debian/tmp_$$i -plibtrilinos-$$i-dev --autodest usr/include usr/lib/*/*.so usr/lib/*/cmake"; \
	    dh_install --sourcedir=debian/tmp_$$i -plibtrilinos-$$i-dev --autodest usr/include usr/lib/*/*.so usr/lib/*/cmake || exit 1; \
	    if grep -q "^libtrilinos-$$i\>" debian/lintian-override.in; then \
	      install -d debian/libtrilinos-$${i/2/2-}$(SOVERSION)$(LO_DIR); \
	      echo creating $(LO_DIR)/libtrilinos-$${i/2/2-}$(SOVERSION); \
	      grep "^libtrilinos-$${i/2/2-}%V\>" debian/lintian-override.in |\
	        sed -e 's/%V/$(SOVERSION)/g' >\
	        debian/libtrilinos-$${i/2/2-}$(SOVERSION)$(LO_DIR)/libtrilinos-$${i/2/2-}$(SOVERSION); \
	    fi \
	  else \
	    echo "WARNING: $@, no $$i has been built" >&2; \
	  fi; \
	done
	# just check. should not find anything.
	-find debian/lib*-dev -name Trilinos_version.h -print -printf 'BUG, leftover %p'
	for i in `grep -l Trilinos_version\.h debian/lib*-dev/usr/include/trilinos/*ersion*`; do \
		echo fixing header $$i; \
		sed -e '/Trilinos_version/,$$d' $$i > debian/htmp; \
		cat debian/Trilinos_version.h >> debian/htmp; \
		sed -e '1,/Trilinos_version/d' $$i >> debian/htmp; \
		mv debian/htmp $$i; \
	done
	dh_install --sourcedir=debian/tmp_trilinos-dev -ptrilinos-dev --autodest usr/include usr/lib/*/cmake -V foo=bar
	touch $@

override_dh_prep:
	dh_prep
	echo mydevpackages=$(LIB_PACKAGES:%=libtrilinos-%-dev,) > debian/trilinos-all-dev.substvars

override_dh_strip:
	dh_strip --dbgsym-migration='trilinos-dbg (<< 12.6.3-2~)'

.PHONY: override_dh_auto_configure override_dh_auto_install \
	override_dh_install-arch \
	override_dh_install-indep