6

I'm confused as to whether it is possible to compile/link a profiling build for gprof using gcc with OpenMP enabled. The gcc docs seem silent on the matter, as far as my google searches indicated. Experimentally, adding just the -fomp switch causes a SIGPROF error on launch.

I'm also unclear as to whether http://projekt17.pub.lab.nm.ifi.lmu.de/ompp/downloads/$pkgname-$pkgver.tgz is of any help since the included doc refers only to icc with a simple file. If this is possible, how does one add it to an existing build system? [Note: I'm a self-taught newb working on a hobby project, please be explicit. Thanks.]

svlasov
  • 9,923
  • 2
  • 38
  • 39
justinzane
  • 1,897
  • 1
  • 26
  • 38

1 Answers1

0

Based on what you've stated so far, I'll say that what you're seeing is a signal-handler food fight between the OpenMP and profiling runtime libraries -- the profiling runtime uses the POSIX profiling timer, which generates SIGPROF when it expires, but the OpenMP runtime clobbered the SIGPROF handler for the process with the default handler when it was setting up signal handlers.

It appears that OpenMP itself provides some sort of profiling API, but GCC support for it is on the back burner.

LThode
  • 1,843
  • 1
  • 17
  • 28