Unix Dir for .hi Import Files

Simon Marlow simonmar@microsoft.com
Mon, 10 Jun 2002 15:03:02 +0100


> > on somewhat of a tangent, i was running into problems with where
> > both nhc and ghc place their hi files when attempting to compile
> > from a read-only filesystem, the standard autoconf setup (as used in
> > DrIFT http://repetae.net/~john/computer/haskell/DrIFT) works almost
> > perfectly except the .hi files always seem to be placed in the same
> > directory as teh source files rather than with the .o files as would
> > seem to make sense.=20
>=20
> Thanks.  This is a very clear statement of a similar problem I was
> having when building a project with GHC.  I don't recall all the
> details now but I remember having to fight rather hard to get GHC to
> place files in the right place and even harder to get GHC to generate
> Make-style dependency files containing the correct directories.  In
> the end I think I settled on compromising the directory structure I
> wanted and writing a perl script which munged the generated dependency
> files.  The fragility of this approach was demonstrated on the next
> release when a slight change in the format of one of the GHC-generated
> files threw my Makefile and script out of whack.
>=20
> Sorry I can't fill in details - this was about 18 months ago and the
> only records I have are some ugly-looking Makefiles.  The point of my
> anecdote is just to add weight to the argument that this is an
> important issue to get right.

If there's a problem here I'd like to get it nailed.  Take a look at the
GHC documentation, in particular the section on flags for redirecting
output:

  http://www.haskell.org/ghc/docs/latest/set/flag-reference.html#AEN4986

and let me know if there's anything that's not covered, or you think
should be done differently.

John's problem above sounds like it would be solved by using the -hidir
flag.

Cheers,
	Simon