mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 20:25:34 -05:00
By default, `mlir::SourceMgrDiagnosticVerifierHandler` used by `CompilerEngine::compile()` prints parse errors to `llvm::errs()`. This makes it impossible for a caller of `CompilerEngine::compile()` to process parse errors or to suppress the emission of error messages to the standard error stream altogether. This change captures parse errors in a string via a string-backed output stream and forwards the error message in the `llvm::Error` instance of the return value.
Building the compiler
Install MLIR following https://mlir.llvm.org/getting_started/ Use commit c2415d67a564
Install pybind11:
pip install pybind11
Build concrete library:
git clone https://github.com/zama-ai/concrete
cd concrete
git checkout feature/core_c_api
cd concrete-ffi
RUSTFLAGS="-C target-cpu=native" cargo build --release
Generate the compiler build system, in the build directory
export LLVM_PROJECT="PATH_TO_LLVM_PROJECT"
export CONCRETE_PROJECT="PATH_TO_CONCRETE_PROJECT"
make build
Build the compiler
make zamacompiler
Test the compiler
#TODO: let cmake set this PATH
export LD_LIBRARY_PATH="path_to_homomorphizer/compiler/build/lib/Runtime/"
make test
Run the compiler
./build/src/zamacompiler