Skip to content

hexops-graveyard/llvm-go-bindings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

llvm-go-bindings

Scripts for building the LLVM Go BIndings (including on Windows)

Context

The LLVM project has some excellent Go bindings but, unfortunately, building them is extremely difficult for people unfamiliar with building C++ projects. Additionally, it is impossible currently to compile them on Windows with MSYS (i.e. without Cygwin).

This repository provides a script and concise instructions for building the LLVM Go bindings on Windows, Linux, and Mac OS easily.

Prerequisites

Windows

  1. Install Go 1.12+.
  2. Install Git for Windows.
  3. Install LLVM 9.0.0 (see Pre built binaries section at bottom).
  4. Install MinGW-w64 via MSYS2:
    • Choose the msys2-x86_64 version.
  5. Install MSYS2 tools:
    • Launch a MSYS2 MinGW 64-bit command prompt
    • pacman -S git make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-python3 mingw-w64-x86_64-go

IMPORTANT: Windows Defender and other antivirus applications can slow down compilation by orders of magnitude, disable them before continuing!

Follow the steps provided below using a MSYS2 MinGW 64-bit command prompt.

Mac OS

Work in progress, please file an issue if you are interested in trying this.

Linux

Work in progress, please file an issue if you are interested in trying this.

Building with prebuilt LLVM binaries

Work in progress.

Building from source

This will download 1.5 GiB (the LLVM Git repository) and on a modern i7 laptop (i7-9750H + 16 GB RAM) will take approximately 60 minutes to complete.

From a shell, execute:

curl -Ls https://github.com/hexops/llvm-go-bindings/raw/master/installer.sh | sh

The LLVM repository will be checked out into $GOPATH/src/llvm.org and the bindings can be imported as:

import "llvm.org/llvm/llvm/bindings/go/llvm"

GoDoc can be viewed at https://godoc.org/llvm.org/llvm/bindings/go/llvm

Known issues with Go LLVM bindings

There are some known issues with the Go LLVM bindings, which I've filed here:

About

Scripts for building the LLVM Go BIndings (including on Windows)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages