From cb0e8b0e98b7e883124b50f2f5acc6e3a4bfff49 Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" Date: Tue, 28 Sep 2021 11:58:02 +0200 Subject: [PATCH] doc(compiler): update the instructions to build and test the compiler in the README --- compiler/README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/compiler/README.md b/compiler/README.md index 4e1ecfa05..53765a834 100644 --- a/compiler/README.md +++ b/compiler/README.md @@ -1,15 +1,44 @@ # Building the compiler +Install MLIR following https://mlir.llvm.org/getting_started/ +Use commit c2415d67a564 + +Install pybind11: + +```sh +pip install pybind11 +``` + +Build concrete library: + +```sh +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 ```sh -cmake -B build . -DLLVM_DIR=$LLVM_PROJECT/build/lib/cmake/llvm -DMLIR_DIR=$LLVM_PROJECT/build/lib/cmake/mlir +export LLVM_PROJECT="PATH_TO_LLVM_PROJECT" +export CONCRETE_PROJECT="PATH_TO_CONCRETE_PROJECT" +make build ``` Build the compiler ```sh -make -C build/ zamacompiler +make zamacompiler +``` + +Test the compiler + +```sh +#TODO: let cmake set this PATH +export LD_LIBRARY_PATH="path_to_homomorphizer/compiler/build/lib/Runtime/" +make test ``` Run the compiler