Can't Install hmatrix on my Ubuntu Linux machi

2019-07-17 06:50发布

问题:

I am trying to install hmatrix on my Ubuntu Linux machine (don't know if this is necessary, but it may help) and no matter what I do it will not work.

I run cabal install hmatrix and get this:

   Configuring hmatrix-0.13.1.0...
   Checking foreign libraries... FAIL
   *** Sorry, I can't link GSL.
   *** Please make sure that the appropriate -dev packages are installed.
   *** You can also specify the required libraries using
   *** cabal install hmatrix --configure-option=link:lib1,lib2,lib3,etc.
   setup: Package hmatrix-0.13.1.0 can't be built on this system.
   cabal: Error: some packages failed to install:
   hmatrix-0.13.1.0 failed during the building phase. The exception was:
   ExitFailure 1

Apparently the ExitFailure 1 thing is a leftover from the original program.

When I run cabal configure I get

  Warning: 'hs-source-dirs: lib' directory does not exist.
  Checking foreign libraries... FAIL
  *** Sorry, I can't link GSL.
  *** Please make sure that the appropriate -dev packages are installed.
  *** You can also specify the required libraries using
  *** cabal install hmatrix --configure-option=link:lib1,lib2,lib3,etc.

Any help would be greatly appreciated and thank you for reading.

回答1:

You have to install the C libraries, something like libgsl-dev (or -devel), and libgsl itself, but that should be pulled in by the dev package. hmatrix is a binding to a C library, so you need that installed to be able to install hmatrix.

On my box, ghc-pkg describe hmatrix lists

extra-libraries: gsl lapack gslcblas

I'm not sure all of them are actually required for building hmatrix, but it wouldn't harm to also install the dev packages for lapack and BLAS (which may be something else than gslcblas on Ubuntu).



回答2:

On Ubuntu some of the required libraries can be loaded with apt-get command. Try this,

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


回答3:

Referring to this file installation on Ubuntu is done using:

sudo apt-get install libgsl0-dev liblapack-dev
cabal install hmatrix