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
|
#!/usr/bin/make -f
export DH_VERBOSE=1
include /usr/share/dpkg/architecture.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Drop flags on old gfortran < 10
GF_FLAGS:= $(if $(filter $(shell readlink /usr/bin/gfortran), gfortran-9),, -fallow-invalid-boz -fallow-argument-mismatch)
export MPICHLIB_CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
export MPICHLIB_CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
export MPICHLIB_CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
export MPICHLIB_FFLAGS:=$(shell dpkg-buildflags --get FFLAGS) $(GF_FLAGS)
export MPICHLIB_FCFLAGS:=$(shell dpkg-buildflags --get FFLAGS) -cpp $(GF_FLAGS)
export FFLAGS:=$(shell dpkg-buildflags --get FFLAGS | sed -e 's/-g //') $(GF_FLAGS)
export F77=f77
export TZ=UTC+0
export V=1
# FC:=$(shell basename $(shell readlink /etc/alternatives/f95))
# export FC
export HIPCXX=clang++-21
# Keep old library naming scheme
export MPILIBNAME=mpich
NO_ROMIO_ARCH:= hurd-amd64 hurd-i386
NO_VERBS_ARCH:= hurd-amd64 hurd-i386
NO_SLURM_ARCH:= hurd-amd64 hurd-i386
NO_FABRIC_ARCH:= hurd-amd64 hurd-i386 powerpc sh4
NO_REAL128_ARCH:= armel armhf mipsel hppa m68k sh4
# Pick one as default, unlisted ones get CH3
CH4_UCX_ARCH:= $(shell sed -n -r '/^Build/,/^$$/s/.*libucx-dev *\[([^]]*)\].*/\1/p' debian/control)
CH4_OFI_ARCH:= alpha ppc64 sparc64
HIP_ARCH:= $(shell sed -n -r '/^Build/,/^$$/s/.*libamdhip64-dev *\[([^]]*)\].*/\1/p' debian/control)
PMIX_ARCH:= $(shell sed -n -r '/^Build/,/^$$/s/.*libpmix-dev *\[([^]]*)\].*/\1/p' debian/control)
ifeq (,$(filter $(DEB_HOST_ARCH),$(NO_VERBS_ARCH)))
VERBS := --with-ibverbs
endif
ifeq (,$(filter $(DEB_HOST_ARCH),$(NO_FABRIC_ARCH)))
FABRIC := --with-libfabric=/usr
endif
ifneq (,$(filter $(DEB_HOST_ARCH),$(NO_REAL128_ARCH)))
MPICHLIB_FCFLAGS:=$(MPICHLIB_FCFLAGS) -DNO_REAL128
endif
ifeq (,$(filter $(DEB_HOST_ARCH),$(NO_SLURM_ARCH)))
SLURM := --with-slurm=/usr
endif
HIP:= $(if $(filter $(DEB_TARGET_ARCH), $(HIP_ARCH)),--with-hip=/usr,)
PMIX:= $(if $(filter $(DEB_TARGET_ARCH), $(PMIX_ARCH)),--with-pmix=/usr/lib/${DEB_HOST_MULTIARCH}/pmix2,)
UCX:=
ifneq (,$(filter $(DEB_HOST_ARCH),$(CH4_UCX_ARCH)))
DEVICE:= --with-device=ch4:ucx
UCX:= --with-ucx=/usr
else ifneq (,$(filter $(DEB_HOST_ARCH),$(CH4_OFI_ARCH)))
DEVICE:= --with-device=ch4:ofi
else
DEVICE:= --with-device=ch3
endif
extra_flags += \
$(VERBS) \
$(FABRIC) \
$(SLURM) \
$(UCX) \
$(HIP) \
$(PMIX) \
$(DEVICE) \
--with-pm=hydra \
--with-hwloc-prefix=/usr \
--with-wrapper-dl-type=none \
--enable-shared \
--without-yaksa \
--prefix=/usr \
--enable-fortran=all \
--disable-rpath \
--disable-wrapper-rpath \
--sysconfdir=/etc/mpich \
--libdir=\$${prefix}/lib/${DEB_HOST_MULTIARCH}/mpich/lib \
--includedir=\$${prefix}/lib/${DEB_HOST_MULTIARCH}/mpich/include \
--docdir=/usr/share/doc/mpich
AUTOGENERATED := $(patsubst %.in,%,$(wildcard debian/*.in))
%: %.in
sed 's%@DEB_HOST_MULTIARCH@%$(DEB_HOST_MULTIARCH)%g' < $< > $@
%:
dh $@
override_dh_autoreconf:
# need to regenerate configure to cope with --runstatedir
# (cd src/mpl && autoconf)
cp -a /usr/share/automake-1.18/depcomp .
dh_autoreconf ./autogen.sh
override_dh_auto_configure: $(AUTOGENERATED)
dh_auto_configure -- $(extra_flags) CPPFLAGS="" CFLAGS="" CXXFLAGS="" FFLAGS="$(FFLAGS)" FCFLAGS="$(FFLAGS)" BASH_SHELL=/bin/bash
dh_auto_configure --sourcedirectory src/pm/hydra -- --with-hwloc-prefix=/usr $(DEVICE) FFLAGS="$(FFLAGS)"
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
execute_after_dh_auto_build-indep:
$(MAKE) -f doc/Makefile.mk
override_dh_auto_install-arch:
dh_auto_install -a
dh_auto_install -a --sourcedirectory src/pm/hydra
# Rename executables (ignore upstream symlinks)
for i in mpicc mpicxx mpifort; do \
(cd debian/tmp/usr/bin/ && mv $$i $$i.mpich); \
done
# Rename manpages
# TODO: manpages not shipped in beta ?
#for i in mpicc mpicxx mpiexec mpif77 mpifort; do \
# (cd debian/tmp/usr/share/man/man1/ && mv $$i.1 $$i.mpich.1);\
#done
# Fix incorrect paths in /usr/bin/mpi{cc,cxx,fort}.mpich
for fn in debian/tmp/usr/bin/mpicc.mpich debian/tmp/usr/bin/mpicxx.mpich \
debian/tmp/usr/bin/mpifort.mpich; do \
sed -i 's:$(CURDIR)/debian/tmp/::g' $$fn ;\
done
execute_after_dh_fixperms:
chrpath -d debian/libmpich12/usr/lib/*/*.so.*
execute_before_dh_auto_clean:
dh_auto_clean --sourcedirectory doc/installguide
dh_auto_clean --sourcedirectory doc/userguide
execute_after_dh_auto_clean:
$(RM) $(AUTOGENERATED) depcomp
override_dh_installchangelogs:
dh_installchangelogs CHANGES
# Some tests are failing on hurd-amd64 hurd-i386.
# Disable them, to be investiated later
# disable_test_archs = hurd-amd64 hurd-i386
disable_test_archs =
# ifneq (,$(filter $(DEB_HOST_ARCH),$(disable_test_archs)))
override_dh_auto_test:
@echo "Don't fail on tests in experimental"
- dh_auto_test || true
# endif
override_dh_gencontrol:
dh_gencontrol -- -V'archlist:ucx=$(CH4_UCX_ARCH)'
|