1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
DEB_VERSION := $(shell dpkg-parsechangelog -S Version)
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
export HYPRE_SOVERSION=$(DEB_UPSTREAM_VERSION)
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -O3
export DEB_CXXFLAGS_MAINT_APPEND = -Wall -pedantic -O3
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
%:
dh $@ --sourcedirectory=src --with autoreconf
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
extra_flags += \
--with-fei --with-mli \
--with-superlu --with-superlu-include=/usr/include/superlu --with-superlu-lib="-lsuperlu" \
--with-dsuperlu --with-dsuperlu-include=/usr/include/superlu-dist --with-dsuperlu-lib="-lsuperlu_dist" \
--with-blas --with-blas-lib="-lblas" \
--with-lapack-libs="lapack" --with-lapack-lib-dirs="/usr/lib/lapack" --with-fmangle-lapack="one-underscore" \
--with-MPI-include=$(shell pkg-config --cflags-only-I mpi | awk '{print $$1}' | sed "s/^-I//") \
--with-MPI-libs="$(shell pkg-config --libs-only-l mpi | sed 's/-l//g')" \
--with-MPI-lib-dirs="$(shell pkg-config --libs-only-L mpi | sed 's/-L//g')" \
--with-MPI-flags="$(shell pkg-config --libs-only-other mpi)" \
--with-extra-flags="($shell pkg-config --cflags-only-other mpi)" \
--prefix=$(CURDIR)/debian/tmp/usr
export OMPI_MCA_orte_rsh_agent=/bin/false
override_dh_auto_clean:
echo "Running clean"
rm -rf $(CURDIR)/debian/tmp
rm -f src/configure.in
rm -f src/config.log
rm -f src/config/config.guess
rm -f src/config/config.sub
cd src/test; \
for TEST in TEST_*; do \
rm -f $${TEST}.stdout $${TEST}.stderr; \
done
-dh_auto_clean
override_dh_autoreconf:
cp /usr/share/misc/config.* src/config/
cd src && ./config/bootstrap
override_dh_auto_configure:
dh_auto_configure -- $(extra_flags) --enable-shared
ARCH_NO_TEST_LIST = armel ia64
empty :=
space := $(empty)$(empty)
RUNTEST=yes
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(ARCH_NO_TEST_LIST)$(space)))
RUNTEST=no
endif
override_dh_auto_test:
set -e; \
if [ "$(RUNTEST)" = "no" ]; then \
echo Tests have been disabled on $(DEB_HOST_ARCH); \
else echo "Building tests"; \
$(MAKE) -C src test VERBOSE=1; \
echo "Running tests"; \
set -e; \
export LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH):$(LD_LIBRARY_PATH); \
cd src/test; \
test_return="ok"; \
for TEST in TEST_*; do \
echo -n "running $${TEST} ... "; \
if ./runtest.sh -t $${TEST}/*.sh >$${TEST}.stdout 2>$${TEST}.stderr ; then \
echo ok; \
else \
test_return=$$?; \
echo "error found with error code $${test_return}"; \
echo "===== error logs for $${TEST} ====="; \
echo "$${TEST} stdout:"; \
cat $${TEST}.stdout; \
echo "$${TEST} stderr:"; \
cat $${TEST}.stderr; \
echo "===== end error logs for $${TEST} with error code $${test_return} ====="; \
fi; \
done; \
if [ $${test_return} != "ok" ]; then \
echo "Tests failed with last error code $${test_return}"; \
return $${test_return}; \
fi; \
fi
override_dh_install:
dh_install -p libhypre-$(HYPRE_SOVERSION) usr/lib/*/*${HYPRE_SOVERSION}.so
dh_install -p libhypre-dev --exclude=${HYPRE_SOVERSION} usr/lib/*/*
dh_install -p libhypre-dev usr/include/hypre
|