Haskell软件包content: "●"
取决于C库Numeric.LinearProgramming
。在Ubuntu 18.04上使用命令glpk
尝试安装时,出现以下错误:
cabal install hmatrix-glpk-0.19.0.0
我在{APT} Resolving dependencies...
Notice: installing into a sandbox located at /home/owen/.cabal-sandbox
Configuring hmatrix-glpk-0.19.0.0...
Failed to install hmatrix-glpk-0.19.0.0
Build log ( /home/owen/.cabal-sandbox/logs/hmatrix-glpk-0.19.0.0.log ):
cabal: Entering directory '/tmp/cabal-tmp-7470/hmatrix-glpk-0.19.0.0'
Configuring hmatrix-glpk-0.19.0.0...
cabal: Missing dependency on a foreign library:
*Missing C library: glpk
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.
cabal: Leaving directory '/tmp/cabal-tmp-7470/hmatrix-glpk-0.19.0.0'
cabal: Error: some packages failed to install:
hmatrix-glpk-0.19.0.0 failed during the configure step. The exception was:
ExitFailure 1
的标准位置中安装了glpk-utils
,但根据建议,我尝试添加/usr/share/doc/glpk-utils/
标签,但失败,并显示相同的消息。
这里可能是什么问题? --extra.../path to glpk-utils
是否正确安装了软件包? Cabal不可见吗?还有吗?
答案 0 :(得分:1)
您需要安装libglpk-dev
软件包。
对于libglpk
(glpk-utils
必需)和libglpk-dev
之间的区别,
例如,请参阅https://askubuntu.com/questions/1008912/whats-the-difference-between-dev-package-and-ordinary-package。
通常,Haskell FFI需要-dev
软件包,如错误消息中所述。