Giter VIP home page Giter VIP logo

sclang's Introduction

SCLANG

sclang is an work-in-progress SCL compiler using LLVMs MLIR infrastructure.

Instead of generating AWL or machine code for S7, it directly targets the host computer. Goal is to provide a fast compiler and runtime to run unit and integration tests for large SCL projects.

Current status: parsing SCL files works quite well, code generation only works for a very limited subset of expressions.

BUILDING

MLIR is still in active development and Sclang is regularly updated to follow that development. A compatible version of llvm-project/mlir is provided as submodule. You can choose to build it using either CMake or Bazel. Both MacOS and Linux are supported.

Check out sources

git clone --recursive https://github.com/tali/sclang
cd sclang

Note: The repository is set up so that git submodule update performs a shallow clone, meaning it download just enough of the LLVM repository to check out the currently specified commit. If you wish to work with the full history of the LLVM repository, you can manually "unshallow" the submodule:

cd third_party/llvm-project
git fetch --unshallow

Build using CMake

cmake -B build -S third_party/llvm-project/llvm -GNinja \
	-DBUILD_SHARED_LIBS=OFF \
	-DLLVM_ENABLE_ASSERTIONS=ON \
	-DLLVM_ENABLE_PROJECTS="mlir" \
	-DLLVM_EXTERNAL_PROJECTS=sclang \
	-DLLVM_EXTERNAL_SCLANG_SOURCE_DIR=$PWD \
	-DLLVM_TARGETS_TO_BUILD=X86 \
	-DCMAKE_BUILD_TYPE=Release
# alternatively use CMAKE_BUILD_TYPE=DEBUG
cmake --build build --target check-sclang

Build using Bazel

bazel test --config=generic_clang //test
# alternatively:
bazel test --config=generic_gcc //test

sclang's People

Contributors

tali avatar

Stargazers

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