GithubHelp home page GithubHelp logo

llbc's Introduction

A Python script to utilize LLVM bytecode, include building, cleaning, and running LLVM bytecode.

###1. Why llbc? The key motivation for llbc is I cannot using existing building tools, like CMake, scons and makefile, to utilize LLVM bytecode. Although building LLVM bytecode is quite similar to compiling native C++ code, linking and running are quite different. In C++, we need to specify the linking directories and linking libraries. But we don't do that in llvm-link. Instead, we specify the linking libraries when running the target, using -load=XX.

Thus, I feel it's quite not consistency with using CMake or makefile. So I write this script to generate LLVM bytecode and to run it.

###2. How to use it? First of all, it's a python script, and that means you need to write python code.

Second, you need to write an Env class in llbc.py, like this:

     class Env:
          LLVM_BIN_DIR = '/Users/xuepengfan/tools/llvm-build/bin/'
          SRC_LIST = [ os.path.join(os.getcwd(), x) for x in srcs]
          TARGET = 'bq_llvm'
          INCLUDE_DIRECTORIES = [os.path.join(os.getcwd(), '../ff/include/')]
          CXX_FLAGS=['-DUSING_FF_NONBLOCKING_QUEUE', '-DNDEBUG']
          LINK_DIRECTORIES = [os.path.join(os.getcwd(), '../bin/')]
          LINK_LIBS = ['boost_program_options', 'ff', 'pthread']

Third, run the python script!

    python llbc.py -gen  #This will build your project!
    python llbc.py -clean  #This will remove all generated files!
    python llbc.py -run   #This will run the targeted bin with llvm!

###Have Fun!

llbc's People

Contributors

athrunarthur avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.