On Saturday, 23 March 2013 at 10:01:19 UTC, Moritz Maxeiner wrote:
No problem at all. There is an example quoted in the README and how to compile it, so without further information form your side I don't know what the problem is. To get the example from the README working: - Download/Clone the github repo into a folder (let's say llvm-d)
- cd into that folder
- execute rdmd -L-ldl sample/multithreaded.d

The need for the -dl flag is only for POSIX platforms and will be gone with the next commit as I have included a lib pragma.

If the above doesn't help could you please tell me what exactly you have done and at which point you have the problems?

-- Moritz

Thanks so much.

I had dub upgrade the llvm-d package and now I have different problems. That said, I do have a working example (as long as rdmd is used).

I have updated the gist (with repro steps): https://gist.github.com/Zshazz/c7dbd6eee0b6b242252b

I'm running LLVM 3.2, so the example given in the README doesn't work. But the code in the gist works as long as you run 'dub --rdmd', so that's some progress! Not really sure about the linking problems without rdmd. This is sufficient to start some work with it to really try some things out, though.

I'll keep messing around with it. It seems like you already know that JIT doesn't work because we need InitializeNativeTarget.

That all said, the tutorials, instructions, and documentation for the C API of LLVM is pretty sparse. The best I've seen to figure out how things work is to go through http://llvm.org/doxygen/modules.html and piece together (very slowly) how something might work. I'm also having to cross reference tutorials made for the C++ API and figure out how to make it work in C by reading the raw source code to get the equivalent calls. Fortunately I did find that one post that gave a close-to-complete example in C. Is there any better way to do this at this point?

Thanks again.

Reply via email to