File: rules

package info (click to toggle)
openmpi 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 99,912 kB
  • ctags: 55,589
  • sloc: ansic: 525,999; f90: 18,307; makefile: 12,062; sh: 6,583; java: 6,278; asm: 3,515; cpp: 2,227; perl: 2,136; python: 1,350; lex: 734; fortran: 52; tcl: 12
file content (193 lines) | stat: -rwxr-xr-x 8,538 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
#!/usr/bin/make -f

export DH_VERBOSE=1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

DEBIAN_VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\-.*\)/\1/p' | sed -e 's/\+.*//; s/^[0-9]://')

DESTDIR:=`pwd`/debian/tmp/
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=usr/lib/$(DEB_HOST_MULTIARCH)
AUTOGENERATED:= libopenmpi2.links libopenmpi-dev.links libopenmpi-dev.postinst libopenmpi-dev.prerm

### Arch-specific stuff
# No ibverbs support available on kFreeBSD, Hurd
NO_VERBS_ARCH:= hurd-i386 kfreebsd-amd64 kfreebsd-i386 s390x
FABRIC_ARCH:= amd64 i386 
PSM_ARCH:= amd64 i386
NO_JAVA_ARCH:= hppa hurd-i386
NO_TEST_ARCH:= hppa hurd-i386

ifeq (sparc,$(DEB_HOST_GNU_CPU))
	CFLAGS += -mcpu=v9
endif

# Note the space, to stop 'amd64' matching 'kfreebsd-amd64'
ifneq (,$(findstring  " $(DEB_HOST_ARCH)",$(NO_VERBS_ARCH)))
	VERBS := --with-verbs
endif
ifneq (,$(findstring $(DEB_HOST_ARCH),$(FABRIC_ARCH)))
	FABRIC := --with-libfabric
endif
ifneq (,$(findstring $(DEB_HOST_ARCH),$(PSM_ARCH)))
	PSM:= --with-psm
endif
ifeq ($(filter $(NO_JAVA_ARCH),$(DEB_HOST_ARCH)),)
	JAVA := --with-jdk-dir=/usr/lib/jvm/default-java --enable-mpi-java
endif
ifneq (,$(findstring $(DEB_HOST_ARCH),$(NO_TEST_ARCH)))
	DO_TEST := false
	BTL_TESTS := 
else
	DO_TEST := true
	BTL_TESTS:= --enable-opal-btl-usnic-unit-tests
endif

# Flags for the static build: see bug #502232
#STATIC_CONFIG_PARAMS = --enable-static
STATIC_CONFIG_PARAMS =  


%:
	dh $@ --parallel #--with autotools_dev

override_dh_auto_clean:
	dh_clean
	find . -name .libs -exec rm -rf {} \; || true
	find . -name .dirstamp -delete
	find . -type l -delete
	find . -name '*.o' -delete
	rm -f $(patsubst %, debian/%, ${AUTOGENERATED})

override_dh_auto_configure:
	./autogen.pl --force
	for f in ${AUTOGENERATED} ; do \
                sed -e 's%@TRIPLET@%${DEB_HOST_MULTIARCH}%g' < debian/$$f.in  > debian/$$f ; \
                done
	dh_auto_configure -- \
		$(VERBS) $(FABRIC) $(PSM) \
		$(JAVA) \
		$(STATIC_CONFIG_PARAMS) \
		$(BTL_TESTS) \
		--disable-wrapper-rpath \
		--enable-mpi-thread-multiple \
		--disable-silent-rules \
		--enable-mpi-cxx \
		--with-hwloc=/usr/ \
		--with-libltdl=/usr/ \
		--with-devel-headers \
		--with-slurm \
		--with-sge \
		--without-tm \
		--enable-heterogeneous \
		--disable-vt \
		--sysconfdir=/etc/openmpi 		\
		--libdir=\$${prefix}/lib/${DEB_HOST_MULTIARCH}/openmpi/lib	\
		--includedir=\$${prefix}/lib/${DEB_HOST_MULTIARCH}/openmpi/include 

override_dh_install:
	# Strip rpath info from all executables and libraries.
	find debian/tmp/ -type f -perm -+x -a ! -name '*.la' -a ! -name '*.mod' -exec chrpath -d '{}' \;
# Rename the compiler and startup wrappers.
	for f in mpic++ mpicc mpiCC mpicxx mpiexec mpif77 mpif90 mpirun mpifort ; do \
		if test -f debian/tmp/usr/bin/$${f}; then \
			mv debian/tmp/usr/bin/$${f} debian/tmp/usr/bin/$${f}.openmpi ; \
		fi; \
	done
