安装具有C依赖项glpk的Haskell软件包时出现问题

问题描述

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不可见吗?还有吗?

解决方法

您需要安装libglpk-dev软件包。

对于libglpkglpk-utils必需)和libglpk-dev之间的区别, 例如,请参阅https://askubuntu.com/questions/1008912/whats-the-difference-between-dev-package-and-ordinary-package。 通常,Haskell FFI需要-dev软件包,如错误消息中所述。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...