
My HOpenGL programs seems not to work well with GHC profiling. If I compile any program with the -prof option, when I run the program I get an "illegal operation" message and the program aborts. For example, this happens with the following simple program (it does not have any _scc_ at all): import GL import GLUT main :: IO () main = do GLUT.init Nothing createWindow "AWBF Bitmap Display" (return ()) [ GLUT.Double, GLUT.Rgb ] (Just (WindowPosition 100 100)) (Just (WindowSize 250 250)) mainLoop I'm running HOpenGL-1.01 (NEW pack) and GHC-5.02 under Windows98. Can you all (HOpenGL users) check if you also have this problem? -- Andre

Andre W B Furtado wrote:
[...] I'm running HOpenGL-1.01 (NEW pack) and GHC-5.02 under Windows98. Can you all (HOpenGL users) check if you also have this problem?
About a week ago I used profiling with HOpenGL with a GHC-5.03 under Linux and it worked fine, but I haven't tried profiling under WinDoze for a long time. Anyway, I guess this is more a plattform problem than a HOpenGL one. Does profiling of simple "Hello, world!"-programs work? Cheers, S.

Andre W B Furtado wrote:
[...] I'm running HOpenGL-1.01 (NEW pack) and GHC-5.02 under Windows98. Can you all (HOpenGL users) check if you also have this problem?
About a week ago I used profiling with HOpenGL with a GHC-5.03 under Linux and it worked fine, but I haven't tried profiling under WinDoze for a long time. Anyway, I guess this is more a plattform problem than a HOpenGL one. Does profiling of simple "Hello, world!"-programs work?
People at glasgow-haskell-users list said that is not possible to work with profiling when part of a program was not compiled with the profiling options. In my case, HOpenGL was not compiled with profiling options, so when I try to work with profiling in a HOpenGL program, I'm supposed to get a strange behavior. So I ask: is there a better way to build a profiling-enabled HOpenGL version than "hacking" config.mk to add the -prof option to the HC_OPTS? -- Andre

Andre W B Furtado wrote:
[...] is there a better way to build a profiling-enabled HOpenGL version than "hacking" config.mk to add the -prof option to the HC_OPTS?
You can pass configure a full path to ghc, including options: ./configure --with-hc="/usr/bin/ghc -prof -auto-all" Setting the HC environment variable before is another way IIRC. Cheers, S.

When I use profiling with HOpenGL, the

Andre W B Furtado wrote:
When I use profiling with HOpenGL, the
file is empty (0 bytes) unless I change "mainLoop" for "return ()" in . Obviously, this program will terminate just after the window is created.
Alas, this is not HOpenGL-specific...
Does anyone know the reason for this? (I'm using HOpenGL-1.01, GHC-5.02.1 under Windows98 + cygwin).
The reason is that the only way to exit GLUT programs is via System.exitWith
or System.exitFailure. But GHC's RTS currently doesn't like calls to these
functions in callbacks, so the program terminates abnormally and nothing is
written to
participants (3)
-
Andre W B Furtado
-
Sven Panne
-
Sven Panne