mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-10 04:35:03 -05:00
This commit contains several incremental improvements towards a clear
interface for lambdas:
- Unification of static and JIT compilation by using the static
compilation path of `CompilerEngine` within a new subclass
`JitCompilerEngine`.
- Clear ownership for compilation artefacts through
`CompilationContext`, making it impossible to destroy objects used
directly or indirectly before destruction of their users.
- Clear interface for lambdas generated by the compiler through
`JitCompilerEngine::Lambda` with a templated call operator,
encapsulating otherwise manual orchestration of `CompilerEngine`,
`JITLambda`, and `CompilerEngine::Argument`.
- Improved error handling through `llvm::Expected<T>` and proper
error checking following the conventions for `llvm::Expected<T>`
and `llvm::Error`.
Co-authored-by: youben11 <ayoub.benaissa@zama.ai>
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