# Rename the compiler wrapper man pages.
	for f in mpic++ mpicc mpicxx mpiexec mpif77 mpif90 mpirun mpifort ; do \
		if test -f debian/tmp/usr/share/man/man1/$${f}.1; then \
			mv debian/tmp/usr/share/man/man1/$${f}.1 debian/tmp/usr/share/man/man1/$${f}.openmpi.1 ; \
		fi; \
		if test -f debian/tmp/usr/share/man/man1/$${f}.3; then \
			mv debian/tmp/usr/share/man/man3/$${f}.3 debian/tmp/usr/share/man/man1/$${f}.openmpi.3 ; \
		fi; \
	done
	cd debian/tmp/usr/share/man/man3; \
	for f in *.3; do \
		mv $$f $$(echo $$f|sed -e "s|\.3|.openmpi.3|g"); \
	done; \
# Rename orte-bootproxy.sh to orte-bootproxy
	if test -f debian/tmp/usr/bin/orte-bootproxy.sh; then \
		mv debian/tmp/usr/bin/orte-bootproxy.sh debian/tmp/usr/bin/orte-bootproxy; \
	fi
# Remove dangling symlink(s)
	rm -f debian/tmp/usr/share/man/man1/mpiCC.1
	rm -f debian/tmp/usr/share/man/man1/orteCC.1
# Remove COPYRIGHT file of ptmalloc2. It's reproduced in debian/copyright.
	rm -f -r debian/tmp/usr/share/openmpi/doc/
# Remove buggy ${pkgincludedir} refs from pkg-config files. #837062
	find . -name '*.pc' | while read f ; do \
		cat $${f} | sed -e 's%-I$${pkgincludedir}[a-zA-Z0-9/]* %%g' > x ; \
		 mv x $${f}; done
# Continue as usual
	dh_install
