Cabal 在需要分析库时不安装依赖项? [英] Cabal not installing dependencies when needing profiling libraries?

查看:23
本文介绍了Cabal 在需要分析库时不安装依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用分析来编译我的程序,所以我运行:

I want to compile my program with profiling, so I run:

$ cabal configure --enable-executable-profiling
...
$ cabal build
...
    Could not find module 'Graphics.UI.GLUT':
      Perhaps you havent installed the profiling libraries for package 'GLUT-2.2.2.0'?
...
$ # indeed I have not installed the prof libs for GLUT, so..
$ cabal install -p GLUT --reinstall
...
    Could not find module 'Graphics.Rendering.OpenGL':
      Perhaps you havent installed the profiling libraries for package 'OpenGL-2.4.0.1'?
...

所以,问题是,与 cabal 通常受欢迎的行为不同,cabal 在需要分析库时不解析依赖项并安装它们.

So, the problem is, that unlike cabal's usual welcome behavior, cabal doesn't resolve the dependencies and install them when needing profiling libraries.

我可以通过手动解决依赖关系来解决这个问题(通过遵循编译一段时间后出现的错误):

I can work around it by resolving the dependencies manually (by following errors that appear after a while of compiling):

$ cabal install -p OpenGLRaw --reinstall
$ cabal install -p StateVar --reinstall
$ cabal install -p Tensor --reinstall
$ cabal install -p ObjectName --reinstall
$ cabal install -p GLURaw --reinstall
$ cabal install -p OpenGL --reinstall
$ cabal install -p GLUT --reinstall

然后重复我的下一个依赖项..

And then repeat for my next dependency..

有没有更好的方法来做到这一点?即是否让 cabal 像普通图书馆一样自行完成工作?

Is there a better way to do this? i.e do make cabal do the work on its own as it does for normal libraries?

推荐答案

我在我的 ~/.cabal/config 文件中启用了 library-profiling: True.从那时起,任何新安装都将自动启用分析.

I've enabled library-profiling: True in my ~/.cabal/config file. From then on, any new installations will automatically enable profiling.

不幸的是,这仍然意味着我必须为已经安装的旧软件包手动重新安装.尽管在手动执行一段时间后,我现在重新安装了大多数软件包并启用了分析...

Unfortunately that still means I had to manually reinstall for the old packages already installed. Although, after a while of doing this manually, I now have most packages reinstalled with profiling enabled...

这篇关于Cabal 在需要分析库时不安装依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