Ways and Build Tags for Optimisation

Ashley Yakeley ashley@semantic.org
Thu, 29 May 2003 01:40:06 -0700

I'd like to include three different flavours of my HBase package, with 
these combinations of optimisation and profiling:

  release:   optimised (with -O -fvia-C)
  profiling: optimised and profiled
  quick:     neither

The release and profiling flavours take forever to compile, so it's 
useful to have a "quick" flavour to speed up the development cycle. The 
trouble is, any Haskell program using the release flavour of HBase also 
compiles very slowly, even if it itself does not use -O. If nothing 
else, this may be due to the huge interface file for the root import:

$ ls -Al HBase.*hi
-rw-r--r--    1 ashley   ashley    2117554 May 28 04:04 HBase.hi
-rw-r--r--    1 ashley   ashley    2119865 May 28 08:15 HBase.p_hi
-rw-r--r--    1 ashley   ashley      72669 May 28 16:20 HBase.q_hi

So what I'd like to do is include the "quick" version with suffices 
.q_hi and .q_o within the "hbase" package, just as profiling has .p_hi 
and .p_o. However, simply using -hisuf and -osuf seems not to be 
sufficient to force GHC to use those suffices when looking for files 
within HBase.

I looked in fptools/ghc/compiler/main/DriverState.hs to see how GHC does 
this sort of thing for profiling: the file speaks of "ways" and "build 
tags" but I can't find any reference to these in the GHC manual. How 
would I use one of the "user ways"?

Ashley Yakeley, Seattle WA