llvm icon indicating copy to clipboard operation
llvm copied to clipboard

Trying to build llvm bindings for legacy code

Open worldsayshi opened this issue 10 years ago • 6 comments

Hi, as part of a free time project I've tried and failed multiple times to get this project to build. I'm stuck at getting these llvm bindings to build. I gave up trying to get llvm-0.10.0.1 to build (the actual dependency). it seemed just to old.

The last couple of tries I've tried to get llvm-3.2.0.2 to build. At least now I can use Vagrant to get an environment that is more likely to work, Currently "precise32". So I have installed llvm 2.9 and clang 2.9 with apt-get. At least that worked now. But when I try to build llvm-3.2.0.2 llvm-base-3.2.0.2 complains about missing c headers (Core.h, Linker.h). I've managed to hack myself past some such problems but there are always new ones. Seems there is some version discrepancy.

Most preferably I would get llvm-0.10.0.1 to build though.

Does anyone have any pointers for getting at least one of the versions of the llvm bindings to build on an ubuntu machine (precise pangolin or other - I'm using Vagrant so I can easily change)? What version of build tools do I need (g++/gcc)? Any recommendations?

worldsayshi avatar Jan 22 '15 22:01 worldsayshi

I'd suggest trying to port Hydra to use LLVM-General rather than llvm/llvm-base, as a more effective use of your time. There may be ways to travel "back in time", but you'll be putting yourself in a configuration that doesn't have anyone actively supporting it. In contrast, if you can migrate hydra to llvm-general, it'll become accessible to a lot more people!

cartazio avatar Jan 22 '15 23:01 cartazio

I realize this may not be the answer you were hoping to hear, but if upstream support while trying to get hydra in shape to play with matters, llvm-general is the way to role (and that would be REALLY AWESOME too)

cartazio avatar Jan 23 '15 02:01 cartazio

I do realize that this is the way to go in the long term. However, it would be really useful to have a running version of Hydra to try out before venturing into such port (although it would lessen the motivation for doing so). The llvm bindings are used quite a bit throughout Hydra and my understanding of what is happening inside Hydra is far from complete. Thanks for the quick answer though. At least now I have another opinion for supporting such venture. It's either that or I'll try to do a Hydra rewrite.

worldsayshi avatar Jan 23 '15 08:01 worldsayshi

I am working on a fork of llvm-base/llvm, namely llvm-ffi/llvm-tf that is closer to the original project than llvm-general. It may be easier to adapt Hydra to that. The main difference to the original project is that I use type families rather than functional dependencies, especially I use the tfp package instead of type-level.

amigalemming avatar Aug 01 '16 15:08 amigalemming

Then I'll hope that I'll get around at giving this pet project of mine another try soon.

worldsayshi avatar Sep 05 '16 11:09 worldsayshi

Yesterday I released the two packages: https://hackage.haskell.org/package/llvm-ffi https://hackage.haskell.org/package/llvm-tf They support LLVM-3.4 to LLVM-3.8 and GHC-7.4 to GHC-8.0. However, be aware of the special installation instructions of llvm-ffi with respect to pkg-config.

amigalemming avatar Sep 05 '16 11:09 amigalemming