#!/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: 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