llvm-ffi: FFI bindings to the LLVM compiler toolkit.
This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.
FFI bindings to the LLVM compiler toolkit.
Installation cannot be done fully automatically. It would require Cabal code that is bound to certain Cabal versions and is prone to fail. We give several non-automatic ways that also allow you to choose a particular LLVM version.
First possibility is to point Cabal
to the LLVM installation directories manually.
It is recommended to add options to your global .cabal/config
:
extra-include-dirs: /usr/lib/llvm-17/include extra-lib-dirs: /usr/lib/llvm-17/lib
This works for both v1-build
and v2-build
.
The shown paths work for Debian and Ubuntu
using the LLVM repositories at https://apt.llvm.org/.
You can obtain them with
llvm-config-17 --includedir --libdir
You can choose specific LLVM versions per project.
For v1-builds
it works like so:
cabal install -fllvm1300 --extra-include-dirs=$(llvm-config-13 --includedir) --extra-lib-dirs=$(llvm-config-13 --libdir) yourpackage
For Nix-style build you must add some options
to the cabal.project.local
file of your LLVM-related project:
package llvm-ffi flags: +llvm1300 extra-include-dirs: /usr/lib/llvm-13/include extra-lib-dirs: /usr/lib/llvm-13/lib
The second way uses pkg-config
.
You can store above paths permanently in a pkg-config
file like llvm.pc
.
The optimal way would be if LLVM installations or GNU/Linux distributions
would contain such a file, but they don't.
Instead, you may generate it using the llvm-pkg-config
package
or write one manually.
Then you run
cabal install -fpkgConfig
We try to stay up to date with LLVM releases. The current version of this package is compatible with LLVM 8-17. Please understand that the package may or may not work against older LLVM releases.
Warning for inplace builds:
Re-configuring the package using, say -fllvm1100
,
and re-buildung it might result in corrupt code.
You must make sure that the stuff in cbits
is re-compiled.
Cabal or GHC may forget about that.
You are safe if you run cabal clean
.
Caution: Ugly crashes can occur
if you have configured paths for LLVM version X in .cabal/config
and try to build llvm-ffi
for a different LLVM version Y.
Counterintuitively, global search paths have higher precedence
than local ones: https://github.com/haskell/cabal/issues/7782.
But that does not simply mean
that the local configuration is ignored completely.
Instead the local library file is found,
because its name libLLVM-Y.so is unique,
whereas the include file names clash,
thus the ones from the global include directory are used.
Properties
Versions | 3.0.0, 3.0.0.1, 3.0.0.2, 3.1.0, 3.2.0, 3.2.1, 3.3.0, 3.4.0, 3.5.0, 3.5.1, 3.6.0, 3.7.0, 3.8.0, 3.8.1, 3.8.1.1, 3.8.1.2, 3.9.0, 3.9.1, 9.0.0, 9.1.0, 9.1.0.1, 9.1.1, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0 |
---|---|
Change log | None available |
Dependencies | base (>=3 && <5), enumset (>=0.0.5 && <0.2) [details] |
License | BSD-3-Clause |
Author | Henning Thielemann, Bryan O'Sullivan, Lennart Augustsson |
Maintainer | Henning Thielemann <llvm@henning-thielemann.de> |
Category | Compilers/Interpreters, Code Generation |
Home page | http://haskell.org/haskellwiki/LLVM |
Source repo | head: darcs get https://hub.darcs.net/thielema/llvm-ffi/ this: darcs get https://hub.darcs.net/thielema/llvm-ffi/ --tag 17.0 |
Uploaded | by HenningThielemann at 2023-10-08T20:13:08Z |
Modules
- LLVM
- FFI
- LLVM.FFI.Analysis
- LLVM.FFI.BitReader
- LLVM.FFI.BitWriter
- LLVM.FFI.Core
- LLVM.FFI.Core.Attribute
- LLVM.FFI.Error
- LLVM.FFI.ExecutionEngine
- Support
- LLVM.FFI.Support.Host
- LLVM.FFI.Target
- LLVM.FFI.TargetMachine
- Transforms
- LLVM.FFI.Transforms.PassBuilder
- Target
- LLVM.Target.Native
- FFI
Flags
Manual Flags
Name | Description | Default |
---|---|---|
developer | developer mode - warnings let compilation fail | Disabled |
buildexamples | Build example executables | Disabled |
pkgconfig | use pkgconfig (llvm.pc) instead of extra-libraries | Disabled |
specificpkgconfig | use llvm-x.pc instead of llvm.pc | Enabled |
llvm1300 | use LLVM-13 instead of latest supported LLVM | Disabled |
llvm1400 | use LLVM-14 instead of latest supported LLVM | Disabled |
llvm1500 | use LLVM-15 instead of latest supported LLVM | Disabled |
llvm1600 | use LLVM-16 instead of latest supported LLVM | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- llvm-ffi-17.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
Package maintainers
For package maintainers and hackage trustees