#!/usr/bin/make -f export CXX=/usr/bin/clang++-22 export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto export DEB_CXXFLAGS_MAINT_PREPEND = -gz export VERBOSE=1 # -Wl,--gc-sections: # Fixes linker errors ("relocation refers to a discarded section") when using gtest. # The linker's section garbage collection incorrectly discards needed code due to # a toolchain mismatch (ROCm's clang vs. the system's GCC). This flag forces the # linker to correctly re-evaluate dependencies, keeping the required sections. export DEB_LDFLAGS_MAINT_PREPEND = -Wl,--gc-sections # filter incompatible options from affecting device code CXXFLAGS := $(subst -fstack-protector-strong,-Xarch_host -fstack-protector-strong,$(CXXFLAGS)) CXXFLAGS := $(subst -fcf-protection,-Xarch_host -fcf-protection,$(CXXFLAGS)) NUM_THREADS = 1 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUM_THREADS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif CMAKE_FLAGS = \ -DCMAKE_BUILD_TYPE=Release \ -DROCM_SYMLINK_LIBS=OFF \ -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \ -DMIOPEN_USE_MLIR=OFF \ -DMIOPEN_BUILD_DRIVER=ON \ -DMIOPEN_ENABLE_FIN=OFF \ -DMIOPEN_STRIP_SYMBOLS=OFF \ -DMIOPEN_BACKEND=HIP \ -DBoost_USE_STATIC_LIBS=OFF # Those 2 next are going together both ON or both OFF # This result in disabling both until HIPRTC is configurable TODO: CMAKE_FLAGS += \ -DMIOPEN_USE_HIPRTC=ON \ -DMIOPEN_USE_COMGR=ON # From TheRock build/logs/MIOpen_configure.log CMAKE_FLAGS += \ -DHIP_PLATFORM=amd \ -DBUILD_TESTING=ON \ -DMIOPEN_USE_COMPOSABLEKERNEL=OFF \ -DMIOPEN_TEST_DISCRETE=OFF # Hack for half ... see override_dh_auto_configure CMAKE_FLAGS += \ -DHALF_INCLUDE_DIR=$(CURDIR)/debian # Update requirement For 7.2.4 CMAKE_FLAGS += \ -DMIOPEN_USE_HIPBLASLT=OFF \ -DHIP_OC_COMPILER=/usr/bin/clang-22 # Manually set the system DB path to the correct location due to # use of patch 0005-fix-system-db-path-for-multiarch.patch MIOPEN_DB_PATH := /usr/share/miopen/db CMAKE_FLAGS += \ -DMIOPEN_SYSTEM_DB_PATH=$(MIOPEN_DB_PATH) \ -DDATABASE_INSTALL_DIR=$(MIOPEN_DB_PATH) # -DMIOPEN_DEBUG_GCN_ASM_KERNELS=OFF %: dh $@ -Scmake --builddirectory=build override_dh_auto_configure-arch: [ -d $(CURDIR)/debian/half ] || mkdir debian/half [ -L $(CURDIR)/debian/half/half.hpp ] || ln -s /usr/include/half.hpp $(CURDIR)/debian/half/half.hpp # Convert .tn.model files for new upstream dependency version python3 $(CURDIR)/debian/bin/convert_tn_models.py $(CURDIR)/src/kernels/*.tn.model dh_auto_configure -- $(CMAKE_FLAGS) override_dh_auto_build-indep: : override_dh_auto_configure-indep: : execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9 execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9 execute_after_dh_auto_build-indep: ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) rocm-docs-build rm -rf build/html/_static/fonts rm -rf build/html/_static/vendor rm -f build/html/doxygen/html/jquery.js endif override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) set -e \ ; if [ -r /dev/kfd ] \ ; then echo "W: No tests." \ ; else echo "W: /dev/kfd unreadable: no available AMD GPU." \ ; echo "W: tests skipped." \ ; fi endif # dwz doesn't fully support DWARF-5 yet, see #1016936 override_dh_dwz: : # Set dh_makeshlibs to fail level 4 override_dh_makeshlibs: dh_makeshlibs -V -plibmiopen1 -- -c4