debugging release, attempt to fix and print intermediate results

This commit is contained in:
Brad Bell 2013-01-04 21:32:36 -07:00
commit e42b4445a1

View file

@ -10,7 +10,7 @@
Name: cppad
Version: 20130000.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc
# Only noarch.rpms provided.
@ -65,6 +65,38 @@ as a single web page, in both HTML and XML, can be found at that web site.
%setup -q
includedir=%{buildroot}%{_includedir}
# patch epsilon.cpp in a way that may fix problem and that will
# print debugging information.
cat << EOF > epsilon.patch
46,56c46,58
< { bool ok = true;
< using CppAD::epsilon;
< using CppAD::abs;
< Type eps = CppAD::epsilon<Type>();
< Type one = 1;
< Type two = 2;
< Type eps2 = eps / two;
< Type check = add_one(eps);
< ok &= one != check;
< check = add_one(eps2);
< ok &= one == check;
---
> { bool ok = true;
> static size_t count = 0;
> CppAD::vector<Type> eps(1), one(1), two(1), eps2(1), check(1);
> eps[0] = CppAD::epsilon<Type>();
> one[0] = 1;
> two[0] = 2;
> eps2[0] = eps[0] / two[0];
> check[0] = add_one(eps[0]);
> ok &= one[0] != check[0];
> std::cout << "count = " << count++ << ", ok = " << ok << std::endl;
> check[0] = add_one(eps2[0]);
> ok &= one[0] == check[0];
> std::cout << "count = " << count++ << ", ok = " << ok << std::endl;
EOF
patch test_more/epsilon.cpp epsilon.patch
# Replace cppad_SOURCE_DIR by the system include directory so that
# installed files, instead of local files, are used for testing.
sed \
@ -121,6 +153,10 @@ rm -rf %{buildroot}
# ----------------------------------------------------------------------------
%changelog
* Fri Jan 04 2013 Brad Bell <bradbell at seanet dot com> - 20130000.0-2
- Debugging build to try to understand failure of test_more/epsilon.cpp
- on a remote machine that I do not have access to.
* Fri Jan 04 2013 Brad Bell <bradbell at seanet dot com> - 20130000.0-1
- Advance to version 2013 of cppad.
- Remove old patches that are no longer necessary.