#!/usr/bin/make -f DH_OPTIONS=-Bbuild source=$(shell dpkg-parsechangelog -S Source) # This is the current default version, which we may have to conflict against DEFAULT_GCC_VERSION := 6 # This is the version we want to build starpu against (may have to change # according to plugin support) GCC_VERSION := 6 # This is the best version that nvcc supports. CONTRIB_GCC_VERSION := 5 ifeq ($(source),starpu) #CC=gcc-$(GCC_VERSION) #CXX=g++-$(GCC_VERSION) #F77=gfortran-$(GCC_VERSION) else # nvcc sometimes chokes on some gcc features CC=gcc-$(CONTRIB_GCC_VERSION) CXX=g++-$(CONTRIB_GCC_VERSION) F77=gfortran-$(CONTRIB_GCC_VERSION) endif OMPI_CC=$(CC) export CC export CXX export F77 export OMPI_CC V=1 export V %: dh $@ --parallel $(DH_OPTIONS) --with autoreconf override_dh_auto_configure: dh_auto_configure $(DH_OPTIONS) -- --enable-opengl-render \ --with-qwt-include-dir=/usr/include/qwt-qt4 \ --with-qwt-lib=qwt-qt4 --enable-openmp --enable-quick-check override_dh_auto_test: -HOME=$$PWD DISPLAY= DEB_BUILD_OPTIONS=$(patsubst parallel=%,,$(DEB_BUILD_OPTIONS)) dh_auto_test $(DH_OPTIONS) $(MAKE) -C build showcheck #ifeq ($(source),starpu) #override_dh_install: # dh_install usr/lib/starpu/*/gcc/*/*.so* /usr/lib/gcc/$(DEB_HOST_MULTIARCH)/$(GCC_VERSION)/plugin #endif override_dh_auto_clean: dh_auto_clean $(DH_OPTIONS) rm -fr doc/doxygen/starpu.pdf rm -fr doc/doxygen/html rm -fr .starpu rm -f starpu-top/StarPU-Top rm -fr .nv # This is required by the gcc plugin infrastructure #GCC_DEBIAN_VERSION := $(shell dpkg-query -f '$${Version}' -W $(CC)) #GCC_UPSTREAM_VERSION := $(firstword $(subst -, ,$(GCC_DEBIAN_VERSION))) #override_dh_gencontrol: # dh_gencontrol -- -VgccDeps='$(CC) (>= $(GCC_DEBIAN_VERSION)), $(CC) (<< $(GCC_UPSTREAM_VERSION)A)' # Switch to main rules main: sed -i '1s/^starpu-contrib/starpu/' debian/changelog sed -i '1s/^Source: starpu-contrib/Source: starpu/' debian/control sed -i 's/Package: libstarpu-contrib/Package: libstarpu/' debian/control sed -i 's/Package: starpu-contrib/Package: starpu/' debian/control sed -i 's/Package: libsocl-contrib/Package: libsocl/' debian/control sed -i '/Depends/s/ libstarpu-contrib/ libstarpu/g' debian/control sed -i 's/Conflicts: libstarpu/Conflicts: libstarpu-contrib/' debian/control sed -i 's/Conflicts: libsocl/Conflicts: libsocl-contrib/' debian/control sed -i 's/Conflicts: starpu/Conflicts: starpu-contrib/' debian/control sed -i 's/^Provides:/#Provides:/' debian/control #sed -i 's/# gcc-$(GCC_VERSION), g++-$(GCC_VERSION), gfortran-$(GCC_VERSION), gcc-$(GCC_VERSION)-plugin-dev, gcc,$$/ gcc-$(GCC_VERSION), g++-$(GCC_VERSION), gfortran-$(GCC_VERSION), gcc-$(GCC_VERSION)-plugin-dev, gcc,/' debian/control sed -i 's/^ gcc-$(CONTRIB_GCC_VERSION), g++-$(CONTRIB_GCC_VERSION), gfortran-$(CONTRIB_GCC_VERSION), gcc-$(CONTRIB_GCC_VERSION)-plugin-dev,$$/# gcc-$(CONTRIB_GCC_VERSION), g++-$(CONTRIB_GCC_VERSION), gfortran-$(CONTRIB_GCC_VERSION), gcc-$(CONTRIB_GCC_VERSION)-plugin-dev,/' debian/control sed -i 's/^ nvidia-cuda-toolkit,/# nvidia-cuda-toolkit,/' debian/control #sed -i 's/^Build-Conflicts: gcc-$(DEFAULT_GCC_VERSION), g++-$(DEFAULT_GCC_VERSION)/#Build-Conflicts: gcc-$(DEFAULT_GCC_VERSION), g++-$(DEFAULT_GCC_VERSION)/' debian/control sed -i 's_^Section: contrib/_Section: _' debian/control sed -i 's/contrib-contrib/contrib/g' debian/control debian/changelog sed -i '/starpu-top/,/starpu-examples/s/^#//' debian/control # Switch to contrib rules contrib: sed -i '/starpu-top/,/^$$/s/^/#/' debian/control sed -i '1s/^starpu /starpu-contrib /' debian/changelog sed -i '1s/^Source: starpu/Source: starpu-contrib/' debian/control sed -i 's/Package: libstarpu/Package: libstarpu-contrib/' debian/control sed -i 's/Package: starpu/Package: starpu-contrib/' debian/control sed -i 's/Package: libsocl/Package: libsocl-contrib/' debian/control sed -i '/Depends/s/ libstarpu/ libstarpu-contrib/g' debian/control sed -i 's/Conflicts: libstarpu-contrib/Conflicts: libstarpu/' debian/control sed -i 's/Conflicts: libsocl-contrib/Conflicts: libsocl/' debian/control sed -i 's/Conflicts: starpu-contrib/Conflicts: starpu/' debian/control sed -i 's/^#Provides:/Provides:/' debian/control #sed -i 's/^ gcc-$(GCC_VERSION), g++-$(GCC_VERSION), gfortran-$(GCC_VERSION), gcc-$(GCC_VERSION)-plugin-dev, gcc,$$/# gcc-$(GCC_VERSION), g++-$(GCC_VERSION), gfortran-$(GCC_VERSION), gcc-$(GCC_VERSION)-plugin-dev, gcc,/' debian/control sed -i 's/# gcc-$(CONTRIB_GCC_VERSION), g++-$(CONTRIB_GCC_VERSION), gfortran-$(CONTRIB_GCC_VERSION), gcc-$(CONTRIB_GCC_VERSION)-plugin-dev,$$/ gcc-$(CONTRIB_GCC_VERSION), g++-$(CONTRIB_GCC_VERSION), gfortran-$(CONTRIB_GCC_VERSION), gcc-$(CONTRIB_GCC_VERSION)-plugin-dev,/' debian/control sed -i 's/# nvidia-cuda-toolkit,/ nvidia-cuda-toolkit,/' debian/control #sed -i 's/^#Build-Conflicts: gcc-$(DEFAULT_GCC_VERSION), g++-$(DEFAULT_GCC_VERSION)/Build-Conflicts: gcc-$(DEFAULT_GCC_VERSION), g++-$(DEFAULT_GCC_VERSION)/' debian/control sed -i 's_contrib/contrib/_contrib_g' debian/control debian/control sed -i 's/contrib-contrib/contrib/g' debian/control debian/changelog sed -i 's_^Section: \([^/]*\)$$_Section: contrib/\1_' debian/control