2

I'd like to do some graphing in my Haskell program, but when I try to install plot I get the following error.

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

Following this issue I updated hmatrix to version 0.17.0.1 but still get the same error. Any ideas?

theideasmith
  • 2,835
  • 2
  • 13
  • 20

2 Answers2

2

Are you managing the project with cabal, or are you just installing into the global package space?

I would move to either using cabal or stack to manage the dependencies. FWIW I've verified that plot-0.2.3.4 will compile with hmatrix-0.16.1.5 using the stack resolver lts-3.7 so I don't think it's a problem with hmatrix.

If you are using cabal, post your cabal file and we can figure out how to make it work. Otherwise, I would recommend creating a stack project, eg.

  • run stack new project-name
  • edit project-name.cabal and add plot to the build-depends: fields
  • run stack build
ErikR
  • 51,541
  • 9
  • 73
  • 124
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

Found the libblas library I needed via:

sudo apt-cache search blas | grep dev

from: 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.

After some putzing around on the wiki pages for gtk2hs

sudo apt-get install libghc-gtk-dev

Now it should install successfully.

stack install plot

Intermediate errors are from me re-attempting stack install plot. These instructions assume Ubuntu 14.04 but you can translate what packages you need to Mac OS X / Windows.

As the other poster said, this was with the 0.16 version of hmatrix.

bitemyapp
  • 1,627
  • 10
  • 15