#! /usr/bin/make -f export DH_VERBOSE=1 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) 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 # 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:= mips64el alpha ppc64 sparc64 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 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) \ $(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: 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_before_dh_auto_clean: dh_auto_clean --sourcedirectory doc/installguide dh_auto_clean --sourcedirectory doc/userguide execute_after_dh_auto_clean: $(RM) $(AUTOGENERATED) override_dh_installchangelogs: dh_installchangelogs README # 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)'