build: setup target and tools for building tarballs

This commit is contained in:
youben11
2021-10-28 12:13:19 +01:00
committed by Ayoub Benaissa
parent dc2d6a362e
commit 941465060e
3 changed files with 39 additions and 3 deletions

View File

@@ -2,7 +2,14 @@
The homomorphizer is a compiler that takes a high level computation model and produces a programs that evaluate the model in an homomorphic way.
## Build tarball
The final tarball contains intallation instructions. We only support Linux x86_64 for the moment. You can find the output tarball under `/tarballs`.
```bash
$ cd compiler
$ make release_tarballs
```
## Build the Python Package

View File

@@ -0,0 +1,23 @@
FROM quay.io/pypa/manylinux_2_24_x86_64
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential ninja-build
# Setup LLVM
COPY /llvm-project /llvm-project
# Setup Concrete
COPY --from=ghcr.io/zama-ai/concrete-api-env:latest /target/release /concrete/target/release
ENV CONCRETE_PROJECT=/concrete
# Setup and build compiler
COPY /compiler /compiler
WORKDIR /compiler
RUN make BINDINGS_PYTHON_ENABLED=OFF zamacompiler
# Build tarball
RUN mkdir -p /tarballs/zamacompiler/lib /tarballs/zamacompiler/bin && \
cp /compiler/build/bin/zamacompiler /tarballs/zamacompiler/bin && \
cp /compiler/build/lib/libZamalangRuntime.so /tarballs/zamacompiler/lib
RUN echo "# Installation\n"\
"You can install the compiler by either:\n"\
"1. Extracting the tarball as is somewhere of your choosing, and add /path/to/tarball/zamacompiler/bin to your \$PATH\n"\
"2. Extracting the tarball and putting the bin/zamacompiler into a path already in your \$PATH, and lib/libZamalangRuntime.so into one of your lib folders (e.g /usr/lib)"\
>> /tarballs/zamacompiler/Installation.md
RUN cd /tarballs && tar -czvf zamacompiler.tar.gz zamacompiler

View File

@@ -1,5 +1,6 @@
BUILD_DIR=./build
Python3_EXECUTABLE=
BINDINGS_PYTHON_ENABLED=ON
$(BUILD_DIR)/configured.stamp:
@@ -9,8 +10,8 @@ $(BUILD_DIR)/configured.stamp:
-DLLVM_TARGETS_TO_BUILD="host" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DZAMALANG_BINDINGS_PYTHON_ENABLED=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON=$(BINDINGS_PYTHON_ENABLED) \
-DZAMALANG_BINDINGS_PYTHON_ENABLED=$(BINDINGS_PYTHON_ENABLED) \
-DCONCRETE_FFI_RELEASE=${CONCRETE_PROJECT}/target/release \
-DLLVM_EXTERNAL_PROJECTS=zamalang \
-DLLVM_EXTERNAL_ZAMALANG_SOURCE_DIR=. \
@@ -65,6 +66,10 @@ package_py39:
package_py310:
$(call build_image_and_copy_wheels,cp310-cp310)
release_tarballs:
docker image build -t concretefhe-compiler-manylinux:linux_x86_64_tarball -f ../builders/Dockerfile.release_tarball_linux_x86_64 ..
docker container run --rm -v ${PWD}/../tarballs:/tarballs_volume concretefhe-compiler-manylinux:linux_x86_64_tarball cp -r /tarballs/. /tarballs_volume/.
.PHONY: build-initialized \
build-end-to-end-jit \
zamacompiler \
@@ -78,4 +83,5 @@ package_py310:
not \
package_py38 \
package_py39 \
package_py310
package_py310 \
release_tarballs