-O in 6.8.1-candidate

Isaac Dupree isaacdupree at charter.net
Fri Oct 19 09:54:36 EDT 2007


>> defines, for example, whether to compile the library with -O, with 
>> -O2, or with -Onot.
>> The meaning of these options is explained in the GHC documentation.

> 
> Ok, so you can get rid of -O and -prof and instead use:
> 
> runghc Setup.hs configure
> 
> with our without the following options:
> 
> --enable/disable-optimization		(default is enabled)
> --enable/disable-library-profiling   (default is disabled)

> 
> The option -auto-all is not the default for Cabal's
> --enable-library-profiling but you can make it so using:
> 
> ghc-prof-options: -auto-all
> 
> and this option will only be used when the user configures with
> --enable-library-profiling

How can user who does not modify Cabal file choose between all three of 
-O0, -O and -O2?  (Not knowing about profiling,) What if user wants to 
decide whether to use -auto-all?  Somehow your answers don't seem to 
answer.  (some compilers may have idiosyncratic flags that USERS of THAT 
COMPILER want to choose for their own reasons)  Now, IIRC cabal has 
something like a --ghc-option= flag that can be used in either configure 
or build, I can never remember which; and, if lucky, GHC has a way to 
override a prior -auto-all flag on the command line; "-auto-all" you, as 
user, may or may not have known was there.

This may be okay.  The documentation should be clearer about this too, 
if so.

Isaac


More information about the Glasgow-haskell-bugs mailing list