Kabbalah does not establish dependencies if necessary 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 the usual cabal greeting behavior, cabal does not resolve dependencies and does not install them if necessary in the profiling libraries.

I can get around this by resolving the dependencies manually (by the following errors that occur after compilation):

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

Is there a better way to do this? ie do they do bonded work on their own, as for regular libraries?

+43
profiling haskell cabal
Nov 09 '09 at 22:36
source share
5 answers

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

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

+45
Nov 10 '09 at 17:41
source share

From Tom Lockhorst's comment:

I hope someone comes up with a better answer that will not require me to reinstall the full Haskell platform manually next time.

For future visitors:

The task of installing the profiling versions of all installed libraries has become less complicated, cabal (cabal-install) now tracks what was installed using this in the world file in the .cabal directory (on linux, which is $HOME/.cabal , on Windows that something like C:\Users\%YOU%\AppData\Roaming\cabal\ , on OSX ??).

So, after enabling profiling in the config file (in the same directory) and cleaning the GHC package database (you can find the location of the global and user db for ghc-pkg list nonexisting ; remove the packages installed in Kabbalah from the global database with ghc-pkg unregister packagename , if you have to rename or delete the entire user db - this is necessary, because the world file tracks only explicitly installed packages, not their dependencies), installing everything with profiling support should work as follows: / p>

 $ cabal install --reinstall world --dry-run 

First run with --dry-run to check for problems before reinstalling anything. If he reinstalls download packages such as process or directory , this is a bad sign, if you don’t know how to handle it, ask the #haskell IRC channel, one of the mailing lists or here for guidance if he cannot find a consistent installation plan due to new versions of hackage of some packages that are incompatible with each other, which can usually be resolved by editing the world and limiting the valid versions of some packages.

Then, if you are optimistic that nothing bad will break,

 $ cabal install --reinstall world 

and you have a nice pot of tea while the GHC is busy compiling.

+29
Jan 31 2018-12-12T00:
source share

Daniel Fisher's answer looks pretty good, but for some reason my ~ / .cabal / world library contains only entries for directly installed libraries, not their dependencies.

Instead, I threw out a list of all installed libraries using

 $ ghc-pkg list > list 

The libraries that are installed both on the system and locally are listed here. Therefore, I edited the list file to remove the first part (containing the libraries installed at the system scale), leaving only the lines after /home/<user>/.ghc/... Finally i ran

 $ cabal install --reinstall $(cat list) 

It worked for me. You must first do --dry-run . Then make a teapot with tea. Or bake a cake.

+13
May 01 '12 at 12:24
source share

For 2016+ visitors: just install ghc-prof

Debian Linux Systems:

sudo apt-get install ghc-prof

Arch Linux Systems:

sudo pacman -S ghc-prof

0
Aug 11 '16 at 16:16
source share



All Articles