[Haskell-cafe] Template Haskell + Profiling

Krzysztof Skrzętnicki gtener at gmail.com
Fri Apr 24 11:27:59 EDT 2009


Hi

I'm trying to build some modules that use TH with profiling enabled.

The normal build works:

$ ghc -fforce-recomp --make -cpp -O -DXQUERY2_TEST Main
[1 of 8] Compiling Text.XML.Expat.FormatCustom (
Text/XML/Expat/FormatCustom.hs, Text/XML/Expat/FormatCustom.o )
[2 of 8] Compiling DataStructures   ( DataStructures.hs, DataStructures.o )
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Loading package syb ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package packedstring-0.1.0.1 ... linking ... done.
Loading package containers-0.2.0.1 ... linking ... done.
Loading package pretty-1.0.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package mtl-1.1.0.2 ... linking ... done.
Loading package filepath-1.1.0.2 ... linking ... done.
Loading package old-locale-1.0.0.1 ... linking ... done.
Loading package old-time-1.0.0.2 ... linking ... done.
Loading package unix-2.3.2.0 ... linking ... done.
Loading package directory-1.0.0.3 ... linking ... done.
Loading package process-1.0.1.1 ... linking ... done.
Loading package random-1.0.0.1 ... linking ... done.
Loading package derive-0.1.4 ... linking ... done.
[3 of 8] Compiling Utils            ( Utils.hs, Utils.o )
[4 of 8] Compiling Semantics.Pure   ( Semantics/Pure.hs, Semantics/Pure.o )
[5 of 8] Compiling Database         ( Database.hs, Database.o )
[6 of 8] Compiling XPathDSL         ( XPathDSL.hs, XPathDSL.o )
[7 of 8] Compiling QueryParse       ( QueryParse.hs, QueryParse.o )
[8 of 8] Compiling Main             ( Main.hs, Main.o )
Linking Main ...

But profiling one fails:

$ ghc -prof -auto -auto-all -fforce-recomp --make -cpp -O -DXQUERY2_TEST
Main
[1 of 8] Compiling Text.XML.Expat.FormatCustom (
Text/XML/Expat/FormatCustom.hs, Text/XML/Expat/FormatCustom.o )
[2 of 8] Compiling DataStructures   ( DataStructures.hs, DataStructures.o )
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
DataStructures.hs:1:0:
    Dynamic linking required, but this is a non-standard build (eg. prof).
    You need to build the program twice: once the normal way, and then
    in the desired way using -osuf to set the object file suffix.

The error message is somewhat cryptic to me. Does anyone know how to perform
profiling build when using TH?

Regards

Christopher Skrzętnicki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090424/7e2a15dd/attachment.htm


More information about the Haskell-Cafe mailing list