kclvm/

directory
v0.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: Apache-2.0

README

KCLVM

A high-performance implementation of KCL written in Rust that uses LLVM as the compiler backend.

Building and Testing

Firstly, see KCLVM CONTRIBUTING to build KCLVM. Secondly, we need to download the Rust, SWIG, LLVM 12, and add the LLVM installation location to LLVM_SYS_120_PREFIX and the $PATH.

export LLVM_SYS_120_PREFIX=<your LLVM 12 install location>
export PATH=<your LLVM 12 install location>/bin:$PATH

To build everything, run:

make

After building, we can add the following command line parameters to use the KCL high-performance version:

kclvm_cli run main.k

To test, run:

make test

Building and Testing in Docker

  1. make -C .. sh-in-docker
  2. make build
  3. export PATH=$PATH:/root/kclvm/_build/dist/ubuntu/kclvm/bin
  4. kcl ./samples/hello.k
  5. cd kclvm && make test

IDE

You can choose any IDE you like for development, but we recommend a combination of VS Code and the rust-analyzer plugin.

Notes

  1. If you encounter problems compiling KCLVM and using LLVM 12 on Apple M1, you can refer to the documentation
  2. If you wanna start over, you MUST clean up all cached building files, such as LLVM build files, kclvm/target, etc.
  3. If your updating-cargo-index is extremely slow, setup ~/.cargo/config file.
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'

[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

Directories

Path Synopsis
runtime

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL