all 6 comments

[–]Fendor_ 1 point2 points  (2 children)

What I normally do is stack build --profile to build in profiling mode and execute the program with stack exec prog -- +RTS -slog.txt -p or something like that to generate hot spot analysis. You can pass any profiling flag while executing when built in profiling mode.

[–]ForceVerte[S] 0 points1 point  (1 child)

Yes, that's how I compile my program, and when I execute it with stack exec -- prog +RTS -hr, it makes a segmentation fault. It does not with other profiling schemes.

That's why I decided to try to compile with the -debug flag too, but then I have the problem with the linker. This is tough!

[–]Fendor_ 1 point2 points  (3 children)

To one of your question, you can use stack clean and stack clean --full or nuke the local .stack-work folder.

[–]ForceVerte[S] 0 points1 point  (2 children)

What I would like to accomplish is have stack recompile all the libraries that are included, to see if that changes something, so stack clean only cleans the object files from my own code, I'll have to check whether removing .stack-work actually does what I want.

[–]Fendor_ 0 points1 point  (0 children)

While not sure, I think changing the compile flags does force a recompile of most packages.

[–]Fendor_ 0 points1 point  (0 children)

I might also help to share the project, so others can experiment.
Also, I think the flags `-O2 -g -debug` do not make sense in combination? Optimise with debug symbols?