Skip to content

Use external interpreter when compiling with profiling #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mrkkrp opened this issue Jul 16, 2018 · 4 comments
Closed

Use external interpreter when compiling with profiling #338

mrkkrp opened this issue Jul 16, 2018 · 4 comments

Comments

@mrkkrp
Copy link
Member

mrkkrp commented Jul 16, 2018

Currently (as of #332) to compile modules that use TH with profiling we also compile them without profiling because RTS that GHC is linked with is without profiling and so it needs object files without profiling to run TH. This is not very nice and probably less efficient than using the newer -fexternal-interpreter that was introduced in GHC 8.0 to solve exactly that problem.

See also:

@mrkkrp
Copy link
Member Author

mrkkrp commented Jul 29, 2018

I tried to mess with this one today and discovered the following:

  • To register a package dynamic library has to be present, otherwise ghc-pkg complains.
  • We still cannot compile dynamic library with profiling because GHC doesn't come with dynamic object files with profiling enabled. -fexternal-interpreter doesn't seem to help in that case.

@mboes
Copy link
Member

mboes commented Jul 29, 2018

Could we use ghc-pkg --force here? It looks safe to me in this case, but you'd have to think carefully about whether that's really the case.

@mrkkrp
Copy link
Member Author

mrkkrp commented Jul 31, 2018

An update: while working on "arbitrary file layouts" I noticed that -fexternal-interpreter probably should work if we don't set extensions to anything non standard. GHC should pick whatever it wants, i.e. just plain .o then it should start working.

@guibou
Copy link
Contributor

guibou commented Jan 25, 2019

I wonder if this issue can be closed, apparently rules_haskell is already using -fexternal-interpreter, see the discussion in #438 for details.

@mboes mboes closed this as completed Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants