Skip to content
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

OpenBLAS/LAPACKE build fails on Haswell #59

Closed
tapeinosyne opened this issue Jan 17, 2014 · 2 comments
Closed

OpenBLAS/LAPACKE build fails on Haswell #59

tapeinosyne opened this issue Jan 17, 2014 · 2 comments

Comments

@tapeinosyne
Copy link

I incurred in a slightly contorted series of problems installing Julia on a Haswell machine running Mavericks. There seemed to be no difference between 64-bit and 32-bit mode. (This also affects builds straight from JuliaLang/julia. I opened the issue here because I was able to find a simple workaround that works well with brew.)

Here is what happens when I try to use the Julia tap. With a straight brew install julia, the build fails because the linked version of OpenBLAS can't detect the CPU. (See OpenBLAS #332.)

make: *** [getarch_2nd] Error 1
Makefile:127: *** OpenBLAS: Detecting CPU failed.

Fair enough. Since Haswell detection and optimization are included in OpenBLAS develop, I can brew install openblas-julia --HEAD before Julia and other dependencies. Alternatively, I can just work around the detection by passing the --target flag without pulling develop. Unfortunately both these builds fail as as I hit the rather quirky OpenBLAS #334, a problem with the lapacke makefile.

make[3]: *** [../../../libopenblas_haswellp-r0.2.9.rc1.a] Error 1
make[2]: *** [lapacke] Error 2
make[1]: *** [lapackelib] Error 2
make: *** [netlib] Error 2

The solution I have found so far is to add this patch to the openblas-julia formulae. The patch can only be applied to the lapacke makefile as of OpenMathLib/OpenBLAS@d518681 (currently in develop but not master), so it is still necessary to install openblas manually rather than letting the Julia formula resolve it as a dependency.

A fork including these changes can be found at ndr-qef/homebrew-julia. On my machine, and with the caveats mentioned above, Julia builds and the tests pass.

You might want to push a fix that includes the makefile patch when OpenBLAS is compiled from head, but the result would be brittle: builds will fail if the makefile is changed in the develop branch. If the problem is uncommon enough, the risk is to break more installs than we fix.

The alternative would be to simply let those who have this issue temporarily tap the fork and wait for the fix to be applied upstream.

@tapeinosyne
Copy link
Author

This is fixed in OpenBLAS as of OpenMathLib/OpenBLAS@306d9f2. Closing.

@staticfloat
Copy link
Owner

Thanks for the solution, @ndr-qef!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants