hmatrixが動かない

インストール(コンパイル)はできた。

しかし、hmatrixをつかったコードがコンパイルできない。

例えば

import Numeric.LinearAlgebra.Tests
main = runTests 20

コンパイルすると、以下のエラー

C:\unix\ghc\ghc-6.8.2\hmatrix-0.5.0.1\ghc-6.8.2/libHShmatrix-0.5.0.1.a
(lapack-aux.o)(.text+0x1fa1):lapack-aux.c: undefined reference to `dgemm_'
C:\unix\ghc\ghc-6.8.2\hmatrix-0.5.0.1\ghc-6.8.2/libHShmatrix-0.5.0.1.a
(lapack-aux.o)(.text+0x2081):lapack-aux.c: undefined reference to `zgemm_'
collect2: ld returned 1 exit status

う〜ん、どうやら、関数が見つからないと言っている模様。それ以上はよく分からない。
とりあえず、dgemm,zgemmはBLASに入っているらしい。
べつのPCでは問題なく動作した。原因不明。

[追記]

hmatrix.cabalのある行にRblasを追加したら動くようになった。

        extra-libraries: gsl lapack Rblas

        -- Include additional libraries if they are
        -- required by your system to link -lgsl -llapack

        -- (In ubuntu/debian cblas is included in blas,
        --  which is automatically linked by lapack, so
        -- nothing more is required.)

理由はよく分からない。