From 8b75021c27b87e74505f2f5dc5d99868a38cd6a1 Mon Sep 17 00:00:00 2001
From: Christoph Groth <christoph.groth@cea.fr>
Date: Fri, 6 Sep 2013 00:36:18 +0200
Subject: [PATCH] fix failing test with OpenBLAS

---
 INSTALL                             | 25 ++++---------------------
 kwant/solvers/tests/_test_sparse.py |  2 +-
 2 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/INSTALL b/INSTALL
index 4d3fa36..98ffd65 100644
--- a/INSTALL
+++ b/INSTALL
@@ -222,10 +222,10 @@ Unix-like systems (Linux)
 -------------------------
 
 Kwant should run on all recent Unix-like systems.  The following instructions
-have been verified to work on Debian 6 (Squeeze) or newer, and on Ubuntu 12.04
-(see :ref:`Note <ubuntu-problem>` below) or newer.  For other distributions step
-1 will likely have to be adapted.  If Ubuntu-style ``sudo`` is not available,
-the respective command must be run as root.
+have been verified to work on Debian 7 (Wheezy) or newer, and on Ubuntu 12.04 or
+newer.  For other distributions step 1 will likely have to be adapted.  If
+Ubuntu-style ``sudo`` is not available, the respective command must be run as
+root.
 
 1. Install the required packages.  On Debian-based systems like Ubuntu this can
    be done by running the command ::
@@ -261,23 +261,6 @@ You can make this setting permanent by adding this line to the file
 ``.bashrc`` (or equivalent) in your home directory.
 
 
-.. _ubuntu-problem:
-
-Known problem on Ubuntu 12.04 32-bit (i486)
-...........................................
-
-With Ubuntu 12.04 running on 32-bit Intel architecture processors the following
-error has been observed when running the tests included with Kwant: "Arrays are
-not almost equal to 7 decimals".  That problem seems to be due to a bug in the
-OpenBLAS package included with that version of Ubuntu.  It can be worked-around
-by installing a different BLAS.  Execute the following shell commands::
-
-    sudo apt-get install libblas3gf
-    sudo update-alternatives --config libblas.so.3gf
-
-and select the "libblas.so.3gf" alternative when prompted by the second command.
-
-
 Mac OS X
 --------
 
diff --git a/kwant/solvers/tests/_test_sparse.py b/kwant/solvers/tests/_test_sparse.py
index 1e62908..2970456 100644
--- a/kwant/solvers/tests/_test_sparse.py
+++ b/kwant/solvers/tests/_test_sparse.py
@@ -63,7 +63,7 @@ def test_output(smatrix):
     s2, modes2 = result2.data, result2.lead_info
     assert s2.shape == (len(modes2[1].momenta) // 2,
                         len(modes2[0].momenta) // 2)
-    assert_almost_equal(s1, s2)
+    assert_almost_equal(abs(s1), abs(s2))
     assert_almost_equal(np.dot(s.T.conj(), s),
                         np.identity(s.shape[0]))
     assert_raises(ValueError, smatrix, fsys, out_leads=[])
-- 
GitLab