Skip to content
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

external functions in mcjit #193

Closed
sfultong opened this Issue Mar 28, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@sfultong
Copy link

sfultong commented Mar 28, 2018

I want to be able to use external functions (either defined in C or Haskell with foreign export) in mcjit. If it's already possible with these bindings, I haven't been able to figure it out.

If it is possible, I would pay to see example code.

If it isn't possible, I am interested in paying for development efforts to make it possible.

@cocreature

This comment has been minimized.

Copy link
Member

cocreature commented Mar 29, 2018

How tied are you to MCJIT? The ORC JIT API should generally be more powerful and flexible and I wouldn’t be surprised if LLVM itself drops the MCJIT API in the near future.sure if the A

I was planning to write up some example code for calling C functions in dynamic libraries from ORC JIT for some time, so I’ll try to get to this over the next few days. (I think it should be possible using the current API but I’ve never tried it).

For MCJIT I am honestly not sure if it’s possible and I would prefer to spend development efforts on ORC JIT.

@sfultong

This comment has been minimized.

Copy link
Author

sfultong commented Mar 29, 2018

Oh, I wasn't aware of the ORC JIT! I'm certainly not tied to MCJIT.

Thanks for the info. I'll evaluate ORC and close this issue if I can use it.

@sdiehl

This comment has been minimized.

Copy link
Member

sdiehl commented Mar 31, 2018

Here are some examples if you're looking to use ORC JIT:
https://github.com/llvm-hs/llvm-hs-examples/tree/master/orc

@cocreature

This comment has been minimized.

Copy link
Member

cocreature commented Mar 31, 2018

FTR I’m working on a blogpost on how to call functions in static and dynamic libraries using ORC JIT. Should hopefully be ready in the next few days.

@cocreature

This comment has been minimized.

Copy link
Member

cocreature commented Apr 2, 2018

Here’s the blog post. Hopefully, it should answer your question @sfultong.

@sfultong

This comment has been minimized.

Copy link
Author

sfultong commented Apr 3, 2018

Thanks @cocreature !

@sfultong sfultong closed this Apr 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.