File: rules

package info (click to toggle)
armci-mpi 0.3.1~beta-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,868 kB
  • sloc: ansic: 13,028; sh: 243; makefile: 94; fortran: 44
file content (65 lines) | stat: -rwxr-xr-x 2,110 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
#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/mpi-default-dev/debian_defaults

export OMPI_MCA_plm_rsh_agent=/bin/false

ifeq (ia64, $(DEB_HOST_ARCH))
  DEB_BUILD_OPTIONS += nocheck
endif

empty :=
space := $(empty)$(empty)

# mpich tests time out on these arches
ARCH_SKIP_MPICH_TEST_LIST = ppc64 sparc64
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(ARCH_SKIP_MPICH_TEST_LIST)$(space)))
  TEST_MPI_FLAVORS=openmpi
else
  TEST_MPI_FLAVORS=mpich openmpi
endif

%:
	dh $@ --with autoreconf

override_dh_clean:
	dh_clean
	rm -rf $(CURDIR)/pristine-src $(CURDIR)/build-mpich $(CURDIR)/build-openmpi

override_dh_autoreconf:
	rm -rf $(CURDIR)/pristine-src $(CURDIR)/build-mpich $(CURDIR)/build-openmpi
	tmpdir=`mktemp -d`; \
	cp -ra $(CURDIR)/* $${tmpdir}; \
	mv $$tmpdir $(CURDIR)/pristine-src
	dh_autoreconf --as-needed --sourcedirectory=$(CURDIR)/pristine-src
	cp -ra pristine-src build-mpich
	cp -ra pristine-src build-openmpi

override_dh_auto_configure:
	for mpi_flavor in mpich openmpi; do \
	  MPICC=mpicc.$${mpi_flavor} dh_auto_configure --sourcedirectory=$(CURDIR)/build-$${mpi_flavor} -- MPI_FLAVOR=$${mpi_flavor}; \
	done

override_dh_auto_build:
	for mpi_flavor in mpich openmpi; do \
	  dh_auto_build --sourcedirectory=$(CURDIR)/build-$${mpi_flavor}; \
	done

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	set -e; \
	ncpu=`nproc`; if [ $${ncpu} -gt 1 ]; then ncpu=2; fi;\
	for mpi_flavor in $(TEST_MPI_FLAVORS); do \
	  $(MAKE) -C $(CURDIR)/build-$${mpi_flavor} -k check MPIEXEC="mpiexec.$${mpi_flavor} -np $${ncpu}" ARMCI_USE_WIN_ALLOCATE=1 || cat $(CURDIR)/build-$${mpi_flavor}/test-suite.log; \
	done
endif

override_dh_auto_install:
	for mpi_flavor in mpich openmpi; do \
	  dh_auto_install --sourcedirectory=$(CURDIR)/build-$${mpi_flavor}; \
	done

override_dh_link:
	dh_link -plibarmci-mpi-dev usr/lib/$(DEB_HOST_MULTIARCH)/libarmci-$(ARCH_DEFAULT_MPI_IMPL).a usr/lib/$(DEB_HOST_MULTIARCH)/libarmci.a
	dh_link -plibarmci-mpi-dev usr/lib/$(DEB_HOST_MULTIARCH)/libarmci-$(ARCH_DEFAULT_MPI_IMPL).la usr/lib/$(DEB_HOST_MULTIARCH)/libarmci.la