File: rules

package info (click to toggle)
sdpa 7.3.20-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,688 kB
  • sloc: cpp: 15,021; sh: 4,870; makefile: 318; ansic: 81
file content (90 lines) | stat: -rwxr-xr-x 4,032 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/make -f

# DH_VERBOSE is used for test building
# export DH_VERBOSE=1

DEB_CFLAGS_MAINT_APPEND = -funroll-all-loops
DEB_CXXFLAGS_MAINT_APPEND = -funroll-all-loops
DPKG_EXPORT_BUILDFLAGS = 1
%:
	dh $@ --with autoreconf

# Add here any variable or target overrides you need.
DEB_MAKE_INSTALL_TARGET =

# DEB_MAKE_ENVVARS = CFLAGS="-funroll-all-loops" CXXFLAGS="-funroll-all-loops"
# DEB_MAKE_ENVVARS = CFLAGS="-g -O2 -Wall -fPIC -funroll-all-loops" CXXFLAGS="-g -O2 -D_REENTRANT -Wall -fPIC -funroll-all-loops" FCFLAGS="-g -O2 -Wall -fPIC -funroll-all-loops"

FCFLAGS  += -Wall -fPIC -funroll-all-loops

# For old libatlas-base-dev
DEB_CONFIGURE_EXTRA_FLAGS = --with-lapack="/usr/lib/atlas/liblapack.a" --with-blas="/usr/lib/atlas/libblas.a"
# For new libatlas-base-dev
ifeq ($(shell test -f /usr/lib/$(DEB_HOST_MULTIARCH)/atlas/libblas.a && echo 1),1)
	DEB_CONFIGURE_EXTRA_FLAGS = --with-lapack="/usr/lib/$(DEB_HOST_MULTIARCH)/liblapack.a" --with-blas="/usr/lib/$(DEB_HOST_MULTIARCH)/atlas/libblas.a"
endif
# For new libopenblas-dev
ifeq ($(shell test -f /usr/lib/$(DEB_HOST_MULTIARCH)/libopenblas.a && echo 1),1)
	DEB_CONFIGURE_EXTRA_FLAGS = --with-lapack="/usr/lib/$(DEB_HOST_MULTIARCH)/openblas/liblapack.a" --with-blas="/usr/lib/$(DEB_HOST_MULTIARCH)/openblas/libblas.a"
endif

# For new libopenblas-pthread-dev
ifeq ($(shell test -f /usr/lib/$(DEB_HOST_MULTIARCH)/openblas-pthread/libblas.a && echo 1),1)
	DEB_CONFIGURE_EXTRA_FLAGS = --with-lapack="/usr/lib/$(DEB_HOST_MULTIARCH)/openblas-pthread/liblapack.a" --with-blas="/usr/lib/$(DEB_HOST_MULTIARCH)/openblas-pthread/libblas.a"
endif

# MUMPS_LIBS="-ldmumps_seq -lsmumps_seq -lcmumps_seq -lzmumps_seq -lmumps_common_seq -lpord -lscotch -lesmumps -lgfortran -lquadmath"
QUADMATH_SO := $(shell $(FC) -print-file-name=libquadmath.so 2>/dev/null)
ifneq ($(QUADMATH_SO),libquadmath.so)
  QUADMATH_FLAG := -lquadmath
else
  QUADMATH_FLAG :=
endif
MUMPS_LIBS="-ldmumps_seq -lsmumps_seq -lcmumps_seq -lzmumps_seq -lmumps_common_seq -lpord -lscotch -lesmumps -lgfortran $(QUADMATH_FLAG)"

# "/usr/lib/$(DEB_HOST_MULTIARCH)/libdmumps_seq.a /usr/lib/$(DEB_HOST_MULTIARCH)/libmumps_common_seq.a /usr/lib/$(DEB_HOST_MULTIARCH)/libmpiseq_seq.a /usr/lib/$(DEB_HOST_MULTIARCH)/libpord_seq.a -lscotch -lesmumps"
DEB_CONFIGURE_EXTRA_FLAGS += --with-mumps-libs=$(MUMPS_LIBS)


# LIBMUMPS_VER := $(shell dpkg --status libmumps-seq-dev | awk '/^Version:/ {print $$2}' |cut -f 1 -d "-")
# LIBMUMPS_VER := $(shell dpkg --status libmumps-seq-dev  | grep ^Depends | tr " " "\n" | grep libmumps-seq | cut -f 3 -d "-")
# LIBMUMPS_VER := $(shell dpkg --status libmumps-seq-dev | awk '/^Version:/ {print $$2}' |cut -f 1 -d "-" | cut -d . -f 1-2)
# DEB_DH_GENCONTROL_ARGS_ALL = -- -Vmumps-seq:Version=$(LIBMUMPS_VER)

SDPA_DIR=$(CURDIR)/debian/sdpa
SDPAM_DIR=$(CURDIR)/debian/sdpam
LIBSDPA_DIR=$(CURDIR)/debian/libsdpa-dev
override_dh_auto_build:
	dh_auto_build
	$(MAKE) -C mex \
	  MAKE_INCLUDE_DIR=../etc COMPILE_ENVIRONMENT=octave \
	  ALL_INCLUDE=-I../ SDPA_LIB=../libsdpa.a

# binary-post-install/sdpam::
#	cd $(SDPAM_DIR)/usr/lib/sdpa/mex/ && \
#	ln -s ../../../share/sdpa/mex/*.m .
#	cd $(SDPAM_DIR)/usr/lib/sdpa/mex/ && \
#	ln -s ../../../share/sdpa/mex/CommandList.txt .

override_dh_auto_configure:
	autoreconf -fi
	dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)

override_dh_auto_install:
	# Default install
	dh_auto_install
	# Install compiled MEX/Octave modules only if they exist (avoid dh_install failures)
	if ls mex/*.oct* >/dev/null 2>&1; then \
		install -d debian/sdpam/usr/lib/sdpa/mex/ ; \
		install -m 755 mex/*.oct* debian/sdpam/usr/lib/sdpa/mex/ ; \
	fi

override_dh_shlibdeps:
	dh_shlibdeps
	# If sdpam contains no ELF objects, dh_shlibdeps may not create debian/sdpam.substvars.
	# Create an empty shlibs:Depends to avoid dpkg-gencontrol warning.
	if [ -f debian/sdpam.substvars ]; then \
		grep -q '^shlibs:Depends=' debian/sdpam.substvars || echo 'shlibs:Depends=' >> debian/sdpam.substvars ; \
	else \
		echo 'shlibs:Depends=' > debian/sdpam.substvars ; \
	fi