Fix bug #1934. Add #ifdef HAVE_LAPACK, and can compile w/o LAPACK.