File: rules

package info (click to toggle)
open-coarrays 2.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,568 kB
  • sloc: f90: 11,449; ansic: 9,754; sh: 3,211; makefile: 45
file content (68 lines) | stat: -rwxr-xr-x 2,629 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
#!/usr/bin/make -f

export DH_VERBOSE=1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
VERSION:=$(shell dpkg-parsechangelog --show-field Version)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
AUTOGENERATED:= libcoarrays-openmpi-dev.install  libcoarrays-mpich-dev.install \
	libcoarrays-openmpi-dev.links libcoarrays-mpich-dev.links \
        libcaf-mpich-3.links libcaf-openmpi-3.links \
	libcaf-mpich-3.install libcaf-openmpi-3.install \
	caf-mpich.pc	caf-openmpi.pc 

# Set default f95 compiler
F95 ?= /usr/bin/f95

# The magic debhelper  rule
%:
	dh $@ --buildsystem=cmake --no-parallel 

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
# DISABLED_TESTS:= "powerpc alpha"

MPICH_CFLAGS=$(dpkg-buildpackage --get CFLAGS) $(shell pkg-config mpich --cflags)
MPICH_FCFLAGS=$(dpkg-buildpackage --get FCFLAGS) $(shell pkg-config mpich-fort --cflags)
OPENMPI_CFLAGS=$(dpkg-buildpackage --get CFLAGS) $(shell pkg-config ompi-c --cflags)
OPENMPI_FCFLAGS=$(dpkg-buildpackage --get FCFLAGS) $(shell pkg-config ompi-fort --cflags)

override_dh_auto_configure:
	for f in ${AUTOGENERATED} ; do \
                sed -e 's%@TRIPLET@%${DEB_HOST_MULTIARCH}%g' < debian/$$f.in | \
		sed -e 's%@VERSION@%${VERSION}%g'   > debian/$$f ; \
                done
	CXX=mpicxx.mpich CC=mpicc.mpich FC=mpif90.mpich  \
		dh_auto_configure --builddirectory=build-mpich -- \
			-DCAF_LIB_NAME=caf_mpich
	CXX=mpicxx.openmpi CC=mpicc.openmpi FC=mpif90.openmpi  \
		dh_auto_configure --builddirectory=build-openmpi -- 	\
			-DCAF_LIB_NAME=caf_openmpi
	#dh_auto_configure --builddirectory=build-mpich --  \
	#		-DMPI_C_COMPILER=mpicc.mpich -DMPI_Fortran_COMPILER=mpifort.mpich \
	#		-DCMAKE_C_FLAGS="$(MPICH_CFLAGS)" -DCMAKE_Fortran_FLAGS="$(MPICH_FCFLAGS)" \
	#		-DCAF_LIB_NAME=caf_mpich 
	#dh_auto_configure --builddirectory=build-openmpi -- \
	#		-DMPI_C_COMPILER=mpicc.openmpi -DMPI_Fortran_COMPILER=mpifort.openmpi \
	#		-DCMAKE_C_FLAGS="$(OPENMPI_CFLAGS)" -DCMAKE_Fortran_FLAGS="$(OPENMPI_FCFLAGS)" \
	#		-DCAF_LIB_NAME=caf_openmpi 

override_dh_auto_build:
	dh_auto_build --builddirectory=build-mpich
	dh_auto_build --builddirectory=build-openmpi

override_dh_auto_install:
	dh_auto_install --builddirectory=build-mpich
	dh_auto_install --builddirectory=build-openmpi

override_dh_auto_clean:
	dh_clean
	rm -f $(patsubst %, debian/%, ${AUTOGENERATED})
	rm -rf build-*

override_dh_auto_test:
ifneq (,$(findstring  "$(DEB_HOST_ARCH)",$(DISABLED_TESTS)))
	@echo "Tests disabled on this arch: known failures being investigated"
else
	@echo "Tests may hang/timeout due to lack of processors. "
	-dh_auto_test --timeout 30
endif