New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arpack tests fail when installed on mac os x #2547
Comments
I actually found a workaround by using openblas (a bit slower is better than wrong IMO): First make sure you have a gfortran version >= 4.7: Then run:
As mentioned in samueljohn/homebrew-python#12 no one wants to be responsible for these errors... |
It's not "doesn't want to be responsible", it's simply quite hard to solve. Duplicate of gh-2372, so closing. |
@rgommers i'm quite sure this isn't a dup of that, i'm running on mac os x and afaik it uses Accelerate.framework in LAPACK. Also i seem to judge the severity of this a bit different: Many of my researcher colleagues use macs and all of whom I asked to run the scipy test were surprised that these tests fail. I'm not 100 % sure how bad the errors actually are, but i get a bad feeling that many scientific publications could depend on this and never notice the errors. What i suggest is not hard to solve: i suggested that scipy should check and notify the users if the wrong library is used which is known to cause problems. You point out yourself that not using Accelerate and llvm is the best in your opinion ( samueljohn/homebrew-python#12 ). Why not check for it? |
Yes, disabling support for Accelerate completely could be sensible until this is resolved. |
Sorry about linking the wrong ticket. It is a duplicate of gh-2256 as well as gh-2248. I'm not sure about disabling Accelerate support - it will create a lot of build issues and a flood of ticket / complaints on the mailing list. Disabling this part of ARPACK functionality (everywhere or only on OS X?) is probably a better alternative. AFAIK it's only single precision that has a problem and that's not widely used. I suggest continuing this discussion on gh-2248; I'll add that to the 0.13.0 Milestone so we can't just forget about this. Closing again as duplicate. |
@rgommers: I meant that we disable also Veclib/Accelerate detection. This is certainly doable. The problem is that the "part of ARPACK functionality" in question is not precisely defined. It's not even only single precision, also apparently double precision fails (see 'd' in the above tests). |
I understood that that's what you meant. It's doable, but will create lots of issues for users. We'll be disabling the only BLAS/LAPACK shipped with the OS, forcing users to hunt for other binaries (which may have their own issues) or install a BLAS/LAPACK from source (very much nontrivial). So it's not a decision to take lightly. OpenBLAS support in numpy.distutils is still shaky by the way: http://thread.gmane.org/gmane.comp.python.numeric.general/53541/focus=53547 |
You're right by the way, missed the |
It's well-defined enough - disable everything that's failing on OS X 10.8 right now. |
I think disabling is not a satisfactory solution, because: the tests show that something fails, we do not understand why. However, they do not show that the parts for which the tests pass function correctly, rather, they show they work in some test cases. It will also break portability of Scipy code across platforms. Moreover, the situation has apparently got worse with new OSX versions, as previously it used to be so that the problems were restricted to single precision. Next version of OSX --- more problems? |
Could be that OS X 10.9 has even more issues, we'll find out soon enough. There's also the I'm going to try one more time: all test failures are in the generalized-symmetric support, as added in gh-25. It was added for 0.10.0, and started given issues soon after. Disabling generalized-symmetric support (a feature used by a tiny fraction of users) either on OS X or on all platforms would be a lower-impact change than completely removing support for Accelerate. @jakevdp @cournape any opinion on this? Time to have a go at fixing it? I believe you both have an OS X 10.8 system:) |
I hate to admit it, but I still haven't been able to successfully build scipy from source on my mac. I use macports there, and have been doing all my scipy development work on my old linux machine Regarding generalized eigenvalue problems... I'd hate to completely remove it, because it works fine on most systems and there is probably someone out there who finds it useful. What if we move it to a category along the lines of "unsupported and untested: use at your own peril"? Is there any precedent for that? |
I am still not convinced that disabling features solves the issue --- we may certainly get fewer test failures, but this is just hiding the issue. We know that some calls to Accelerate fails to give correct results. What we do not know is whether some of these calls are also made in the usual eigenproblem case, in code paths not hit by the simple set of test cases. Moreover, the problem is not limited to ARPACK --- remember that also scipy.linalg has had failures reported on OSX: http://scipy-user.10969.n7.nabble.com/Fwd-scipy-test-fails-for-0-11-0-on-OS-X-10-8-2-td4039.html Basically, anything in Scipy that calls certain LAPACK/BLAS routines (which?) is suspect, and we cannot just go removing these features. One possible fix is to go an try to plug all lapack FUNCTION calls even for double precision, as this is one place where the ABI incompatibility issue can come and bite. |
OK let's give it a try. Accelerate in numpy should be removed as well for the same reason then. Guess we'll need to write a good guide on how to compile with other BLAS/LAPACK libs and refer anyone who can't figure it out to HomeBrew. I'll bring it up on the mailing list - maybe that triggers someone on OS X 10.8 to have a go at fixing things. |
We have a hosted 10.8 Mac Mini for testing by the way. I'll set up some different lapacks there. I can create an account for you as well if you want. |
Yes --- actually, I think it's overall a bit dangerous that Numpy finds Accelerate/Veclib but does not provide compiler flags that ensure the correct Fortran ABI is used. Scipy can perhaps hack around this by avoiding FUNCTION calls, but this is not true for third-party modules that just want get_info('lapack_opt') |
I am a bit swamped at work ATM, but we can look at that during scipy conference. |
@rgommers i've summarized how to get scipy running from scratch here: http://joernhees.de/blog/2013/06/08/mac-os-x-10-8-scientific-python-with-homebrew/
That way all tests in scipy
and numpy
pass. Thanks to @samueljohn it should be fairly simple to extract the needed compile options. |
@joernhees: This is BTW likely an incompatible Fortran ABI issue, so recompiling with Macports includes the ff2c for Octave, which probably has similar problems. On OSX Scipy includes essentially a workaround similar to dotwrp, which worked OK for previous OSX versions, but something apparently changed on 10.8 (and 10.7?). |
Thanks @joernhees. @pv there's apparently also a new build issue with Accelerate (maybe came with OS X update), I've seen it reported in a couple of places now: |
Ok, I just managed to get the tests to fail on OSX 10.8.4 + clang + gfortran 4.2, when using ff2c. (@rgommers this is on the scipy test machine). Moreover, I isolated a pure-Fortran example that fails when linked with Arpack --- everyone can try this out: https://gist.github.com/pv/5873146 So the Fortran ABI issue is partly a red herring, there's a real bug somewhere either in ARPACK or in Accelerate. It seems the plan of action for Scipy should be to drop support for Accelerate. |
I tried to tease out an example as well but I think @pv did a better job of isolating the problem and I can confirm that the gist fails for me as well and that it is not fixed by |
Could one of you guys send a bug report to Apple, now that we have a reproducible Fortran-only test case? This issue affects everyone using ARPACK on OSX. (Also, I guess Apple has some recommended Fortran compiler, so maybe check with that too?) I don't use OSX, so I'd be happy if someone else does this. |
Just filed it. |
Macports users can also verify that the issue exists on the macports-packaged arpack, and if yes, complain to macports, too. |
The ARPACK bug report is here: http://forge.scilab.org/index.php/p/arpack-ng/issues/1259/ |
I added a pointer to the Apple bug report to that discussion. |
I heard back from Apple on this issue and they appear to have fixed the problem in a build of 10.9. I can confirm that the gist now provides the correct answer to the problem. Running tests on |
That is good news, finally. So for 10.9, we can build scipy with Accelerate again and for 10.8 switching to openblas? |
wow, that thanks so much for all the effort and even getting this fixed upstream |
I am hopeful, I will try to continue to test |
For 10.8, you can also apply the bug fix discussed in the Arpack bug report. This issue turned out to be a bug in Arpack, which however only manifested for certain Lapack versions (one of them being the one shipped with Accelerate). |
See discussion at http://forge.scilab.org/index.php/p/arpack-ng/issues/1259/ The Ritz vector purification step assumes workl(iq) still contains the original Q matrix. This is however overwritten by the call to xGEQR2 earlier. This patch fixes the issue by making a copy of the last row of the eigenvector matrix, after it is recomputed after QR by xORM2R. The work space WORKL(IW+NCV:IW+2*NCV) used for the TAU values of the QR decomposition is not used later in the routine, and can be used to store a copy of the last row. Fixes scipygh-2547 (provided you use -ff2c flag for compiling) Thanks to Michael Wimmer for tracing the issue.
gh-2684 merged. Thanks to @pv and @michaelwimmer for fixing this. |
Update: I added 0.13.0b1 to by tap and I can confirm that these issues are no longer reported (though I get an PIL related failure where it cannot use Though I notice that a lot of tests are skipped ( |
I ran into this problem several times already with different installation methods. This time i used brew to install scipy:
If you then run the tests the following errors occur: https://gist.github.com/joernhees/5733199
A shortened version here:
The text was updated successfully, but these errors were encountered: