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 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488
|
#! /usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
# Handmodified by P. Frauenfelder for debhelper support, 5 Sept 1998
topdir=$(shell pwd)
# Read the MPI implementation provided by mpi-default-dev.
include /usr/share/mpi-default-dev/debian_defaults
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
# This list of archs is maintained separately from that of the mpi-defaults
# package. If there is a mismatch between the two, the package will FTBFS. This
# is on purpose, to avoid silent breakage. See #740620 for more details.
OPENMPI_ARCHS=alpha amd64 arm64 armel armhf hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc ppc64 ppc64el sparc s390x x32 sparc64 hppa
MPICH_ARCHS=m68k sh4
# This list is to avoid the problem caused by Caught signal ‘Terminated’:
# terminating immediately in some build machines.
NO_TESTING = mips64el mipsel powerpc ppc64 sparc64 i386 alpha sh4
NO_TESTING_ARCH = $(shell dpkg-architecture -q DEB_BUILD_ARCH)
$(info NO_TESTING_ARCH is $(NO_TESTING_ARCH))
build-arch: build
build-indep: build
build: build-$(ARCH_DEFAULT_MPI_IMPL)
build-openmpi: build-stamp-openmpi check-stamp-openmpi
build-lam: build-stamp-lam check-stamp-lam
build-mpich: build-stamp-mpich check-stamp-mpich
build-mpich2: build-stamp-mpich2 check-stamp-mpich2
patch-stamp:
patch -p1 < debian/blacs-mpi-implementations.patch
touch $@
unpatch: patch-stamp
patch -p1 -R < debian/blacs-mpi-implementations.patch
rm -f patch-stamp
build-stamp-openmpi: patch-stamp
dh_testdir
[ -d TESTING/EXE ] || mkdir TESTING/EXE
# build the static libraries
BASEDIR=$(topdir) MPI=openmpi make mpi
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='$$(BLACSFINIT) $$(BLACSLIB) $$(BLACSFINIT) $$(MPILIB)' \
BUILD=static MPI=openmpi make
# next is a clean
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
# build the shared libraries
BASEDIR=$(topdir) FPIC=-fPIC MPI=openmpi make mpi
mkdir -p tmp
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cd tmp ;\
ar x ../LIB/$${i}_MPI-LINUX-0.a ;\
mkdir -p tmp ;\
for j in $$(find -name "*.C") ;\
do mv $$j tmp/$$(echo $$j | sed 's,C$$,o,g') ;\
done;\
cd .. ;\
gcc -shared -Wl,-soname=lib$$i-openmpi.so.1 -o lib$$i-openmpi.so.1.1 \
$$(find tmp -name "*.o") $$(pkg-config mpi-fort --libs); \
ln -fs lib$$i-openmpi.so.1.1 lib$$i-openmpi.so.1 ;\
ln -fs lib$$i-openmpi.so.1 lib$$i-openmpi.so ;\
rm -f tmp/tmp/* ; rmdir tmp/tmp ; rm tmp/* ;\
done
rmdir tmp
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='-L.. -lblacsF77init-openmpi -lblacs-openmpi -lblacsF77init-openmpi $$(MPILIB)' \
BUILD=shared MPI=openmpi make
touch build-stamp-openmpi
build-stamp-lam: patch-stamp
dh_testdir
[ -d TESTING/EXE ] || mkdir TESTING/EXE
# next is a clean
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
# build the static libraries
BASEDIR=$(topdir) MPI=lam make mpi
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='$$(BLACSFINIT) $$(BLACSLIB) $$(BLACSFINIT) $$(MPILIB)' \
BUILD=static MPI=lam make
# next is a clean
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
# build the shared libraries
BASEDIR=$(topdir) FPIC=-fPIC MPI=lam make mpi
mkdir -p tmp
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cd tmp ;\
ar x ../LIB/$${i}_MPI-LINUX-0.a ;\
mkdir -p tmp ;\
for j in $$(find -name "*.C") ;\
do mv $$j tmp/$$(echo $$j | sed 's,C$$,o,g') ;\
done;\
cd .. ;\
gcc -shared -Wl,-soname=lib$$i-lam.so.1 -o lib$$i-lam.so.1.1 \
$$(find tmp -name "*.o") -lmpi;\
ln -fs lib$$i-lam.so.1.1 lib$$i-lam.so.1 ;\
ln -fs lib$$i-lam.so.1 lib$$i-lam.so ;\
rm -f tmp/tmp/* ; rmdir tmp/tmp ; rm tmp/* ;\
done
rmdir tmp
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='-L.. -lblacsF77init-lam -lblacs-lam -lblacsF77init-lam $$(MPILIB)' \
BUILD=shared MPI=lam make
touch build-stamp-lam
build-stamp-mpich: patch-stamp
dh_testdir
[ -d TESTING/EXE ] || mkdir TESTING/EXE
# next is a clean
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
# build the static libraries
BASEDIR=$(topdir) MPI=mpich make mpi
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='$$(BLACSFINIT) $$(BLACSLIB) $$(BLACSFINIT) $$(MPILIB)' \
BUILD=static MPI=mpich make
# next is a clean
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
# build the shared libraries
BASEDIR=$(topdir) FPIC=-fPIC MPI=mpich make mpi
mkdir -p tmp
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cd tmp ;\
ar x ../LIB/$${i}_MPI-LINUX-0.a ;\
mkdir -p tmp ;\
for j in $$(find -name "*.C") ;\
do mv $$j tmp/$$(echo $$j | sed 's,C$$,o,g') ;\
done;\
cd .. ;\
gcc -shared -Wl,-soname=lib$$i-mpich.so.1 -o lib$$i-mpich.so.1.1 \
$$(find tmp -name "*.o") -lmpich -lmpichfort;\
ln -fs lib$$i-mpich.so.1.1 lib$$i-mpich.so.1 ;\
ln -fs lib$$i-mpich.so.1 lib$$i-mpich.so ;\
rm -f tmp/tmp/* ; rmdir tmp/tmp ; rm tmp/* ;\
done
rmdir tmp
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='-L.. -lblacsF77init-mpich -lblacs-mpich -lblacsF77init-mpich $$(MPILIB)' \
BUILD=shared MPI=mpich make
touch build-stamp-mpich
build-stamp-mpich2: patch-stamp
dh_testdir
[ -d TESTING/EXE ] || mkdir TESTING/EXE
# next is a clean
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
# build the static libraries
BASEDIR=$(topdir) MPI=mpich2 make mpi
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='$$(BLACSFINIT) $$(BLACSLIB) $$(BLACSFINIT) $$(MPILIB)' \
BUILD=static MPI=mpich2 make
# next is a clean
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
# build the shared libraries
BASEDIR=$(topdir) FPIC=-fPIC MPI=mpich2 make mpi
mkdir -p tmp
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cd tmp ;\
ar x ../LIB/$${i}_MPI-LINUX-0.a ;\
mkdir -p tmp ;\
for j in $$(find -name "*.C") ;\
do mv $$j tmp/$$(echo $$j | sed 's,C$$,o,g') ;\
done;\
cd .. ;\
gcc -shared -Wl,-soname=lib$$i-mpich2.so.1 -lmpich -o lib$$i-mpich2.so.1.1 \
$$(find tmp -name "*.o");\
ln -fs lib$$i-mpich2.so.1.1 lib$$i-mpich2.so.1 ;\
ln -fs lib$$i-mpich2.so.1 lib$$i-mpich2.so ;\
rm -f tmp/tmp/* ; rmdir tmp/tmp ; rm tmp/* ;\
done
rmdir tmp
# the testing binaries
cd TESTING && BASEDIR=$(topdir) \
BTLIBS='-L.. -lblacsF77init-mpich2 -lblacs-mpich2 -lblacsF77init-mpich2 $$(MPILIB)' \
BUILD=shared MPI=mpich2 make
touch build-stamp-mpich2
check-stamp-openmpi:
ifneq ($(filter $(NO_TESTING_ARCH),$(NO_TESTING)),)
touch check-stamp-openmpi
else
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_testdir
if [ -x /usr/bin/mpiexec.openmpi ]; then \
(cd TESTING/EXE; for i in *-openmpi; do \
echo "Running test $$i"; \
LD_LIBRARY_PATH=../../ mpiexec.openmpi -np 4 ./$$i > $$i.log 2>&1 ; \
grep FAILED $$i.log | sed s/DOUBLE// | \
awk '{total += $$4; passed += $$6; skipped += $$8; failed += $$10} END \
{print "total: " total " passed: " passed " skipped: " skipped " failed: " failed ; \
if (failed > 0) {exit 1}}' ; \
done) \
fi
endif
touch check-stamp-openmpi
endif
check-stamp-lam:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_testdir
if [ -x /usr/bin/mpiexec.lam ]; then \
(cd TESTING/EXE; for i in *-lam; do \
echo "Running test $$i"; \
LD_LIBRARY_PATH=../../ mpiexec.lam -np 4 ./$$i > $$i.log 2>&1 ; \
grep FAILED $$i.log | sed s/DOUBLE// | \
awk '{total += $$4; passed += $$6; skipped += $$8; failed += $$10} END \
{print "total: " total " passed: " passed " skipped: " skipped " failed: " failed ; \
if (failed > 0) {exit 1}}' ; \
done) \
fi
endif
touch check-stamp-lam
check-stamp-mpich:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_testdir
if [ -x /usr/bin/mpiexec.mpich ]; then \
(cd TESTING/EXE; for i in *-mpich; do \
echo "Running test $$i"; \
LD_LIBRARY_PATH=../../ mpiexec.mpich -np 4 ./$$i > $$i.log 2>&1 ; \
grep FAILED $$i.log | sed s/DOUBLE// | \
awk '{total += $$4; passed += $$6; skipped += $$8; failed += $$10} END \
{print "total: " total " passed: " passed " skipped: " skipped " failed: " failed ; \
if (failed > 0) {exit 1}}' ; \
done) \
fi
endif
touch check-stamp-mpich
check-stamp-mpich2:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_testdir
if [ -x /usr/bin/mpiexec.mpich2 ]; then \
(cd TESTING/EXE; for i in *-mpich2; do \
echo "Running test $$i"; \
LD_LIBRARY_PATH=../../ mpiexec.mpich2 -np 4 ./$$i > $$i.log 2>&1 ; \
grep FAILED $$i.log | sed s/DOUBLE// | \
awk '{total += $$4; passed += $$6; skipped += $$8; failed += $$10} END \
{print "total: " total " passed: " passed " skipped: " skipped " failed: " failed ; \
if (failed > 0) {exit 1}}' ; \
done) \
fi
endif
touch check-stamp-mpich2
clean: unpatch
dh_testdir
dh_testroot
rm -f build-stamp-* install-stamp-*
BASEDIR=$(topdir) make cleanall
cd TESTING && BASEDIR=$(topdir) make clean
cd LIB && rm -f *.a
rm -f *so*
rm -rf TESTING/EXE
dh_clean
{ \
echo "# This file is autogenerated. DO NOT EDIT!" ; \
echo "#" ; \
echo "# Modifications should be made to debian/control.in instead." ; \
echo "# This file is regenerated automatically in the clean target." ; \
echo ; \
sed "s/@OPENMPI_ARCHS@/$(OPENMPI_ARCHS)/g;s/@MPICH_ARCHS@/$(MPICH_ARCHS)/g;" debian/control.in ; } \
> debian/control
install: install-$(ARCH_DEFAULT_MPI_IMPL)
install-openmpi: install-stamp-openmpi
install-lam: install-stamp-lam
install-mpich: install-stamp-mpich
install-mpich2: install-stamp-mpich2
install-stamp-openmpi: build-stamp-openmpi
dh_testdir
dh_testroot
dh_prep
dh_installdirs -v -a
# The shared library are installed via debian/*.install, to avoid
# creating an empty package if default MPI implementation changes on
# the arch
dh_install
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cp -a lib$$i-openmpi.so \
`pwd`/debian/libblacs-mpi-dev/usr/lib/ ;\
done
set -e ;\
for i in shared static ; do \
install TESTING/EXE/xCbtest_MPI-LINUX-0-$$i-openmpi \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/cblacs_test_$$i-openmpi ;\
install TESTING/EXE/xFbtest_MPI-LINUX-0-$$i-openmpi \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/fblacs_test_$$i-openmpi ;\
done
set -e ;\
install LIB/blacsCinit_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsCinit-openmpi.a
install LIB/blacsF77init_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsF77init-openmpi.a
install LIB/blacs_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacs-openmpi.a
touch install-stamp-openmpi
install-stamp-lam: build-stamp-lam
dh_testdir
dh_testroot
dh_prep
dh_installdirs -v -a
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cp -a lib$$i-lam.so.* \
`pwd`/debian/libblacs-mpi1/usr/lib/ ;\
cp -a lib$$i-lam.so \
`pwd`/debian/libblacs-mpi-dev/usr/lib/ ;\
done
set -e ;\
for i in shared static ; do \
install TESTING/EXE/xCbtest_MPI-LINUX-0-$$i-lam \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/cblacs_test_$$i-lam ;\
install TESTING/EXE/xFbtest_MPI-LINUX-0-$$i-lam \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/fblacs_test_$$i-lam ;\
done
set -e ;\
install LIB/blacsCinit_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsCinit-lam.a
install LIB/blacsF77init_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsF77init-lam.a
install LIB/blacs_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacs-lam.a
touch install-stamp-lam
install-stamp-mpich: build-stamp-mpich
dh_testdir
dh_testroot
dh_prep
dh_installdirs -v -a
# The shared library are installed via debian/*.install, to avoid
# creating an empty package if default MPI implementation changes on
# the arch
dh_install
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cp -a lib$$i-mpich.so \
`pwd`/debian/libblacs-mpi-dev/usr/lib/ ;\
done
set -e ;\
for i in shared static ; do \
install TESTING/EXE/xCbtest_MPI-LINUX-0-$$i-mpich \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/cblacs_test_$$i-mpich ;\
install TESTING/EXE/xFbtest_MPI-LINUX-0-$$i-mpich \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/fblacs_test_$$i-mpich ;\
done
set -e ;\
install LIB/blacsCinit_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsCinit-mpich.a
install LIB/blacsF77init_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsF77init-mpich.a
install LIB/blacs_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacs-mpich.a
touch install-stamp-mpich
install-stamp-mpich2: build-stamp-mpich2
dh_testdir
dh_testroot
dh_prep
dh_installdirs -v -a
set -e ;\
for i in blacs blacsF77init blacsCinit ; do \
cp -a lib$$i-mpich2.so.* \
`pwd`/debian/libblacs-mpi1/usr/lib/ ;\
cp -a lib$$i-mpich2.so \
`pwd`/debian/libblacs-mpi-dev/usr/lib/ ;\
done
set -e ;\
for i in shared static ; do \
install TESTING/EXE/xCbtest_MPI-LINUX-0-$$i-mpich2 \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/cblacs_test_$$i-mpich2 ;\
install TESTING/EXE/xFbtest_MPI-LINUX-0-$$i-mpich2 \
`pwd`/debian/blacs-mpi-test/usr/lib/blacs/fblacs_test_$$i-mpich2 ;\
done
set -e ;\
install LIB/blacsCinit_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsCinit-mpich2.a
install LIB/blacsF77init_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacsF77init-mpich2.a
install LIB/blacs_MPI-LINUX-0.a \
`pwd`/debian/libblacs-mpi-dev/usr/lib/libblacs-mpich2.a
touch install-stamp-mpich2
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installdocs -a README
dh_installexamples -a
dh_installman -a
dh_installchangelogs -a
dh_link -a
dh_compress -a
dh_fixperms -a
dh_strip -a
dh_makeshlibs -a
dh_installdeb -a
dh_shlibdeps -Lblacs-mpi-test -ldebian/blacs-mpi-test/usr/lib/blacs/ -Llibblacs-mpi-dev -ldebian/libblacs-mpi-dev/usr/lib/ \
LD_LIBRARY_PATH="/usr/lib/openmpi/lib$${LD_LIBRARY_PATH:+:}$$LD_LIBRARY_PATH" -Llibblacs-mpi1 -l/usr/lib/openmpi/lib/
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary-indep:
dh_testdir -i
dh_testroot -i
dh_installdirs -i
dh_installdocs -i README
dh_installchangelogs -i
cd TESTING && BASEDIR=$(topdir) make dat
set -e ;\
for i in $$(find TESTING/EXE -name "*.dat"); do \
install -m 644 $$i `pwd`/debian/blacs-test-common/usr/lib/blacs ;\
done
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean build build-arch build-indep
|