John, thanks for your reply. Just to be clear, when you say
"the idea is that NMatrix should have simple, straightforward
implementations of most functions on its own"
do you mean pure Ruby implementations like in the distribution gem, or
C implementations, which already exist to some extent in nmatrix? I
think you mean the latter, but I just want to make sure. Either way,
the reason I'm somewhat skeptical of this idea is because if you make
nmatrix independent of LAPACK implementation (see next paragraph),
then installing the external dependencies becomes trivially easy. It
looks like OS X comes with liblapack pre-installed and on Linux
systems it's easy to install through whatever standard package
manager. Adding a second implementation of everything means additional
complexity, additional testing, additional maintenance. If this has
benefit of making nmatrix easier to use, then that's great and the
extra complexity is worth tolerating. But if the only benefit is
saving people from running 'sudo apt-get install liblapack3' then it
doesn't really seem worth it.
On a related note, it turns out that it only requires a few changes to
get nmatrix to build and run without ATLAS, though a few features are
disabled. As a test, I tried to reimplement one of the missing
functions (sgetri) using some functions copied from LAPACKE, as
suggested by Sameer. Things appear to be working. I think replacing
CLAPACK with LAPACKE is a good idea:
It has a fully compatible license
Removes dependency on ATLAS, without adding any additional external
dependencies beyond lapack and blas
Works with either the liblapack from ATLAS, OpenBLAS, or the reference
implementation (I tested these three, should also work with other
implementations as well). This means you can use your standard
OS-provided library or a special customized library without having to
change anything in nmatrix.
There are some remaining complications like the question of CBLAS,
which does not have a friendly license. But overall, I think it should
be not so hard to make nmatrix lapack-agnostic, which would help in
making it easier to install.