根据GHC 7.10.1和cabal 1.23进行分析的程序是什么?

mhw*_*bat 8 profiling haskell ghc cabal-install

在GHC 7.10.1和cabal 1.23下建议的分析程序是什么?来自GHC和cabal-install的与性能分析相关的错误和警告消息非常不一致.

  1. 尝试使用性能分析运行可执行文件,然后告诉您:

    $ prediction-interactive +RTS -p
    
    prediction-interactive: the flag -p requires the program to be built with -prof
    
    Run Code Online (Sandbox Code Playgroud)
  2. 放入-prof你的cabal文件,你会被告知:

    $ cabal build
    
    Warning: 'ghc-options: -prof' is not necessary and will lead to problems when
    used on a library. Use the configure flag --enable-library-profiling and/or
    --enable-executable-profiling.
    
    Run Code Online (Sandbox Code Playgroud)
  3. 遵循该建议(并从cabal文件中删除-prof),并告诉您:

    $ cabal configure --enable-executable-profiling
    
    Resolving dependencies...
    Configuring creatur-wains-prediction-1.0...
    Warning: The flag --enable-executable-profiling is deprecated. Please use
    --enable-profiling instead.
    
    Run Code Online (Sandbox Code Playgroud)
  4. 遵循这个建议,你被告知:

    $ cabal configure --enable-profiling
    
    Resolving dependencies...
    Configuring creatur-wains-prediction-1.0...
    
    $ cabal build
    
    . . .
    Installing executable(s) in
    /home/eamybut/nosync/sandboxes/prediction-wains/bin
    Installed creatur-wains-prediction-1.0
    
    $ prediction-interactive +RTS -p
    
    prediction-interactive: the flag -p requires the program to be built with -prof
    
    Run Code Online (Sandbox Code Playgroud)

捂脸!

编辑:在步骤4中添加了cabal构建.