lahiri-phdworks / LLVM-Examples

LLVM Repository and Code samples. LLVM Passes and quick bytes.

Home Page:https://hub.docker.com/r/prodrelworks/llvm-examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LLVM-Examples

LLVM Examples and Code samples. LLVM Passes. Based on llvm-project Clone the LLVM Repository in the $HOME directory or change the paths in the MAKEFILEs to point to the build directory of the LLVM.

# Clone
$ git clone https://github.com/llvm/llvm-project.git

# Change directory
$ cd llvm-project

# Install the essential packages with make and cmake.
$ sudo apt-get install make ninja ninja-build cmake cmake-data binutils build-essentials python3 python3-pip

# llvm cmake command 
$ cmake \
    -S llvm -B build -Wno-dev -GNinja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLLVM_ENABLE_PROJECTS="llvm;compiler-rt;clang;clang-tools-extra;lldb;lld;mlir" \
    -DLLVM_BUILD_RUNTIMES="libcxx;libcxxabi" \
    -DLLVM_BINUTILS_INCDIR=$HOME/binutils/include \
    -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_ENABLE_RTTI=ON \
    -DLLVM_ENABLE_FFI=ON \
    -DLLVM_BUILD_TESTS=ON \
    -DLLVM_INSTALL_UTILS=ON

$ cd build && ninja -j10 all

Installing from Docker

Check build commands in the Dockerfile for more information on installing LLVM on local machine.

$ docker build -f DockerFile -t prodrelworks/llvm-examples:latest .
$ docker run --name llvm-examples --ulimit stack=10000000:10000000 \
  --cpus=4 --memory=20g -it prodrelworks/llvm-examples:latest

Running Examples.

$ cd NewPMExample
$ make clean
$ make all

Examples & Implementations :

References & Links :

About

LLVM Repository and Code samples. LLVM Passes and quick bytes.

https://hub.docker.com/r/prodrelworks/llvm-examples

License:GNU General Public License v2.0


Languages

Language:LLVM 49.8%Language:C++ 23.4%Language:Makefile 8.5%Language:CMake 6.9%Language:C 5.7%Language:TeX 5.6%Language:Shell 0.1%