Giter Club home page Giter Club logo

mlir-hs's Introduction

mlir-hs - Haskell bindings for MLIR

๐Ÿšจ This is an early-stage project. All details are subject to arbitrary changes. ๐Ÿšจ

Note that the main branch tracks the current HEAD of LLVM and so it is likely to be incompatible with any past releases. We are planning to provide release-specifi branches in the future, but only once the API stabilizes. For now your best bet is to develop against MLIR built from source. See the Building MLIR from source section for guidance.

Building

The only prerequisite for building mlir-hs is that you have MLIR installed somewhere, and the llvm-config binary from that installation is available in your PATH (a good way to verify this is to run which llvm-config).

If that's looking reasonable, we recommend using Stack for development. To build the project simply run stack build, while the test suite can be executed using stack test.

Building MLIR from source

The instructions below assume that you have cmake and ninja installed. You should be able to get them from your favorite package manager.

  1. Clone the latest LLVM code (or use git pull if you cloned it before) into the root of this repository

    git clone https://github.com/llvm/llvm-project
  2. Create a temporary build directory

    mkdir llvm-project/build
  3. Configure the build using CMake. Remember to replace $PREFIX with the directory where you want MLIR to be installed. See LLVM documentation for extended explanation and other potentially interesting build flags.

    cmake -B llvm-project/build           \
      -G Ninja                            \ # Use the Ninja build system
      -DCMAKE_INSTALL_PREFIX=$PREFIX      \ # Install prefix
      -DLLVM_BUILD_LLVM_DYLIB=ON            # Build shared libraries

    For development purposes we additionally recommend using -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_ASSERTIONS=ON to retain debug information and enable internal LLVM assertions. If one changes the install directory (CMAKE_INSTALL_PREFIX) then one needs to add this directory to PATH and LD_LIBRARY_PATH for the subsequent builds (e.g., stack) to find it.

  4. Build and install MLIR. Note that it uses the installation prefix specified in the previous step.

    cd llvm-project/build && ninja install llvm-project/llvm/install

Contributing

Contributions of all kinds are welcome! If you're planning to implement a larger feature, consider posting an issue so that we can discuss it before you put in the work.

License

See the LICENSE file.

mlir-hs is an early-stage project, not an official Google product.

mlir-hs's People

Contributors

apaszke avatar jpienaar 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.