Backport 1.8 3642

Backport support for building with openblas.