#!/usr/bin/make -f export DH_VERBOSE=1 DPKG_EXPORT_BUILDFLAGS=1 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH) INCDIR:=/usr/include/$(DEB_HOST_MULTIARCH) INSTDIR:=$(CURDIR)/debian/tmp CMAKE_DIR:=$(INSTDIR)/$(LIBDIR)/cmake include /usr/share/debhelper/dh-fortran/fortran-support.mk FMODDIR:=$(call get_fmoddir,$(FC_DEFAULT)) DEB_CFLAGS_MAINT_APPEND= -I$(CURDIR)/src -I$(CURDIR)/debian/build/src -I$(CURDIR)/atlas_io/src DEB_CXXFLAGS_MAINT_APPEND= -I$(CURDIR)/src -I$(CURDIR)/debian/build/src -I$(CURDIR)/atlas_io/src -I$(CURDIR)/debian/build/hic/src DEB_FFLAGS_MAINT_APPEND= -I$(FMODDIR) include /usr/share/dpkg/pkg-info.mk include /usr/share/dpkg/buildflags.mk CXXFLAGS = $(DEB_CXXFLAGS_MAINT_APPEND) export CXXFLAGS # Strange bug with omp.h headers and clang-tidy on some archs ARCH_CLANG_TIDY_OFF:= s390x mipsel ENABLE_CLANG_TIDY:= $(if $(filter $(DEB_TARGET_ARCH), $(ARCH_CLANG_TIDY_OFF)),Off,On) # Override in 0.27.0 build - causes failures on mixed g++/clang environments ENABLE_CLANG_TIDY:= Off # OMP Doesn't appear to work on these archs ARCH_NO_OMP:= riscv64 sparc64 ENABLE_OMP:= $(if $(filter $(DEB_TARGET_ARCH), $(ARCH_NO_OMP)),Off,On) BUILD_FLAGS = \ -DENABLE_DOCS=On \ -DENABLE_CXX17=On \ -DENABLE_CLANG_TIDY=$(ENABLE_CLANG_TIDY) \ -DENABLE_GRIDTOOLS_STORAGE=Off \ -DENABLE_ACC=Off \ -DENABLE_TESSELATION=On \ -DENABLE_CGAL=On \ -DENABLE_ECTRANS=On \ -DENABLE_OMP=$(ENABLE_OMP) \ -DENABLE_FORTRAN=On \ -Datlas_FULL_INSTALL_CMAKE_DIR=$(LIBDIR)/cmake/atlas_ecmwf \ -DENABLE_INIT_SNAN=On \ -DENABLE_ECKIT_CODEC=Off \ -DENABLE_PROJ=On # Test suite requires 4 processors. Fake it export OMPI_MCA_rmaps_base_oversubscribe=1 %: dh $@ --buildsystem=ecbuild --builddir=debian/build --with fortran_mod override_dh_auto_configure: dh_auto_configure -- ${BUILD_FLAGS} override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) #LD_LIBRARY_PATH=$(CURDIR)/debian/build/lib dh_auto_test echo "Ignore tests this build" endif override_dh_auto_install: dh_auto_install mkdir -p $(INSTDIR)/$(LIBDIR)/pkgconfig chrpath -d $(INSTDIR)/usr/bin/* chrpath -d $(INSTDIR)/$(LIBDIR)/*.so* # rename mv $(CMAKE_DIR)/atlas $(CMAKE_DIR)/atlas_ecmwf #for d in atlas-config.cmake atlas-config-version.cmake atlas-import.cmake atlas-targets.cmake atlas-targets-release.cmake ; do \ # n=`echo $$d | sed -e 's/atlas/atlas_ecmwf/' ` ; \ # mv $(CMAKE_DIR)/atlas_ecmwf/$$d $(CMAKE_DIR)/atlas_ecmwf/$$n ; done # Fix broken paths sed -i -e 's%$${CURDIR}%/build/atlas-ecmwf%g' \ -e 's%/cmake/atlas"%/cmake/atlas_ecmwf"%g' \ -e 's%atlas-%atlas_ecmwf-%g' $(CMAKE_DIR)/atlas_ecmwf/atlas-config.cmake sed -i -e 's%/cmake/atlas"%/cmake/atlas_ecmwf"%g' \ -e 's%$${CURDIR}%/build/atlas-ecmwf%g' \ -e 's%atlas-targets%atlas_ecmwf-targets%g' \ -e 's%include/atlas%include/${DEB_HOST_MULTIARCH}/atlas%g' $(CMAKE_DIR)/atlas_ecmwf/atlas-targets.cmake