Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 export DEB_BUILD_MAINT_OPTIONS = hardening=+all abi=+lfs
4
5 include /usr/share/dpkg/architecture.mk
6
7 BUILD_TESTING = $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON)
8 # skip some flaky tests
9 # TestMemoryLeak fails, MERGE reports "bus error" on buildd (but not debci)
10 GTEST_FILTER := -TestMemoryLeak.*:MERGE.*
11 ifeq ($(DEB_HOST_ARCH_BITS),32)
12 GTEST_FILTER := ${GTEST_FILTER}:testCppcontribSaDecode*
13 endif
14 ifeq ($(DEB_BUILD_ARCH), sparc64)
15 GTEST_FILTER := ${GTEST_FILTER}:testCppcontribSaDecode*:testCppcontribUintreader*
16 endif
17 ifeq ($(DEB_BUILD_ARCH), s390x)
18 GTEST_FILTER := ${GTEST_FILTER}:testCppcontribSaDecode*:testCppcontribUintreader*:TestFastScan.*
19 endif
20 ifeq ($(DEB_BUILD_ARCH), armel)
21 GTEST_FILTER := ${GTEST_FILTER}:TestLowLevelIVF.IVFRQ
22 endif
23 ifneq ($(DEB_BUILD_ARCH), amd64)
24 # strange bus errors
25 GTEST_FILTER := ${GTEST_FILTER}:*flatcodes
26 endif
27
28 export PYBUILD_SYSTEM = cmake
29
30 COMMON_CONFIGURE_ARGS = \
31 -DFAISS_ENABLE_GPU=OFF \
32 -DFAISS_ENABLE_PYTHON=ON
33
34 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
35 COMMON_CONFIGURE_ARGS += \
36 -DFAISS_USE_SYSTEM_GTEST=ON \
37 -DFAISS_GTEST_FILTER="$(GTEST_FILTER)"
38 endif
39
40 export PYBUILD_CONFIGURE_ARGS = \
41 $(COMMON_CONFIGURE_ARGS) \
42 -DBUILD_TESTING=OFF \
43 -DFAISS_ENABLE_C_API=OFF
44
45 export PYBUILD_CONFIGURE_ARGS_$(shell py3versions -d) = \
46 $(COMMON_CONFIGURE_ARGS) \
47 -DBUILD_TESTING=$(BUILD_TESTING) \
48 -DFAISS_ENABLE_C_API=ON
49
50 export PYBUILD_AFTER_INSTALL = \
51 cd {build_dir}/faiss/python \
52 && {interpreter} setup.py install --root=$(CURDIR)/debian/python3-faiss --install-lib=/usr/lib/python{version}/site-packages
53
54 %:
55 dh $@ --buildsystem=pybuild
56