I cannot get this working on OS X.
First I tried "gem install nmatrix". This resulted in the error about gcc not being up to date. I then used the script to install a later version of gcc. After a lot of fiddling I managed to get the gem install command to use that compiler. This gave the following error:
util/math.h:72:21: fatal error: cblas.h: No such file or directory
export C_INCLUDE_PATH=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/
export CPLUS_INCLUDE_PATH=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/
compiling nmatrix.cpp
In file included from nmatrix.cpp:49:0:
util/math.h: In function ‘int nm::math::potrf(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = float]’:
util/math.h:1568:47: error: ‘clapack_spotrf’ was not declared in this scope
util/math.h: In function ‘int nm::math::potrf(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = double]’:
util/math.h:1573:47: error: ‘clapack_dpotrf’ was not declared in this scope
util/math.h: In function ‘int nm::math::potrf(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = nm::Complex<float>]’:
util/math.h:1578:72: error: ‘clapack_cpotrf’ was not declared in this scope
util/math.h: In function ‘int nm::math::potrf(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = nm::Complex<double>]’:
util/math.h:1583:72: error: ‘clapack_zpotrf’ was not declared in this scope
util/math.h: In function ‘void nm::math::lauum(CBLAS_ORDER, CBLAS_UPLO, int, float*, int)’:
util/math.h:2093:40: error: there are no arguments to ‘clapack_slauum’ that depend on a template parameter, so a declaration of ‘clapack_slauum’ must be available [-fpermissive]
util/math.h:2093:40: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
util/math.h: In function ‘void nm::math::lauum(CBLAS_ORDER, CBLAS_UPLO, int, double*, int)’:
util/math.h:2098:40: error: there are no arguments to ‘clapack_dlauum’ that depend on a template parameter, so a declaration of ‘clapack_dlauum’ must be available [-fpermissive]
util/math.h: In function ‘void nm::math::lauum(CBLAS_ORDER, CBLAS_UPLO, int, nm::Complex64*, int)’:
util/math.h:2103:40: error: there are no arguments to ‘clapack_clauum’ that depend on a template parameter, so a declaration of ‘clapack_clauum’ must be available [-fpermissive]
util/math.h: In function ‘void nm::math::lauum(CBLAS_ORDER, CBLAS_UPLO, int, nm::Complex128*, int)’:
util/math.h:2108:40: error: there are no arguments to ‘clapack_zlauum’ that depend on a template parameter, so a declaration of ‘clapack_zlauum’ must be available [-fpermissive]
util/math.h: In function ‘int nm::math::getri(CBLAS_ORDER, int, DType*, int, const int*) [with DType = float]’:
util/math.h:2220:47: error: ‘clapack_sgetri’ was not declared in this scope
util/math.h: In function ‘int nm::math::getri(CBLAS_ORDER, int, DType*, int, const int*) [with DType = double]’:
util/math.h:2225:47: error: ‘clapack_dgetri’ was not declared in this scope
util/math.h: In function ‘int nm::math::getri(CBLAS_ORDER, int, DType*, int, const int*) [with DType = nm::Complex<float>]’:
util/math.h:2230:72: error: ‘clapack_cgetri’ was not declared in this scope
util/math.h: In function ‘int nm::math::getri(CBLAS_ORDER, int, DType*, int, const int*) [with DType = nm::Complex<double>]’:
util/math.h:2235:72: error: ‘clapack_zgetri’ was not declared in this scope
util/math.h: In function ‘int nm::math::potri(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = float]’:
util/math.h:2250:47: error: ‘clapack_spotri’ was not declared in this scope
util/math.h: In function ‘int nm::math::potri(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = double]’:
util/math.h:2255:47: error: ‘clapack_dpotri’ was not declared in this scope
util/math.h: In function ‘int nm::math::potri(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = nm::Complex<float>]’:
util/math.h:2260:72: error: ‘clapack_cpotri’ was not declared in this scope
util/math.h: In function ‘int nm::math::potri(CBLAS_ORDER, CBLAS_UPLO, int, DType*, int) [with DType = nm::Complex<double>]’:
util/math.h:2265:72: error: ‘clapack_zpotri’ was not declared in this scope
nmatrix.cpp: In function ‘VALUE nm_factorize_lu(VALUE)’:
nmatrix.cpp:1555:7: error: ‘clapack_cgetrf’ was not declared in this scope
nmatrix.cpp:1555:23: error: ‘clapack_zgetrf’ was not declared in this scope
make: *** [nmatrix.o] Error 1