File: rules

package info (click to toggle)
superlu-dist 8.1.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,428 kB
  • sloc: ansic: 129,752; sh: 3,051; f90: 827; cpp: 505; makefile: 426; fortran: 51; csh: 9
file content (87 lines) | stat: -rwxr-xr-x 3,247 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
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


# ignore test errors for some arches:
#   x32 times out in some tests
#   ia64 times out or fails some tests
ARCH_IGNORE_TEST_ERROR = ia64 x32

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

# ignore test errors, or not
IGNORE_TEST_ERROR=/bin/false
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(ARCH_IGNORE_TEST_ERROR)$(space)))
  IGNORE_TEST_ERROR=/bin/true
endif


# Allow test programs that use OpenMPI to run
export OMPI_MCA_plm_rsh_agent=/bin/false
export OMPI_MCA_rmaps_base_oversubscribe=1

export BUILDDIR = obj-$(DEB_HOST_GNU_TYPE)

%:
	dh $@ --buildsystem=cmake --with fortran_mod

override_dh_clean:
	dh_clean
	rm -f make.inc FORTRAN/superlu_dist_config.fh SRC/superlu_dist_config.h

# NOTE: the superlu-dist cmake scripts generate a configuration error:
#   CMake Error in SRC/CMakeLists.txt:
#    Found relative path while evaluating include directories of "superlu_dist":
#      "OFF"
# with error code 1, which causes the build to halt.
# But the configuration seems fine (GNUInstallDirs are used to define standard install dirs).
# For now, work around the error by ignoring it (append "|| /bin/true")
override_dh_auto_configure:
	dh_auto_configure -- \
	    -DBUILD_SHARED_LIBS=ON -DCMAKE_SKIP_RPATH=ON \
	    -DCMAKE_C_COMPILER=mpicc \
	    -DCMAKE_CXX_COMPILER=mpic++ \
	    -DXSDK_ENABLE_Fortran=ON \
	    -DCMAKE_FORTRAN_COMPILER=mpifort \
	    -DMPIEXEC_PREFLAGS=--allow-run-as-root \
	    -DCMAKE_INSTALL_INCLUDEDIR=include/superlu-dist \
	    -Denable_complex16=ON \
	    -DTPL_ENABLE_INTERNAL_BLASLIB=OFF -DTPL_BLAS_LIBRARIES=/usr/lib/$(DEB_HOST_MULTIARCH)/libblas.so \
	    -DTPL_ENABLE_LAPACKLIB=ON -DTPL_LAPACK_LIBRARIES=/usr/lib/$(DEB_HOST_MULTIARCH)/liblapack.so \
	    -DTPL_ENABLE_PARMETISLIB=ON \
	      -DTPL_PARMETIS_LIBRARIES="-lparmetis -lmetis" \
	      -DTPL_PARMETIS_INCLUDE_DIRS="/usr/include/parmetis" \
	    -DTPL_ENABLE_COMBBLASLIB=ON \
	      -DTPL_COMBBLAS_LIBRARIES="-lCombBLAS -lGraphGenlib -lUsortlib" \
	      -DTPL_COMBBLAS_INCLUDE_DIRS=/usr/include/CombBLAS/ \
	  || /bin/true


# set LD_LIBRARY_PATH to test against the libsuperlu_dist.so just built
override_dh_auto_test:
	export LD_LIBRARY_PATH=$(CURDIR)/$(BUILDDIR)/SRC:$${LD_LIBRARY_PATH}; \
	OMP_NUM_THREADS=1 LD_LIBRARY_PATH=$${LD_LIBRARY_PATH} dh_auto_test --max-parallel=1 || $(IGNORE_TEST_ERROR)

override_dh_install:
	dh_install
	for testfile in $$( find debian/libsuperlu-dist-dev -name CTestTestfile.cmake ); do \
	    sed -e "s|$(CURDIR)|<<builddir>>/superlu-dist|g;" \
		-i $$testfile; \
	    sed -r "s|(.*)\".*/(EXAMPLE/.*ua)|\1\"/usr/lib/$(DEB_HOST_MULTIARCH)/superlu-dist/tests/\2|" \
		-i $$testfile; \
	done