Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 export CXX=hipcc
3 export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
4 export DEB_CXXFLAGS_MAINT_PREPEND = -gz
5 export VERBOSE=1
6 #export AMD_LOG_LEVEL=4
7
8 # filter incompatible options from affecting device code
9 CXXFLAGS := $(subst -fstack-protector-strong,-Xarch_host -fstack-protector-strong,$(CXXFLAGS))
10 CXXFLAGS := $(subst -fcf-protection,-Xarch_host -fcf-protection,$(CXXFLAGS))
11
12 FEATURE_CHECK := $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON)
13 FEATURE_INSTTEST := $(if $(filter noinsttest,$(DEB_BUILD_PROFILES)),OFF,ON)
14
15 CMAKE_FLAGS = \
16 -DCMAKE_BUILD_TYPE=Release \
17 -DCMAKE_SKIP_INSTALL_RPATH=ON \
18 -DROCM_SYMLINK_LIBS=OFF \
19 -DAMDGPU_TARGETS="$(shell rocm-target-arch --sep ';')" \
20 -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
21 -DBUILD_TEST=$(or $(filter ON,$(FEATURE_CHECK)),$(filter ON,$(FEATURE_INSTTEST)),OFF) \
22 -DENABLE_INLINE_ASM=1
23
24 %:
25 dh $@
26
27 override_dh_auto_configure-arch:
28 dh_auto_configure -- $(CMAKE_FLAGS)
29
30 override_dh_auto_test-arch:
31 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
32 set -e \
33 ; if [ -r /dev/kfd ] \
34 ; then dh_auto_test --no-parallel -- \
35 ; else echo "W: /dev/kfd unreadable: no available AMD GPU." \
36 ; echo "W: tests skipped." \
37 ; fi
38 endif
39
40 execute_before_dh_install-arch:
41 :
42
43 override_dh_auto_configure-indep:
44 :
45
46 execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9
47 execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9
48 execute_after_dh_auto_build-indep:
49 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
50 rocm-docs-build
51 rm -rf build/html/_static/fonts
52 rm -rf build/html/_static/vendor
53 endif
54
55 override_dh_auto_test-indep:
56 :
57
58 override_dh_auto_install-indep:
59 :
60
61 # dwz doesn't fully support DWARF-5 yet, see #1016936
62 override_dh_dwz:
63 :
64
65 override_dh_gencontrol:
66 dh_gencontrol -- -Vrocm:GPU-Architecture="$(shell rocm-target-arch)"