| 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 -DROCPRIM_NO_DEPRECATION_WARNINGS |
| 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 |
CMAKE_FLAGS = \ |
| 13 |
-DCMAKE_BUILD_TYPE=Release \ |
| 14 |
-DCMAKE_SKIP_RPATH=ON \ |
| 15 |
-DCMAKE_INSTALL_LIBDIR=lib \ |
| 16 |
-DGPU_TARGETS="$(shell rocm-target-arch --sep ';')" \ |
| 17 |
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF |
| 18 |
|
| 19 |
%: |
| 20 |
dh $@ -Scmake |
| 21 |
|
| 22 |
override_dh_auto_configure-arch: |
| 23 |
dh_auto_configure -- $(CMAKE_FLAGS) -DBUILD_TEST=ON |
| 24 |
|
| 25 |
override_dh_auto_configure-indep: |
| 26 |
dh_auto_configure -- $(CMAKE_FLAGS) |
| 27 |
|
| 28 |
override_dh_auto_test-arch: |
| 29 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 30 |
set -e \ |
| 31 |
; if [ -r /dev/kfd ] \ |
| 32 |
; then dh_auto_test --no-parallel -- \ |
| 33 |
; else echo "W: /dev/kfd unreadable: no available AMD GPU." \ |
| 34 |
; echo "W: tests skipped." \ |
| 35 |
; fi |
| 36 |
endif |
| 37 |
|
| 38 |
override_dh_auto_test-indep: |
| 39 |
: |
| 40 |
|
| 41 |
execute_before_dh_install-arch: |
| 42 |
: |
| 43 |
|
| 44 |
override_dh_auto_install-indep: |
| 45 |
dh_auto_install --destdir=debian/tmp |
| 46 |
|
| 47 |
# dwz doesn't fully support DWARF-5 yet, see #1016936 |
| 48 |
override_dh_dwz: |
| 49 |
: |
| 50 |
|
| 51 |
override_dh_gencontrol: |
| 52 |
dh_gencontrol -- -Vrocm:GPU-Architecture="$(shell rocm-target-arch)" |