#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS+=optimize=-lto include /usr/share/dpkg/architecture.mk OPM_DEBIAN_CMAKE_FLAGS = -DOPM_ENABLE_PYTHON=1 -DOPM_INSTALL_PYTHON=1 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DOPM_INSTALL_COMPILED_PYTHON=OFF -DOPM_ENABLE_PYTHON_TESTS=0 -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON OPM_DEBIAN_MK ?= /usr/share/opm/opm-debian.mk ifneq ("$(wildcard $(OPM_DEBIAN_MK))","") include $(OPM_DEBIAN_MK) endif OPM_LIB_DEBIAN_MK ?= /usr/share/opm/opm-lib-debian.mk ifneq ("$(wildcard $(OPM_LIB_DEBIAN_MK))","") include $(OPM_LIB_DEBIAN_MK) # for makeshlibs endif # require 7GB of RAM per make process. Yes, peak seems to be above 6 GB currently need_gb_ram_per_process=7 free_ram=$(shell free -g | sed -n 2p| sed "s/ \+/ /g"| cut -d " " -f 2) max_procs=$(shell echo "$(free_ram)/$(need_gb_ram_per_process)" | bc) parallel_procs=$(shell if test "$(max_procs)" -lt "1"; then echo 1; else echo "$(max_procs)"; fi) override_dh_install: # Manually delete runpath set by openmpi 5.0.5 # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085509 find debian/tmp/ \( -name \*.so -o -name \*.so.\* \) -print || true find debian/tmp/ \( -name \*.so -o -name \*.so.\* \) -exec chrpath -d '{}' \; || true find debian/tmp/usr/bin -type f -exec chrpath -d '{}' \; || true dh_install %: echo "ram in gb: $(free_ram), needed ram per thread: $(need_gb_ram_per_process), threads: $(parallel_procs)" dh $@ --max-parallel=$(parallel_procs)