haskell - 安装带有 C 依赖项的 Haskell 包时出现问题 (glpk)
问题描述
Haskell 包Numeric.LinearProgramming
依赖于 C 库glpk
。尝试使用命令在 Ubuntu 18.04 上安装时cabal install hmatrix-glpk-0.19.0.0
出现以下错误:
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
安装在标准位置(通过 APT)/usr/share/doc/glpk-utils/
,但按照建议,我尝试添加--extra.../path to glpk-utils
标签,但失败并显示相同的消息。
这里可能是什么问题?安装包是否glpk-utils
正确?卡巴尔看不到吗?还有什么?
解决方案
您需要安装libglpk-dev
软件包。
libglpk
(需要的glpk-utils
)和之间的区别,例如libglpk-dev
,请参考https://askubuntu.com/questions/1008912/whats-the-difference-between-dev-package-and-ordinary-package。通常,Haskell FFI 需要-dev
错误消息中所述的软件包。
推荐阅读
- node.js - Nginx 反向代理正则表达式过滤器
- python - matplotlib:如何在不改变方面的情况下消除绘图中的浪费空间
- fortran - 如何摆脱特定的 gfortran 警告?
- excel - 数据透视表的 VBA 代码已停止工作
- c++ - 需要帮助理解 C++ 中的递归
- algorithm - 为锦标赛选择最佳球员子集(团队)
- lexical-analysis - 在 Gold Parser Builder 中定义字符串/输入的长度
- java - 安全配置 http 数据库类型=Forbidden,状态=403
- scala - 在scala中复制带有集合的对象
- wpf - LiveCharts ColumnSeries 填充颜色