我想通过分析来编译我的程序,所以我运行:
$ 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 不会解析依赖项并在需要分析库时安装它们。
我可以通过手动解决依赖关系来解决这个问题(通过跟踪编译一段时间后出现的错误):
$ 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
然后重复我的下一个依赖项..
有更好的方法吗?即让 cabal 像普通库一样独立完成工作?
最佳答案
我已在我的 ~/.cabal/config
文件中启用了 library-profiling: True
。从那时起,任何新安装都将自动启用分析。
不幸的是,这仍然意味着我必须手动重新安装已安装的旧软件包。虽然,经过一段时间的手动执行此操作后,我现在已经重新安装了大多数软件包并启用了分析...
关于haskell - Cabal 在需要分析库时不安装依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1704421/