无法成功安装Haskell的情节

时间:2015-10-27 17:23:04

标签: haskell plot install cabal-install hmatrix

我想在我的Haskell程序中做一些图形,但是当我尝试安装绘图时,我得到以下错误。

Preprocessing library plot-0.2.3.4...

lib/Graphics/Rendering/Plot/Figure/Simple.hs:37:8:
    Could not find module ‘Numeric.Container’
    Use -v to see a list of the files searched for.

lib/Graphics/Rendering/Plot/Types.hs:25:8:
    Could not find module ‘Data.Packed.Vector’
    Use -v to see a list of the files searched for.

lib/Graphics/Rendering/Plot/Types.hs:26:8:
    Could not find module ‘Data.Packed.Matrix’
    Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
plot-0.2.3.4 failed during the building phase. The exception was:
ExitFailure 1

关注this issue我将hmatrix更新为版本0.17.0.1但仍然收到相同的错误。有什么想法吗?

2 个答案:

答案 0 :(得分:2)

您是使用cabal管理项目,还是只是安装到全局包空间?

我会转而使用cabalstack来管理依赖项。 FWIW我已经确认plot-0.2.3.4将使用堆栈解析器hmatrix-0.16.1.5使用lts-3.7进行编译,因此我认为这不是hmatrix的问题。

如果您使用cabal,请发布您的cabal文件,我们可以弄清楚如何使其工作。否则,我建议创建一个堆栈项目,例如

  • 运行stack new project-name
  • 修改project-name.cabal并将plot添加到build-depends:字段
  • 运行stack build

答案 1 :(得分:0)

   Configuring hmatrix-0.16.1.5...
    setup-Simple-Cabal-1.22.4.0-x86_64-linux-ghc-7.10.2: Missing dependencies on
    foreign libraries:
    * Missing C libraries: blas, lapack

通过以下方式找到我需要的libblas库:

sudo apt-cache search blas | grep dev

来自:https://github.com/albertoruiz/hmatrix/blob/master/INSTALL.md#linux

sudo apt-get install libblas-dev libgsl0-dev liblapack-dev libatlas-base-dev

setup: The pkg-config package 'cairo' version >=1.2.0 is required but it could
not be found.

在维基页面上浏览一下gtk2hs之后

sudo apt-get install libghc-gtk-dev

现在应该成功安装。

stack install plot

中间错误来自我重新尝试stack install plot。这些说明假定Ubuntu 14.04,但您可以将所需的软件包翻译成Mac OS X / Windows。

正如另一张海报所说,这与0.16版本的hmatrix有关。