Lame me, I found the answer here:<br><a href="http://haskell.org/ghc/docs/6.10.2/html/users_guide/template-haskell.html">http://haskell.org/ghc/docs/6.10.2/html/users_guide/template-haskell.html</a><br><br>ghc -fforce-recomp --make -cpp -O -DXQUERY2_TEST Main<br>
ghc -osuf p_o -prof -auto -auto-all -fforce-recomp --make -cpp -O -DXQUERY2_TEST Main<br><br>Regards<br><br>Christopher Skrzętnicki<br>
<br><br><div class="gmail_quote">2009/4/24 Krzysztof Skrzętnicki <span dir="ltr">&lt;<a href="mailto:gtener@gmail.com">gtener@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br><br>I&#39;m trying to build some modules that use TH with profiling enabled.<br><br>The normal build works:<br><br>$ ghc -fforce-recomp --make -cpp -O -DXQUERY2_TEST Main<br>[1 of 8] Compiling Text.XML.Expat.FormatCustom ( Text/XML/Expat/FormatCustom.hs, Text/XML/Expat/FormatCustom.o )<br>

[2 of 8] Compiling DataStructures   ( DataStructures.hs, DataStructures.o )<br>Loading package ghc-prim ... linking ... done.<br>Loading package integer ... linking ... done.<br>Loading package base ... linking ... done.<br>

Loading package syb ... linking ... done.<br>Loading package array-0.2.0.0 ... linking ... done.<br>Loading package packedstring-0.1.0.1 ... linking ... done.<br>Loading package containers-0.2.0.1 ... linking ... done.<br>

Loading package pretty-1.0.1.0 ... linking ... done.<br>Loading package template-haskell ... linking ... done.<br>Loading package mtl-1.1.0.2 ... linking ... done.<br>Loading package filepath-1.1.0.2 ... linking ... done.<br>

Loading package old-locale-1.0.0.1 ... linking ... done.<br>Loading package old-time-1.0.0.2 ... linking ... done.<br>Loading package unix-2.3.2.0 ... linking ... done.<br>Loading package directory-1.0.0.3 ... linking ... done.<br>

Loading package process-1.0.1.1 ... linking ... done.<br>Loading package random-1.0.0.1 ... linking ... done.<br>Loading package derive-0.1.4 ... linking ... done.<br>[3 of 8] Compiling Utils            ( Utils.hs, Utils.o )<br>

[4 of 8] Compiling Semantics.Pure   ( Semantics/Pure.hs, Semantics/Pure.o )<br>[5 of 8] Compiling Database         ( Database.hs, Database.o )<br>[6 of 8] Compiling XPathDSL         ( XPathDSL.hs, XPathDSL.o )<br>[7 of 8] Compiling QueryParse       ( QueryParse.hs, QueryParse.o )<br>

[8 of 8] Compiling Main             ( Main.hs, Main.o )<br>Linking Main ...<br><br>But profiling one fails:<br><br>$ ghc -prof -auto -auto-all -fforce-recomp --make -cpp -O -DXQUERY2_TEST Main<br>[1 of 8] Compiling Text.XML.Expat.FormatCustom ( Text/XML/Expat/FormatCustom.hs, Text/XML/Expat/FormatCustom.o )<br>

[2 of 8] Compiling DataStructures   ( DataStructures.hs, DataStructures.o )<br>Loading package ghc-prim ... linking ... done.<br>Loading package integer ... linking ... done.<br>Loading package base ... linking ... done.<br>

DataStructures.hs:1:0:<br>    Dynamic linking required, but this is a non-standard build (eg. prof).<br>    You need to build the program twice: once the normal way, and then<br>    in the desired way using -osuf to set the object file suffix.<br>

<br>The error message is somewhat cryptic to me. Does anyone know how to perform profiling build when using TH?<br><br>Regards<br><br>Christopher Skrzętnicki<br>
</blockquote></div><br>