File: rules

package info (click to toggle)
scotch 7.0.8-1exp5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 22,388 kB
  • sloc: ansic: 85,502; makefile: 4,560; fortran: 2,536; yacc: 642; lex: 257; sh: 216
file content (158 lines) | stat: -rwxr-xr-x 5,334 bytes parent folder | download | duplicates (3)
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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1


include /usr/share/dpkg/architecture.mk

empty :=
space := $(empty)$(empty)

# int = default build (using int, giving 32-bit indexing)
# int64 = 64-bit indexing only (with standard integers)
# int64i = full 64-bit integers and indexing
BIT_BUILDS = int int64 int64i

BUILDDIR_BASE=obj-$(DEB_HOST_MULTIARCH)

# Add here any variable or target overrides you need.
# where sources are
DEB_SRCDIR = $(CURDIR)/src

# no check for this software
#DEB_MAKE_CHECK_TARGET :=

CMAKE_FLAGS_COMMON = -DBUILD_SHARED_LIBS=ON \
			-DUSE_ZLIB=ON \
			-DUSE_BZ2=ON \
			-DUSE_LZMA=ON \
			-DTHREADS=ON \
			-DMPI_THREAD_MULTIPLE=ON \
			-DSCOTCH_DETERMINISTIC=FIXED_SEED

SCOTCH_CONFIG_CFLAGS = -DSCOTCH_PTHREAD_NUMBER=2 \
			-DCOMMON_PTHREAD_FILE

# hurd does not have POSIX time and therefore needs sys/time.h to define struct timeval
# hurd does not support pthread_setaffinity_np (-DSCOTCH_PTHREAD_AFFINITY_LINUX)
ifeq ($(DEB_BUILD_ARCH_OS),hurd)
  SCOTCH_CONFIG_CFLAGS += -DHAVE_SYS_TIME_H=ON
endif

# By default, halt on test (check) failures. But,
# - hurd times out on buildd during build-time checks
# - m68k segfaults inside the qemu emulator used for builds
# - powerpcspe segfaults on test_scotch_graph_order in INTSIZE64
# so don't halt on test failures on these arches.
# In fact don't run tests at all on hurd.
ifeq ($(DEB_HOST_ARCH_OS),hurd)
  HALT_ON_TEST_ERROR = no
  SKIP_TESTS = yes
else ifeq ($(DEB_HOST_ARCH),m68k)
  HALT_ON_TEST_ERROR = no
else ifeq ($(DEB_HOST_ARCH),powerpcspe)
  HALT_ON_TEST_ERROR = no
else
  HALT_ON_TEST_ERROR = yes
endif
ifeq (nocheck,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
  SKIP_TESTS = yes
endif


# mord_ship001 fails with full 64-bit support (_64i) on some architectures
# skip the flakey test on these arches
64i_SKIP_FLAKEY_TESTS_ARCH_LIST = armel armhf ppc64el s390x alpha powerpc ppc64
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(64i_SKIP_FLAKEY_TESTS_ARCH_LIST)$(space)))
  CMAKE_EXTRA_FLAGS_64i = -DSKIP_FLAKEY_TESTS=ON
endif


DEB_STRIPPED_UPSTREAM_VERSION = $(shell echo $(DEB_UPSTREAM_VERSION) | sed -n -e 's/\.dfsg.*$$//p')
SCOTCH_VERSION=$(DEB_STRIPPED_UPSTREAM_VERSION)

export PRTE_MCA_plm_ssh_agent=/bin/false      # workaround to start MPI-applications in chroot
export OMPI_MCA_btl_tcp_if_include=lo         # avoid complaints about unreachable pairing between local and remote
export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe  # oversubscribing allows s390x to use hardware threads

export DEB_CFLAGS_MAINT_APPEND = $(SCOTCH_CONFIG_CFLAGS)

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	for BITS in $(BIT_BUILDS); do \
            if [ $$BITS = int64 ]; then \
                LIBNAME_SUFFIX=_64; \
                bit_flags="-DIDXSIZE=64 -DSCOTCH_SONAME_SUFFIX=$${LIBNAME_SUFFIX}"; \
            elif [ $$BITS = int64i ]; then \
                LIBNAME_SUFFIX=_64i; \
                bit_flags="-DINTSIZE=64 -DIDXSIZE=64 -DSCOTCH_SONAME_SUFFIX=$${LIBNAME_SUFFIX} $(CMAKE_EXTRA_FLAGS_64i)"; \
            else \
                LIBNAME_SUFFIX=; \
                bit_flags=; \
            fi; \
            echo "Configure for scotch $$BITS" ; \
	    dh_auto_configure --builddirectory=$(BUILDDIR_BASE)$${LIBNAME_SUFFIX} -- $(CMAKE_FLAGS_COMMON) $${bit_flags}; \
	done

override_dh_auto_build:
	set -e; \
	for BITS in $(BIT_BUILDS); do \
            if [ $$BITS = int64 ]; then \
                LIBNAME_SUFFIX=_64; \
            elif [ $$BITS = int64i ]; then \
                LIBNAME_SUFFIX=_64i; \
            else \
                LIBNAME_SUFFIX=; \
            fi; \
	   echo "Compiling for $$BITS"; \
	   dh_auto_build -O--parallel --builddirectory=$(BUILDDIR_BASE)$${LIBNAME_SUFFIX}; \
	done

override_dh_auto_test:
	set -e; \
	for BITS in $(BIT_BUILDS); do \
            if [ $$BITS = int64 ]; then \
                LIBNAME_SUFFIX=_64; \
            elif [ $$BITS = int64i ]; then \
                LIBNAME_SUFFIX=_64i; \
            else \
                LIBNAME_SUFFIX=; \
            fi; \
            echo "Testing for $$BITS" ; \
	    dh_auto_test -O--parallel --builddirectory=$(BUILDDIR_BASE)$${LIBNAME_SUFFIX}; \
	done

override_dh_auto_install:
	set -e; \
	for BITS in $(BIT_BUILDS); do \
            if [ $$BITS = int64 ]; then \
                LIBNAME_SUFFIX=_64; \
            elif [ $$BITS = int64i ]; then \
                LIBNAME_SUFFIX=_64i; \
            else \
                LIBNAME_SUFFIX=; \
            fi; \
            echo "Installing for $$BITS" ; \
	    dh_auto_install -O--parallel --builddirectory=$(BUILDDIR_BASE)$${LIBNAME_SUFFIX}; \
	done

override_dh_installman:
	dh_installman
	mv debian/scotch/usr/share/man/man1/gmap.1 debian/scotch/usr/share/man/man1/scotch_gmap.1
	mv debian/scotch/usr/share/man/man1/gbase.1 debian/scotch/usr/share/man/man1/scotch_gbase.1
	(cd debian/scotch/usr/share/man/man1 && ln -sf scotch_gmap.1.gz scotch_gpart.1.gz)

execute_after_dh_auto_clean:
	for BITS in $(BIT_BUILDS); do \
            if [ $$BITS = int64 ]; then \
                LIBNAME_SUFFIX=_64; \
            elif [ $$BITS = int64i ]; then \
                LIBNAME_SUFFIX=_64i; \
            else \
                LIBNAME_SUFFIX=; \
            fi; \
	   rm -rf $(BUILDDIR_BASE)$${LIBNAME_SUFFIX}; \
	done