Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
861 views
in Technique[技术] by (71.8m points)

haskell - Cabal not installing dependencies when needing profiling libraries?

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'?
...

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..

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...