简体   繁体   中英

Profiling an application on Windows with cabal/ghc

I've been experiencing a nasty issue with profiling on Windows. But first, the context of setup:

  • I created a shared sandbox in ~/dev/foo_shared : cabal sandbox init --sandbox=.
  • I created a sandbox in ~/dev/foo using the shared sandbox above: cabal sandbox init --sandbox=~/dev/foo_shared
  • I installed all the dependencies with profiling enabled: cabal install --only-dependencies --enable-library-profiling --enable-executable-profiling
  • I configured the foo package so that it includes profiling RTS: cabal configure --enable-profiling --enable-executable-profiling
  • I tried to build with cabal build

Everything builds up correctly, but doesn't link. I then rebuilt with cabal build -v3 , and this is the linker part (the most interesting part):

c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lHSrts_debug_p

I googled that, and IIRC, it's because I lack the profiling library for the GHC's RTS. I never found it for Windows :( Last information, I'm on Windows 10, not sure it helps though.

Problem solved. The issue is due to the fact I'm using -debug on the command line interface to GHC. I've been told -debug and -p are not compatible, hence the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM