File: rules

package info (click to toggle)
gmap 2024-11-20%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 28,844 kB
  • sloc: ansic: 516,265; perl: 5,863; makefile: 1,211; sh: 80
file content (115 lines) | stat: -rwxr-xr-x 5,321 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/default.mk
mandir  := $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1
utildir := $(CURDIR)/build/util
bindir  := $(CURDIR)/build/src

include /usr/share/dpkg/architecture.mk

HELP2MAN = /usr/bin/help2man --no-info --version-string=${DEB_VERSION}

export DEB_CFLAGS_MAINT_APPEND=-O3 -DSIMDE_ENABLE_OPENMP -fomit-frame-pointer -Werror=implicit-function-declaration
# -Werror=implicit-function-declaration is to catch issues with SIMD levels

%:
	dh  $@ --builddir build


override_dh_auto_configure:
	rm -Rf src/simde
ifeq (amd64,$(DEB_HOST_ARCH))
# TODO: redo this based upon the amd64 micro-architectural levels; x86-64-v3 includes BMI1 BMI2 LZCNT, etc..
	DEB_CFLAGS_MAINT_APPEND="${DEB_CFLAGS_MAINT_APPEND} -UHAVE_MM_EXTRACT_EPI64 -UHAVE_STTNI" dh_auto_configure --reload-all-buildenv-variables -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap --enable-simd --with-simd-level=sse2
	DEB_CFLAGS_MAINT_APPEND="${DEB_CFLAGS_MAINT_APPEND} -UHAVE_MM_EXTRACT_EPI64 -UHAVE_STTNI" dh_auto_configure --reload-all-buildenv-variables --builddir build_ssse3 -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap --enable-simd --with-simd-level=ssse3 ax_cv_cpu_has_ssse3_ext=yes ax_cv_compile_ssse3_ext=yes ax_cv_link_tmmintrin_h=yes
	DEB_CFLAGS_MAINT_APPEND="${DEB_CFLAGS_MAINT_APPEND} -UHAVE_STTNI" dh_auto_configure --builddir build_sse41 -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap --enable-simd --with-simd-level=sse41 ax_cv_cpu_has_sse41_ext=yes ax_cv_compile_sse41_ext=yes ax_cv_link_smmintrin_h=yes
	dh_auto_configure --builddir build_sse42 -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap --enable-simd --with-simd-level=sse42 ax_cv_cpu_has_sse42_ext=yes ax_cv_compile_sse42_ext=yes ax_cv_link_nmmintrin_h=yes ax_cv_cpu_has_popcnt_ext=yes ax_make_sse42=yes ax_cv_cpu_has_bmi1_ext=yes ax_cv_compile_bmi_ext=yes ax_cv_link_bmi=yes
	dh_auto_configure --builddir build_avx2 -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap --enable-simd --with-simd-level=avx2 ax_make_avx2=yes ax_cv_cpu_has_bmi2_ext=yes ax_cv_compile_bmi2_ext=yes ax_cv_link_bmi2=yes
	dh_auto_configure --builddir build_avx512 -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap --enable-simd --with-simd-level=avx512 ax_cv_cpu_has_avx512_ext=yes ax_cv_compile_avx512_ext=yes ax_cv_compile_avx512bw_ext=no ax_cv_link_avx512bw=no
	# skipping avx512bw for now:
	# ../../src/oligoindex_hr.c: In function 'count_positions_fwd_simd':
        # ../../src/oligoindex_hr.c:19814:3: error: 'hugereverse8' undeclared (first use in this function); did you mean 'bigreverse8'?
        # 19814 |   hugereverse8 = _mm512_broadcast_i64x4(bigreverse8);
        #       |   ^~~~~~~~~~~~
        #       |   bigreverse8
else
	dh_auto_configure -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap --disable-simd
endif

override_dh_auto_build:
	dh_auto_build
ifeq (amd64,$(DEB_HOST_ARCH))
	dh_auto_build --builddir build_ssse3
	dh_auto_build --builddir build_sse41
	dh_auto_build --builddir build_sse42
	dh_auto_build --builddir build_avx2
	dh_auto_build --builddir build_avx512
endif

override_dh_auto_install:
	mkdir -p $(mandir)
	$(HELP2MAN) --name='Genomic Mapping and Alignment Program' \
	$(bindir)/gmap |debian/filter.pl >$(mandir)/gmap.1
	$(HELP2MAN) --name='Genomic Short-read Nucleotide Alignment Program' \
	$(bindir)/gsnap |debian/filter.pl >$(mandir)/gsnap.1
	$(HELP2MAN) --name='Large Genome Mapping and Alignment Program' \
	$(bindir)/gmapl |debian/filter.pl >$(mandir)/gmapl.1
	$(HELP2MAN) --name='Large Genome Short-read Nucleotide Alignment Program' \
	$(bindir)/gsnapl |debian/filter.pl >$(mandir)/gsnapl.1
	$(HELP2MAN) --name='Tool for genome database creation for GMAP or GSNAP' \
	$(utildir)/gmap_build |debian/filter.pl >$(mandir)/gmap_build.1
ifeq (amd64,$(DEB_HOST_ARCH))
	dh_auto_install --builddir build_avx512
	dh_auto_install --builddir build_avx2
	dh_auto_install --builddir build_sse42
	dh_auto_install --builddir build_sse41
	dh_auto_install --builddir build_ssse3
endif
	dh_auto_install


override_dh_install:
	mkdir -p debian/$(DEB_SOURCE)/usr/bin
	dh_install
	for bin in `echo gmap gsnap gmap_build gmapl gsnapl; \
		cd $(CURDIR)/debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/; \
		ls -1 gmap*.* gsnap*.* `; do \
		ln -s /usr/lib/gmap/$$bin debian/$(DEB_SOURCE)/usr/bin/$$bin; \
	done

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test --no-parallel
endif

override_dh_auto_clean:
ifeq (amd64,$(DEB_HOST_ARCH))
	dh_auto_clean --builddir build_avx512
	dh_auto_clean --builddir build_avx2
	dh_auto_clean --builddir build_sse42
	dh_auto_clean --builddir build_sse41
	dh_auto_clean --builddir build_ssse3
endif
	dh_auto_clean

override_dh_installexamples:
	mkdir $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/examples
	find tests/ -type f -print0 | xargs -0r sed -i \
		-e 's@$(CURDIR)@«buildpath»@g' \
		-e 's@\#! /bin/bash@\#! /bin/sh@g'
	tar --sort=name \
		--mtime="@${SOURCE_DATE_EPOCH}" \
		--owner=root --group=root --numeric-owner \
		--mode=go=rX,u+rw,a-s \
		--exclude='*/align.log' \
		--exclude='*/Makefile' \
		--exclude='*/Makefile.in' \
		-cJf $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/examples/tests.tar.xz  tests