| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
CFLAGS=-g -O2 |
| 4 |
|
| 5 |
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 6 |
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 7 |
|
| 8 |
include /usr/share/mpi-default-dev/debian_defaults |
| 9 |
|
| 10 |
empty := |
| 11 |
space := $(empty)$(empty) |
| 12 |
|
| 13 |
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(OPENMPI_AVAILABLE_ARCHITECTURES)$(space))) |
| 14 |
MPI_SUPPORTED = openmpi |
| 15 |
endif |
| 16 |
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(MPICH_AVAILABLE_ARCHITECTURES)$(space))) |
| 17 |
MPI_SUPPORTED += mpich |
| 18 |
endif |
| 19 |
|
| 20 |
%: |
| 21 |
dh $@ --with autoreconf |
| 22 |
|
| 23 |
execute_after_dh_clean: |
| 24 |
rm -rf $(CURDIR)/pristine-src $(CURDIR)/build-mpich $(CURDIR)/build-openmpi |
| 25 |
|
| 26 |
override_dh_auto_configure: |
| 27 |
for mpi_flavor in $(MPI_SUPPORTED); do \ |
| 28 |
MPICC=mpicc.$${mpi_flavor} \ |
| 29 |
MPICXX=mpicxx.$${mpi_flavor} \ |
| 30 |
MPIF77=mpif77.$${mpi_flavor} \ |
| 31 |
MPIFC=mpifort.$${mpi_flavor} \ |
| 32 |
MPIF90=mpif90.$${mpi_flavor} \ |
| 33 |
LDFLAGS="$${LDFLAGS} -pthread" \ |
| 34 |
MPIEXEC="mpiexec.$${mpi_flavor} -np %NP%" \ |
| 35 |
dh_auto_configure --builddirectory=$(CURDIR)/build-$${mpi_flavor} -- \ |
| 36 |
--enable-cxx \ |
| 37 |
--with-tcgmsg \ |
| 38 |
--with-scalapack="-lscalapack-$${mpi_flavor}" \ |
| 39 |
--with-blas4=-lblas \ |
| 40 |
--with-lapack=-llapack \ |
| 41 |
--with-mpi \ |
| 42 |
--with-armci=-larmci-$${mpi_flavor} \ |
| 43 |
MPI_FLAVOR=$${mpi_flavor}; \ |
| 44 |
done |
| 45 |
|
| 46 |
override_dh_auto_build: |
| 47 |
for mpi_flavor in $(MPI_SUPPORTED); do \ |
| 48 |
dh_auto_build --builddirectory=$(CURDIR)/build-$${mpi_flavor}; \ |
| 49 |
done |
| 50 |
|
| 51 |
override_dh_auto_install: |
| 52 |
for mpi_flavor in $(MPI_SUPPORTED); do \ |
| 53 |
dh_auto_install --builddirectory=$(CURDIR)/build-$${mpi_flavor} --destdir=$(CURDIR)/debian/tmp; \ |
| 54 |
done |
| 55 |
rm -f $(CURDIR)/debian/tmp/usr/include/error.h |
| 56 |
rm -f $(CURDIR)/debian/tmp/usr/include/memcpy.h |
| 57 |
rm -f $(CURDIR)/debian/tmp/usr/include/scope.h |
| 58 |
rm -f $(CURDIR)/debian/tmp/usr/include/string-util.h |
| 59 |
rm -f $(CURDIR)/debian/tmp/usr/include/table.h |
| 60 |
|
| 61 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 62 |
override_dh_auto_test: |
| 63 |
-for mpi_flavor in $(MPI_SUPPORTED); do \ |
| 64 |
dh_auto_test --builddirectory=$(CURDIR)/build-$${mpi_flavor} -- -j1 -k ARMCI_USE_WIN_ALLOCATE=1 MPIEXEC="mpiexec.$${mpi_flavor} -np 4"; \ |
| 65 |
done |
| 66 |
endif |
| 67 |
|
| 68 |
override_dh_link: |
| 69 |
dh_link -plibglobalarrays-dev usr/lib/$(DEB_HOST_MULTIARCH)/libga-$(ARCH_DEFAULT_MPI_IMPL).a usr/lib/$(DEB_HOST_MULTIARCH)/libga.a |
| 70 |
dh_link -plibglobalarrays-dev usr/lib/$(DEB_HOST_MULTIARCH)/libga++-$(ARCH_DEFAULT_MPI_IMPL).a usr/lib/$(DEB_HOST_MULTIARCH)/libga++.a |
| 71 |
dh_link -plibglobalarrays-dev usr/lib/$(DEB_HOST_MULTIARCH)/ga/$(ARCH_DEFAULT_MPI_IMPL)/bin/ga-config usr/bin/ga-config |