# oshmem, shmem only built on Linux so do by hand or it may fail ...
	mkdir -p debian/libopenmpi2/${LIBDIR}/openmpi/lib 
	if test -f debian/tmp/usr/bin/oshmem_info ; then \
		mkdir -p debian/openmpi-bin/usr/share/man/man1 ; \
		cp -a debian/tmp/usr/bin/oshrun  debian/openmpi-bin//usr/bin/ ; \
		cp -a debian/tmp/usr/bin/oshmem_info  debian/openmpi-bin//usr/bin/ ; \
		cp -a debian/tmp/usr/bin/oshcc	 debian/libopenmpi-dev/usr/bin   ; \
		cp -a debian/tmp/usr/bin/oshfort   debian/libopenmpi-dev/usr/bin   ; \
		cp -a debian/tmp/${LIBDIR}/openmpi/lib/liboshmem.so.20.0.2 debian/libopenmpi2/${LIBDIR}/openmpi/lib ; \
		cp -a debian/tmp/usr/share/man/man1/oshcc.1 debian/libopenmpi-dev/usr/share/man/man1 ; \
		cp -a debian/tmp/usr/share/man/man1/oshfort.1 debian/libopenmpi-dev/usr/share/man/man1 ; \
		cp -a debian/tmp/usr/share/man/man1/oshrun.1 debian/openmpi-bin/usr/share/man/man1 ; \
		cp -a debian/tmp/usr/share/man/man1/oshmem_info.1 debian/openmpi-bin/usr/share/man/man1 ; \
		dh_link -p libopenmpi-dev	${LIBDIR}/liboshmem.so.20  ${LIBDIR}/liboshmem.so ; \
		dh_link -p libopenmpi2 ${LIBDIR}/openmpi/lib/liboshmem.so.20.0.2  ${LIBDIR}/liboshmem.so.20 ; \
	fi
	if test -f debian/tmp/${LIBDIR}/openmpi/lib/libmpi_java.so.20.0.1 ; then \
		cp -a debian/tmp/${LIBDIR}/openmpi/lib/libmpi_java.so.20.0.1 \
			debian/libopenmpi2/${LIBDIR}/openmpi/lib/libmpi_java.so.20.0.1 ; \
		dh_link -p libopenmpi2 ${LIBDIR}/libmpi_java.so.20.0.1  ${LIBDIR}/libmpi_java.so.20 ; \
		dh_link -p libopenmpi2 ${LIBDIR}/openmpi/lib/libmpi_java.so.20.0.1 ${LIBDIR}/libmpi_java.so.20.0.1 ; \
		dh_link -p libopenpi-dev ${LIBDIR}/libmpi_java.so.20	${LIBDIR}/libmpi_java.so ; \
	fi
	if test -f debian/tmp/${LIBDIR}/openmpi/lib/libmca_common_ompio.so.20.0.0 ; then  \
		cp -a debian/tmp/${LIBDIR}/openmpi/lib/libmca_common_ompio.so.20.0.0 \
			debian/libopenmpi2/${LIBDIR}/openmpi/lib/libmca_common_ompio.so.20.0.0 ; \
		dh_link -p libopenmpi2   ${LIBDIR}/libmca_common_ompio.so.20.0.0  ${LIBDIR}/libmca_common_ompio.so.20 ; \
		dh_link -p libopenmpi2 ${LIBDIR}/openmpi/lib/libmca_common_ompio.so.20.0.0 ${LIBDIR}/libmca_common_ompio.so.20.0.0 ; \
		dh_link -p libopenpi-dev ${LIBDIR}/libmca_common_ompio.so.20	${LIBDIR}/libmca_common_ompio.so ; \
	fi
	if test -f debian/tmp/${LIBDIR}/openmpi/lib/libmca_common_verbs.so.20.0.0 ; then \
		cp -a debian/tmp/${LIBDIR}/openmpi/lib/libmca_common_verbs.so.20.0.0 \
			debian/libopenmpi2/${LIBDIR}/openmpi/lib/libmca_common_verbs.so.20.0.0 ; \
		dh_link -p libopenmpi2   ${LIBDIR}/libmca_common_verbs.so.20.0.0  ${LIBDIR}/libmca_common_verbs.so.20 ; \
		dh_link -p libopenmpi2 ${LIBDIR}/openmpi/lib/libmca_common_verbs.so.20.0.0 ${LIBDIR}/libmca_common_verbs.so.20.0.0 ; \
		dh_link -p libopenpi-dev ${LIBDIR}/libmca_common_verbs.so.20	${LIBDIR}/libmca_common_verbs.so ; \
	fi
	if test -f debian/tmp/${LIBDIR}/openmpi/lib/libmca_common_libfabric.so.20.0.0 ; then \
		cp -a debian/tmp/${LIBDIR}/openmpi/lib/libmca_common_libfabric.so.20.0.0 \
			debian/libopenmpi2/${LIBDIR}/openmpi/lib/libmca_common_libfabric.so.20.0.0 ; \
		dh_link -p libopenmpi2   ${LIBDIR}/libmca_common_libfabric.so.20.0.0  ${LIBDIR}/libmca_common_libfabric.so.20 ; \
		dh_link -p libopenmpi2 ${LIBDIR}/openmpi/lib/libmca_common_libfabric.so.20.0.0 ${LIBDIR}/libmca_common_libfabric.so.20.0.0 ; \
		dh_link -p libopenmpi-dev   ${LIBDIR}/libmca_common_libfabric.so.20.0.0  ${LIBDIR}/libmca_common_libfabric.so ; \
	fi
	if test -f debian/tmp/usr/bin/shmemrun ; then \
		cp -a debian/tmp/usr/bin/shmemrun debian/openmpi-bin/usr/bin/shmemrun ;\
		cp -a debian/tmp/usr/share/man/man1/shmemrun.1 debian/openmpi-bin/usr/share/man/man1 ; \
		cp -a debian/tmp/usr/bin/shmemcc debian/libopenmpi-dev/usr/bin/shmemcc ; \
		cp -a debian/tmp/usr/bin/shmemfort debian/libopenmpi-dev/usr/bin/shmemfort ; \
		cp -a debian/tmp/usr/share/man/man1/shmemcc.1 debian/libopenmpi-dev/usr/share/man/man1 ; \
		cp -a debian/tmp/usr/share/man/man1/shmemfort.1 debian/libopenmpi-dev/usr/share/man/man1 ; \
	fi

override_dh_install-arch:

override_dh_fixperms-arch:
	chmod 0644 debian/libopenmpi*/${LIBDIR}/openmpi/lib/*.mod
	dh_fixperms

override_dh_auto_test:
	$(DO_TEST) && dh_auto_test || echo "Tests disabled on ${NO_TEST_ARCH} systems for the moment"	

override_dh_installdocs:
	dh_installdocs --all AUTHORS NEWS README

override_dh_shlibdeps:
	dh_shlibdeps -l$(CURDIR)/debian/tmp/${LIBDIR}/openmpi/lib -- --ignore-missing-info