| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export DH_VERBOSE=1 |
| 4 |
|
| 5 |
include /usr/share/dpkg/architecture.mk |
| 6 |
|
| 7 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 8 |
|
| 9 |
# Drop flags on old gfortran < 10 |
| 10 |
GF_FLAGS:= $(if $(filter $(shell readlink /usr/bin/gfortran), gfortran-9),, -fallow-invalid-boz -fallow-argument-mismatch) |
| 11 |
|
| 12 |
export MPICHLIB_CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) |
| 13 |
export MPICHLIB_CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) |
| 14 |
export MPICHLIB_CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) |
| 15 |
export MPICHLIB_FFLAGS:=$(shell dpkg-buildflags --get FFLAGS) $(GF_FLAGS) |
| 16 |
export MPICHLIB_FCFLAGS:=$(shell dpkg-buildflags --get FFLAGS) -cpp $(GF_FLAGS) |
| 17 |
export FFLAGS:=$(shell dpkg-buildflags --get FFLAGS | sed -e 's/-g //') $(GF_FLAGS) |
| 18 |
export F77=f77 |
| 19 |
export TZ=UTC+0 |
| 20 |
export V=1 |
| 21 |
|
| 22 |
# FC:=$(shell basename $(shell readlink /etc/alternatives/f95)) |
| 23 |
# export FC |
| 24 |
|
| 25 |
export HIPCXX=clang++-21 |
| 26 |
|
| 27 |
|
| 28 |
# Keep old library naming scheme |
| 29 |
export MPILIBNAME=mpich |
| 30 |
|
| 31 |
NO_ROMIO_ARCH:= hurd-amd64 hurd-i386 |
| 32 |
NO_VERBS_ARCH:= hurd-amd64 hurd-i386 |
| 33 |
NO_SLURM_ARCH:= hurd-amd64 hurd-i386 |
| 34 |
NO_FABRIC_ARCH:= hurd-amd64 hurd-i386 powerpc sh4 |
| 35 |
NO_REAL128_ARCH:= armel armhf mipsel hppa m68k sh4 |
| 36 |
# Pick one as default, unlisted ones get CH3 |
| 37 |
CH4_UCX_ARCH:= $(shell sed -n -r '/^Build/,/^$$/s/.*libucx-dev *\[([^]]*)\].*/\1/p' debian/control) |
| 38 |
CH4_OFI_ARCH:= alpha ppc64 sparc64 |
| 39 |
UCC_ARCH:= $(shell sed -n -r '/^Build/,/^$$/s/.*libucc-dev *\[([^]]*)\].*/\1/p' debian/control) |
| 40 |
HIP_ARCH:= $(shell sed -n -r '/^Build/,/^$$/s/.*libamdhip64-dev *\[([^]]*)\].*/\1/p' debian/control) |
| 41 |
PMIX_ARCH:= $(shell sed -n -r '/^Build/,/^$$/s/.*libpmix-dev *\[([^]]*)\].*/\1/p' debian/control) |
| 42 |
|
| 43 |
ifeq (,$(filter $(DEB_HOST_ARCH),$(NO_VERBS_ARCH))) |
| 44 |
VERBS := --with-ibverbs |
| 45 |
endif |
| 46 |
ifeq (,$(filter $(DEB_HOST_ARCH),$(NO_FABRIC_ARCH))) |
| 47 |
FABRIC := --with-libfabric=/usr |
| 48 |
endif |
| 49 |
ifneq (,$(filter $(DEB_HOST_ARCH),$(NO_REAL128_ARCH))) |
| 50 |
MPICHLIB_FCFLAGS:=$(MPICHLIB_FCFLAGS) -DNO_REAL128 |
| 51 |
endif |
| 52 |
ifeq (,$(filter $(DEB_HOST_ARCH),$(NO_SLURM_ARCH))) |
| 53 |
SLURM := --with-slurm=/usr |
| 54 |
endif |
| 55 |
|
| 56 |
HIP:= $(if $(filter $(DEB_TARGET_ARCH), $(HIP_ARCH)),--with-hip=/usr,) |
| 57 |
PMIX:= $(if $(filter $(DEB_TARGET_ARCH), $(PMIX_ARCH)),--with-pmix=/usr/lib/${DEB_HOST_MULTIARCH}/pmix2,) |
| 58 |
|
| 59 |
UCX:= |
| 60 |
ifneq (,$(filter $(DEB_HOST_ARCH),$(CH4_UCX_ARCH))) |
| 61 |
DEVICE:= --with-device=ch4:ucx |
| 62 |
UCX:= --with-ucx=/usr |
| 63 |
else ifneq (,$(filter $(DEB_HOST_ARCH),$(CH4_OFI_ARCH))) |
| 64 |
DEVICE:= --with-device=ch4:ofi |
| 65 |
else |
| 66 |
DEVICE:= --with-device=ch3 |
| 67 |
endif |
| 68 |
ifneq (,$(filter $(DEB_HOST_ARCH),$(UCC_ARCH))) |
| 69 |
UCC:= -with-ucc=/usr |
| 70 |
endif |
| 71 |
|
| 72 |
extra_flags += \ |
| 73 |
$(VERBS) \ |
| 74 |
$(FABRIC) \ |
| 75 |
$(SLURM) \ |
| 76 |
$(UCX) \ |
| 77 |
$(UCC) \ |
| 78 |
$(HIP) \ |
| 79 |
$(PMIX) \ |
| 80 |
$(DEVICE) \ |
| 81 |
--with-pm=hydra \ |
| 82 |
--enable-mpi-abi \ |
| 83 |
--with-hwloc-prefix=/usr \ |
| 84 |
--with-wrapper-dl-type=none \ |
| 85 |
--enable-shared \ |
| 86 |
--without-yaksa \ |
| 87 |
--prefix=/usr \ |
| 88 |
--enable-fortran=all \ |
| 89 |
--disable-rpath \ |
| 90 |
--disable-wrapper-rpath \ |
| 91 |
--sysconfdir=/etc/mpich \ |
| 92 |
--libdir=\$${prefix}/lib/${DEB_HOST_MULTIARCH}/mpich/lib \ |
| 93 |
--includedir=\$${prefix}/lib/${DEB_HOST_MULTIARCH}/mpich/include \ |
| 94 |
--docdir=/usr/share/doc/mpich |
| 95 |
|
| 96 |
|
| 97 |
AUTOGENERATED := $(patsubst %.in,%,$(wildcard debian/*.in)) |
| 98 |
|
| 99 |
%: %.in |
| 100 |
sed 's%@DEB_HOST_MULTIARCH@%$(DEB_HOST_MULTIARCH)%g' < $< > $@ |
| 101 |
|
| 102 |
%: |
| 103 |
dh $@ |
| 104 |
|
| 105 |
override_dh_autoreconf: |
| 106 |
# need to regenerate configure to cope with --runstatedir |
| 107 |
# (cd src/mpl && autoconf) |
| 108 |
cp -a /usr/share/automake-1.18/depcomp . |
| 109 |
dh_autoreconf ./autogen.sh |
| 110 |
|
| 111 |
override_dh_auto_configure: $(AUTOGENERATED) |
| 112 |
dh_auto_configure -- $(extra_flags) CPPFLAGS="" CFLAGS="" CXXFLAGS="" FFLAGS="$(FFLAGS)" FCFLAGS="$(FFLAGS)" BASH_SHELL=/bin/bash |
| 113 |
dh_auto_configure --sourcedirectory src/pm/hydra -- --with-hwloc-prefix=/usr $(DEVICE) FFLAGS="$(FFLAGS)" |
| 114 |
sed -r -i 's/ +-ffile-prefix-map=[^ ]+//g' src/env/mpifort.bash src/include/mpichinfo.h src/packaging/pkgconfig/mpich.pc src/pm/hydra/hydra_config.h |
| 115 |
|
| 116 |
execute_after_dh_auto_build-indep: |
| 117 |
$(MAKE) -f doc/Makefile.mk |
| 118 |
|
| 119 |
override_dh_auto_install-arch: |
| 120 |
dh_auto_install -a |
| 121 |
dh_auto_install -a --sourcedirectory src/pm/hydra |
| 122 |
|
| 123 |
# Rename executables (ignore upstream symlinks) |
| 124 |
for i in mpicc mpicxx mpifort; do \ |
| 125 |
(cd debian/tmp/usr/bin/ && mv $$i $$i.mpich); \ |
| 126 |
done |
| 127 |
# Rename manpages |
| 128 |
# TODO: manpages not shipped in beta ? |
| 129 |
#for i in mpicc mpicxx mpiexec mpif77 mpifort; do \ |
| 130 |
# (cd debian/tmp/usr/share/man/man1/ && mv $$i.1 $$i.mpich.1);\ |
| 131 |
#done |
| 132 |
|
| 133 |
# Fix incorrect paths in /usr/bin/mpi{cc,cxx,fort}.mpich |
| 134 |
for fn in debian/tmp/usr/bin/mpicc.mpich debian/tmp/usr/bin/mpicxx.mpich \ |
| 135 |
debian/tmp/usr/bin/mpifort.mpich; do \ |
| 136 |
sed -i 's:$(CURDIR)/debian/tmp/::g' $$fn ;\ |
| 137 |
done |
| 138 |
|
| 139 |
execute_after_dh_fixperms: |
| 140 |
- chrpath -d debian/libmpich12/usr/lib/*/*.so.* || true |
| 141 |
|
| 142 |
execute_before_dh_auto_clean: |
| 143 |
dh_auto_clean --sourcedirectory doc/installguide |
| 144 |
dh_auto_clean --sourcedirectory doc/userguide |
| 145 |
|
| 146 |
execute_after_dh_auto_clean: |
| 147 |
$(RM) $(AUTOGENERATED) depcomp |
| 148 |
|
| 149 |
override_dh_installchangelogs: |
| 150 |
dh_installchangelogs CHANGES |
| 151 |
|
| 152 |
# Some tests are failing on hurd-amd64 hurd-i386. |
| 153 |
# Disable them, to be investiated later |
| 154 |
# disable_test_archs = hurd-amd64 hurd-i386 |
| 155 |
disable_test_archs = |
| 156 |
# ifneq (,$(filter $(DEB_HOST_ARCH),$(disable_test_archs))) |
| 157 |
override_dh_auto_test: |
| 158 |
@echo "Don't fail on tests in experimental" |
| 159 |
- dh_auto_test || true |
| 160 |
# endif |
| 161 |
|
| 162 |
override_dh_gencontrol: |
| 163 |
dh_gencontrol -- -V'archlist:ucx=$(CH4_UCX_ARCH)' |
| 164 |
|