I have been using the hMatrix package in the ghci environment, and all works fine (I can for instance import Numeric.LinearAlgebra.HMatrix). However, when I attempt to import and utilise the same things in a script, everything breaks (I truncated the error message slightly for readability (longer list of _base_GHCiIO-errors)). For instance these two lines in a file creates the error(s) below. Does anybody know what could be the cause? I am on mac OS X Yosemite.
import Numeric.LinearAlgebra.HMatrix
main = print ((2><1) [1.0::Float,1.0])
$ ghc 2_12.hs
[1 of 1] Compiling Main ( 2_12.hs, 2_12.o )
Linking 2_12 ...
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
_hs_iconv in libHSbase-4.7.0.2.a(iconv.o)
(maybe you meant: _hs_iconv,
_base_GHCziIOziEncodingziIconv_iconvEncoding9_info ,
_base_GHCziIOziEncodingziIconv_iconvEncoding8_info,
_base_GHCziIOziEncodingziIconv_iconvEncoding9_closure ,
_hs_iconv_open , _hs_iconv_close ,
"_iconv_close", referenced from:
_hs_iconv_close in libHSbase-4.7.0.2.a(iconv.o)
(maybe you meant: _hs_iconv_close)
"_iconv_open", referenced from:
_hs_iconv_open in libHSbase-4.7.0.2.a(iconv.o)
(maybe you meant: _hs_iconv_open)
"_locale_charset", referenced from:
_localeEncoding in libHSbase-4.7.0.2.a(PrelIOUtils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)