File: rules

package info (click to toggle)
fiat-ecmwf 1.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,672 kB
  • sloc: f90: 19,885; ansic: 12,076; perl: 480; sh: 309; fortran: 289; makefile: 41; cpp: 36
file content (61 lines) | stat: -rwxr-xr-x 1,914 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
#!/usr/bin/make -f

export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk
include /usr/share/debhelper/dh-fortran/fortran-support.mk

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
INCDIR:=/usr/include/$(DEB_HOST_MULTIARCH)
FMODDIR:=$(shell dh_fortran get_fmoddir)
INSTDIR:=$(CURDIR)/debian/tmp
CMAKE_DIR:=$(INSTDIR)/$(LIBDIR)/cmake

export FIAT_TEST_IGNORE_MPI_OUTPUT=1

DEB_CFLAGS_MAINT_APPEND= -I$(CURDIR)/src -I$(CURDIR)/obj-$(DEB_HOST_MULTIARCH)/src
DEB_CXXFLAGS_MAINT_APPEND= -I$(CURDIR)/src -I$(CURDIR)/obj-$(DEB_HOST_MULTIARCH)/src
DEB_FFLAGS_MAINT_APPEND= -I$(FMODDIR)
include /usr/share/dpkg/buildflags.mk


# OMP Doesn't appear to work on these archs
ARCH_NO_OMP:= riscv64 sparc64
ENABLE_OMP:=  $(if $(filter $(DEB_TARGET_ARCH), $(ARCH_NO_OMP)),Off,On)

BUILD_FLAGS = \
	-DENABLE_DOCS=On \
	-DENABLE_OMP=$(ENABLE_OMP) \
	-DENABLE_FORTRAN=On \
	-DENABLE_FCKIT=On \
	-DENABLE_MPI=On 

# Test suite requires 4 processors. Fake it
export OMPI_MCA_rmaps_base_oversubscribe=1

%:
	dh $@ --buildsystem=ecbuild --builddir=debian/build --with fortran

override_dh_auto_configure:
	dh_auto_configure -- ${BUILD_FLAGS} 

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	LD_LIBRARY_PATH=$(CURDIR)/debian/build/lib dh_auto_test || true
endif

override_dh_auto_install:
	dh_auto_install
	chrpath -d $(INSTDIR)/usr/bin/fiat-printbinding
	chrpath -d $(INSTDIR)/$(LIBDIR)/*.so*
	# Fix broken paths
	sed -i -e 's%$${_IMPORT_PREFIX}/include/fiat%/usr/include/${DEB_HOST_MULTIARCH}/fiat%g' \
		-e 's%$${_IMPORT_PREFIX}/include/mpi_serial%/usr/include/${DEB_HOST_MULTIARCH}/mpi_serial%g' \
		-e 's%$${_IMPORT_PREFIX}/module/fiat%${FMODDIR}/fiat%g' \
		-e 's%$${_IMPORT_PREFIX}/module/parkind_dp%${FMODDIR}/parkind_dp%g' \
		-e 's%$${_IMPORT_PREFIX}/module/parkind_sp%${FMODDIR}/parkind_sp%g' \
		$(CMAKE_DIR)/fiat/fiat-targets.cmake