Tôi gặp sự cố khi xây dựng hmatrix library trên OS X Lion. Nhìn vào tệp .cabal, nó yêu cầu thư viện gsl
, vì vậy tôi đã cài đặt nó với các macports. Các tệp .a nằm trong/opt/local/lib và các tệp .h nằm trong/opt/local/include/gslGói Haskell thiếu thư viện c
Như được đề xuất here Tôi đã thay đổi kiểu được xây dựng từ Tùy chỉnh thành Đơn giản. (mà không có thay đổi đó tôi nhận được một lỗi tương tự).
Khi tôi sử dụng cabal configure
tôi nhận được kết quả như sau:
* Missing C library: gsl
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
Vì vậy, tôi đã cố gắng cabal --extra-include-dirs=/opt/local/include --extra-lib-dirs=/opt/local/lib configure
, nhưng tôi vẫn nhận được lỗi tương tự. Tôi có thể biên dịch và liên kết một chương trình c bao gồm gsl. Những tập tin cabal đang tìm kiếm? Nếu tôi có các tệp phù hợp, làm cách nào để tôi biết cách tìm chúng?
libgsl.a là một nhị phân phổ quát:
$ file /opt/local/lib/libgsl.a
/opt/local/lib/libgsl.a: Mach-O universal binary with 2 architectures
/opt/local/lib/libgsl.a (for architecture x86_64): current ar archive random library
/opt/local/lib/libgsl.a (for architecture i386): current ar archive random library
GHC có vẻ như nó là 64-bit:
$ ghc --info
[("Project name","The Glorious Glasgow Haskell Compilation System")
,("GCC extra via C opts"," -fwrapv")
,("C compiler command","/usr/bin/llvm-gcc")
,("C compiler flags"," -m64 -fno-stack-protector -m64")
,("ar command","/usr/bin/ar")
,("ar flags","clqs")
,("ar supports at file","NO")
,("touch command","touch")
,("dllwrap command","/bin/false")
,("windres command","/bin/false")
,("perl command","/usr/bin/perl")
,("target os","OSDarwin")
,("target arch","ArchX86_64")
,("target word size","8")
,("target has GNU nonexec stack","False")
,("target has subsections via symbols","True")
,("Project version","7.4.2")
,("Booter version","7.4.2")
,("Stage","2")
,("Build platform","x86_64-apple-darwin")
,("Host platform","x86_64-apple-darwin")
,("Target platform","x86_64-apple-darwin")
,("Have interpreter","YES")
,("Object splitting supported","NO")
,("Have native code generator","YES")
,("Support SMP","YES")
,("Unregisterised","NO")
,("Tables next to code","YES")
,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn")
,("Leading underscore","YES")
,("Debug on","False")
,("LibDir","/usr/local/Cellar/ghc/7.4.2/lib/ghc-7.4.2")
,("Global Package DB","/usr/local/Cellar/ghc/7.4.2/lib/ghc-7.4.2/package.conf.d")
,("Gcc Linker flags","[\"-m64\"]")
,("Ld Linker flags","[\"-arch\",\"x86_64\"]")
]
Ảnh toàn cảnh trong bóng tối: bạn đã cài đặt g ++ chưa? Tôi nhớ đã cài đặt một thư viện khác và nhận các thông báo lỗi tương tự lạ (nó cũng không tìm thấy các thư viện C đã được cài đặt rõ ràng); sau đó hóa ra nó cũng cần g ++. –
Tôi đã cài đặt g ++. – munk
Bạn đã thử 'cabal install -v hmatrix' để xem bước thất bại chưa? Nó có thể giúp thu hẹp vấn đề. –