[GHC] #10894: In users_guide/profiling.xml : -prof flag not to be used with cabal/stack

GHC ghc-devs at haskell.org
Fri Sep 18 15:29:35 UTC 2015


#10894: In users_guide/profiling.xml : -prof flag not to be used with cabal/stack
-------------------------------------+-------------------------------------
              Reporter:              |             Owner:
  robstewartuk                       |
                  Type:  bug         |            Status:  new
              Priority:  lowest      |         Milestone:
             Component:              |           Version:  7.10.2
  Documentation                      |
              Keywords:  user        |  Operating System:  Unknown/Multiple
  guide, profiling                   |
          Architecture:              |   Type of failure:  Documentation
  Unknown/Multiple                   |  bug
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 The documentation for compiling with cost centre profiling support is
 here:
 https://github.com/ghc/ghc/blob/master/docs/users_guide/profiling.xml#L79

 It says:

 {{{
 Compile and run this program as follows:

 $ ghc -prof -fprof-auto -rtsopts Main.hs
 $ ./Main +RTS -p
 121393
 $
 }}}

 This is not the case when cabal or stack are used, as `-prof` should be
 omitted, i.e.

 {{{
 cabal install --enable-executable-profiling --enable-library-profiling
 --ghc-options="-fprof-auto -rtsopts"
 }}}

 If the user does not know this and includes `-prof` in the --ghc-options
 string, they are likely to see compiler error messages relating to
 `p_dyn`, e.g.

 {{{
 Failed to load interface for ‘GHC.Integer.Type’
 Perhaps you haven't installed the "p_dyn" libraries for package ‘integer-
 gmp-1.0.0.0’?
 Use -v to see a list of the files searched for.
 }}}

 Given that other parts of the `profiling.xml` file does refer to cabal, do
 people agree that it might be helpful to make it explicit in Section "5.1.
 Cost centres and cost-centre stacks", that using ghc directly `-prof`
 should be used (no change to the XML file):

 {{{
 $ ghc -prof -fprof-auto -rtsopts Main.hs
 }}}


 Though if cabal/stack is being used, the `-prof` should be omitted (an
 addition to the XML file):

 {{{
 $ cabal install --enable-executable-profiling --enable-library-profiling
 --ghc-options="-fprof-auto -rtsopts"
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10894>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list