Fix issue with different LAPACK apis on mac/linux