[Debian-astro-commits] [gyoto] 01/01: gyoto (1.1.1-3+lorene4) experimental; urgency=medium

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Tue Nov 29 15:38:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch lorene
in repository gyoto.

commit f197047536921868d602a07466db46d403c3913e
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Tue Nov 29 16:31:23 2016 +0100

    gyoto (1.1.1-3+lorene4) experimental; urgency=medium
    
      * Instead of patching Gyoto, patch the buggy Boost.multiprecision at
        build time.
    
     -- Thibaut Paumard <thibaut at debian.org>  Tue, 29 Nov 2016 11:22:58 +0100
---
 debian/boost.sha1sums                  |  1 +
 debian/changelog                       |  7 ++++++
 debian/patches/acos-locking-workaround | 28 ------------------------
 debian/patches/no-fp-ilogb0            | 39 ++++++++++++++++++++++++++++++++++
 debian/patches/series                  |  1 -
 debian/rules                           | 20 +++++++++++------
 6 files changed, 61 insertions(+), 35 deletions(-)

diff --git a/debian/boost.sha1sums b/debian/boost.sha1sums
new file mode 100644
index 0000000..ab8d7fa
--- /dev/null
+++ b/debian/boost.sha1sums
@@ -0,0 +1 @@
+49bae84b737b9a9d79353a0230f4782b86536828  /usr/include/boost/multiprecision/detail/functions/trig.hpp
diff --git a/debian/changelog b/debian/changelog
index 2c93593..d0a3ea6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+gyoto (1.1.1-3+lorene4) experimental; urgency=medium
+
+  * Instead of patching Gyoto, patch the buggy Boost.multiprecision at
+    build time.
+
+ -- Thibaut Paumard <thibaut at debian.org>  Tue, 29 Nov 2016 11:22:58 +0100
+
 gyoto (1.1.1-3+lorene3) experimental; urgency=high
 
   * Rebuild with new lorene.
diff --git a/debian/patches/acos-locking-workaround b/debian/patches/acos-locking-workaround
deleted file mode 100644
index e6b6680..0000000
--- a/debian/patches/acos-locking-workaround
+++ /dev/null
@@ -1,28 +0,0 @@
-Description: work around Boost.multiprecision acos() locking
- Since boost1.62, acos() locks in Screen.C on some architectures when
- delta100 is 0. Single-case this.
-Author: Thibaut Paumard
-Origin: vendor
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844490
-Forwarded: yes
-Last-Update: 2016-11-17
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/lib/Screen.C
-+++ b/lib/Screen.C
-@@ -561,6 +561,15 @@
- 
- #ifdef HAVE_BOOST_MULTIPRECISION_CPP_DEC_FLOAT_HPP
-     // using boost multiprecision to avoid information loss in trigonometry
-+# ifdef GYOTO_ACOS_LOCKING_WORKAROUND
-+    if (delta==0) {
-+      spherical_angle_a=abs(alpha);
-+      spherical_angle_b=0.;
-+    } else if (alpha==0) {
-+      spherical_angle_a=abs(delta);
-+      spherical_angle_b=((delta >= 0) - (delta < 0))*M_PI*0.5;
-+    } else
-+# endif
-     {
-       boost::multiprecision::cpp_dec_float_100
- 	alpha100=alpha, delta100=delta, a, b;
diff --git a/debian/patches/no-fp-ilogb0 b/debian/patches/no-fp-ilogb0
new file mode 100644
index 0000000..12680c8
--- /dev/null
+++ b/debian/patches/no-fp-ilogb0
@@ -0,0 +1,39 @@
+Description: fix infinite loop in Boost.multiprecision
+ Multiprecision acos(), asin() and atan() sometimes loop infinitely when
+ they should converge exactly because of the way the distance between the
+ current and target value is compared to zero.
+Author: Thibaut Paumard <thibaut at debian.org>
+Origin: vendor
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844495
+Forwarded: no
+Last-Update: 2016-11-25
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: boost1.62-1.62.0+dfsg/boost/multiprecision/detail/functions/trig.hpp
+===================================================================
+--- boost1.62-1.62.0+dfsg.orig/boost/multiprecision/detail/functions/trig.hpp
++++ boost1.62-1.62.0+dfsg/boost/multiprecision/detail/functions/trig.hpp
+@@ -515,10 +515,8 @@ void eval_asin(T& result, const T& x)
+       eval_divide(sine, cosine);
+       eval_subtract(result, sine);
+       current_precision = eval_ilogb(sine);
+-#ifdef FP_ILOGB0
+-      if(current_precision == FP_ILOGB0)
++      if(sine.iszero())
+          break;
+-#endif
+    }
+    if(b_neg)
+       result.negate();
+@@ -662,10 +660,8 @@ void eval_atan(T& result, const T& x)
+       eval_multiply(s, t, c);
+       eval_add(result, s);
+       current_precision = eval_ilogb(s);
+-#ifdef FP_ILOGB0
+-      if(current_precision == FP_ILOGB0)
++      if(s.iszero())
+          break;
+-#endif
+    }
+    if(b_neg)
+       result.negate();
diff --git a/debian/patches/series b/debian/patches/series
index 2746fff..b8c491c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 interpreter-path
-acos-locking-workaround
diff --git a/debian/rules b/debian/rules
index 46f0c54..269c9dd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,10 +12,7 @@ DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 DPKG_EXPORT_BUILDFLAGS = 1
 -include /usr/share/dpkg/buildflags.mk
