File: rules

package info (click to toggle)
tomopy 1.15.3%2Bds1-3
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 16,320 kB
  • sloc: cpp: 8,205; ansic: 7,231; python: 6,629; sh: 169; makefile: 70
file content (73 lines) | stat: -rwxr-xr-x 2,497 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
#!/usr/bin/make -f

export PYBUILD_NAME=tomopy
include /usr/share/dpkg/architecture.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

ifneq (,$(wildcard /usr/include/mkl/mkl.h))
  USE_MKL:=ON
else
  USE_MKL:=OFF
endif

ifneq (,$(wildcard /usr/lib/llvm-*/lib/clang/*/include/omp.h))
  USE_OPENMP:=ON
else
  USE_OPENMP:=OFF
endif

export CMAKE_OPTIONS := \
  -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
  -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
  -DWITH_SHARED_LIB=1 \
  -DWITH_STATIC_LIB=0 \
  -DCMAKE_CUDA_HOST_COMPILER=cuda-g++ \
  -DMKL_ROOT_DIR=/usr \
  -DMKL_INCLUDE_DIR=/usr/include/mkl \
  -DCMAKE_BUILD_TYPE=Release \
  -DTOMOPY_USE_MKL=$(USE_MKL) \
  -DTOMOPY_USE_OPENMP=$(USE_OPENMP)

%:
	dh $@ --with python3 --buildsystem=pybuild --test-pytest

PTLLINKS=VERSION CMakeLists.txt cmake source
override_dh_auto_configure:
	mkdir -p source/PTL
	for i in $(PTLLINKS) ; do ln -s ../../PTL/$$i source/PTL/ ; done
	dh_auto_configure -Spython3 --buildsystem=pybuild -O--test-pytest
	set -e ; for v in $$(py3versions -sv) ; do \
		dh_auto_configure -Scmake -Bobj-$(DEB_HOST_GNU_TYPE)-py$$v -- $(CMAKE_OPTIONS) -DPYTHON_EXECUTABLE=/usr/bin/python$$v -DCMAKE_INSTALL_LIBDIR=/usr/lib/python$$v/dist-packages/tomopy/util/extern ; \
	done

override_dh_auto_build:
	dh_auto_build -Spython3 --buildsystem=pybuild -O--test-pytest
	set -e ; for v in $$(py3versions -sv) ; do \
		dh_auto_build -Scmake -Bobj-$(DEB_HOST_GNU_TYPE)-py$$v ; \
		dh_auto_install -Scmake -Bobj-$(DEB_HOST_GNU_TYPE)-py$$v ; \
	done

override_dh_auto_install:
	dh_auto_install -Spython3 --buildsystem=pybuild -O--test-pytest
	set -e ; for v in $$(py3versions -sv) ; do \
		dh_auto_install -Scmake -Bobj-$(DEB_HOST_GNU_TYPE)-py$$v ; \
		sed -i "s,/usr/lib/python$$v/,/usr/lib/python3/,g" debian/python3-tomopy/usr/lib/python$$v/dist-packages/tomopy/util/extern/cmake/libtomo/*.cmake ; \
	done

execute_after_dh_auto_clean:
	set -e ; for v in $$(py3versions -sv) ; do \
		dh_auto_clean -Scmake -Bobj-$(DEB_HOST_GNU_TYPE)-py$$v ; \
	done
	for i in $(PTLLINKS) ; do rm -f source/PTL/$$i ; done

execute_before_dh_auto_test:
	set -e ; for v in $$(py3versions -sv) ; do \
		cp -v debian/python3-tomopy/usr/lib/python$$v/dist-packages/tomopy/util/extern/*.so $(CURDIR)/.pybuild/cpython3_$${v}_tomopy/build/tomopy/util/extern ; \
	done

execute_after_dh_auto_test:
	rm -f $(CURDIR)/.pybuild/cpython*/build/tomopy/util/extern/*.so