diff --git a/compiler/Makefile b/compiler/Makefile index 29998197d..1cef501f5 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -1,14 +1,25 @@ build: - cmake -B build . \ + cmake -B build -GNinja ${LLVM_PROJECT}/llvm/ \ + -DLLVM_ENABLE_PROJECTS=mlir \ + -DLLVM_BUILD_EXAMPLES=OFF \ + -DLLVM_TARGETS_TO_BUILD="host" \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_ASSERTIONS=ON \ + -DMLIR_ENABLE_BINDINGS_PYTHON=ON \ -DLLVM_DIR=${LLVM_PROJECT}/build/lib/cmake/llvm \ -DMLIR_DIR=${LLVM_PROJECT}/build/lib/cmake/mlir \ - -DCONCRETE_FFI_RELEASE=${CONCRETE_PROJECT}/target/release + -DCONCRETE_FFI_RELEASE=${CONCRETE_PROJECT}/target/release \ + -DLLVM_EXTERNAL_PROJECTS=zamalang \ + -DLLVM_EXTERNAL_ZAMALANG_SOURCE_DIR=. -build-end-to-end-jit: - make -C build/ end_to_end_jit_test +build-end-to-end-jit: build + cmake --build build --target end_to_end_jit_test -zamacompiler: - make -C build/ zamacompiler +zamacompiler: build + cmake --build build --target zamacompiler + +python-bindings: build + cmake --build build --target ZamalangBindingsPython test-check: zamacompiler ${LLVM_PROJECT}/build/bin/llvm-lit -v tests/ @@ -18,5 +29,5 @@ test-end-to-end-jit: build-end-to-end-jit test: test-check test-end-to-end-jit -test_python: - pytest -v tests/python \ No newline at end of file +test-python: python-bindings + PYTHONPATH=${PYTHONPATH}:./build/tools/zamalang/python:./build/python LD_PRELOAD=./build/lib/libZamalangRuntime.so pytest -v tests/python \ No newline at end of file diff --git a/compiler/include/zamalang/Conversion/CMakeLists.txt b/compiler/include/zamalang/Conversion/CMakeLists.txt index 578527e23..dcd8c8885 100644 --- a/compiler/include/zamalang/Conversion/CMakeLists.txt +++ b/compiler/include/zamalang/Conversion/CMakeLists.txt @@ -1,6 +1,6 @@ set(LLVM_TARGET_DEFINITIONS Passes.td) mlir_tablegen(Passes.h.inc -gen-pass-decls -name Conversion) -add_public_tablegen_target(MLIRConversionPassIncGen) +add_public_tablegen_target(ZamalangConversionPassIncGen) add_subdirectory(HLFHEToMidLFHE) diff --git a/compiler/include/zamalang/Dialect/HLFHE/Analysis/CMakeLists.txt b/compiler/include/zamalang/Dialect/HLFHE/Analysis/CMakeLists.txt index 71fc391bf..85f5317dd 100644 --- a/compiler/include/zamalang/Dialect/HLFHE/Analysis/CMakeLists.txt +++ b/compiler/include/zamalang/Dialect/HLFHE/Analysis/CMakeLists.txt @@ -4,4 +4,3 @@ mlir_tablegen(MANP.capi.h.inc -gen-pass-capi-header --prefix Analysis) mlir_tablegen(MANP.capi.cpp.inc -gen-pass-capi-impl --prefix Analysis) add_public_tablegen_target(MANPPassIncGen) -add_mlir_doc(MANP GeneralPasses ./ -gen-pass-doc) diff --git a/compiler/lib/Runtime/CMakeLists.txt b/compiler/lib/Runtime/CMakeLists.txt index 0019be33d..ca71ffbee 100644 --- a/compiler/lib/Runtime/CMakeLists.txt +++ b/compiler/lib/Runtime/CMakeLists.txt @@ -3,4 +3,7 @@ add_library(ZamalangRuntime SHARED wrappers.c ) -target_link_libraries(ZamalangRuntime Concrete pthread m dl) \ No newline at end of file +target_link_libraries(ZamalangRuntime Concrete pthread m dl) + +install(TARGETS ZamalangRuntime EXPORT ZamalangRuntime) +install(EXPORT ZamalangRuntime DESTINATION "./") \ No newline at end of file diff --git a/compiler/lib/Support/Pipeline.cpp b/compiler/lib/Support/Pipeline.cpp index f606bd409..6c678439f 100644 --- a/compiler/lib/Support/Pipeline.cpp +++ b/compiler/lib/Support/Pipeline.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include