-
-#ifneq (,$(filter $(DEB_HOST_ARCH), arm64 armel armhf mips64el mipsel ppc64el s390x powerpc ppc64))
-CPPFLAGS += -DGYOTO_ACOS_LOCKING_WORKAROUND
-#endif
+CPPFLAGS += -I$(CURDIR)/debian/include
 
 # Don't accidentally build the lorene plug-in
 unexport HOME_LORENE
@@ -90,6 +87,16 @@ override_dh_auto_build-indep:
 	$(MAKE) doc
 
 override_dh_auto_configure:
+	if sha1sum -c debian/boost.sha1sums; then \
+		mkdir -p debian/include/boost/multiprecision/detail/functions/;\
+		cp /usr/include/boost/multiprecision/detail/functions/trig.hpp \
+			debian/include/boost/multiprecision/detail/functions/;\
+		cd debian/include; \
+		patch -p1 < ../patches/no-fp-ilogb0;\
+		echo "************ Patching Boost.multiprecision ************";\
+	else \
+		echo "********** NOT Patching Boost.multiprecision **********";\
+	fi
 	dh_auto_configure -- $(configure_flags)
 	sed -i 's|^CXX=.*|CXX=$(CXX)|' lib/gyoto.pc
 
@@ -98,7 +105,7 @@ override_dh_makeshlibs:
 
 override_dh_auto_clean:
 	[ ! -f python/Makefile ] || make -C python clean
-	rm -Rf python-plugins
+	rm -Rf python-plugins debian/include
 	dh_auto_clean
 
 override_dh_auto_test-indep:
@@ -106,7 +113,8 @@ override_dh_auto_test-indep:
 override_dh_auto_test-arch:
 ifeq (,$(filter $(DEB_HOST_ARCH), mips))
 # skip on mips as lucatelli2 fails on it (but the binary works on other boxes)
-	LC_ALL=C.UTF-8 dh_auto_test -- check-lorene CHECK_RAW_CMD="./gyoto -pstdplug -r101 -T8 -P0"
+	$(MAKE) -C bin CHECK_RAW_CMD="./gyoto -pstdplug -r101 --ispec=51:51:1 -T1 -P0" check
+	LC_ALL=C.UTF-8 dh_auto_test -- check-lorene
 endif
 
 override_dh_strip:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list