Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving several issues while installing LLTFI #72

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@ RUN pip install tf2onnx
RUN pip3 install pyyaml===5.4.1

WORKDIR /home/
RUN mkdir LLTFI

### LLVM
RUN git clone https://github.com/llvm/llvm-project.git && \
cd llvm-project && git checkout 9778ec057cf4 && cd .. && \
mkdir llvm-project/build && cd llvm-project/build && \
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS="clang;mlir" \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RTTI=ON && \
cmake --build . --target clang check-mlir mlir-translate opt llc lli llvm-dis llvm-link -j${NPROC} && \
ninja install -j${NPROC} && \
cd ../..

RUN apt-get update
RUN apt-get install unzip
RUN apt-get install -y wget

### libprotoc
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.17.2/protobuf-all-3.17.2.zip
Expand All @@ -84,10 +84,9 @@ RUN make check -j${NPROC}
RUN make install
RUN ldconfig

WORKDIR /home/LLTFI/
WORKDIR /home/
RUN git clone https://github.com/DependableSystemsLab/LLTFI.git

WORKDIR /home/

### ONNX_MLIR
RUN git clone --recursive https://github.com/DependableSystemsLab/onnx-mlir-lltfi.git && \
Expand All @@ -104,10 +103,24 @@ RUN git clone --recursive https://github.com/DependableSystemsLab/onnx-mlir-lltf
cmake --build . -j${NPROC} && \
ninja install

WORKDIR /home/LLTFI/LLTFI
WORKDIR /home/LLTFI

### LLTFI
RUN ./setup -LLFI_BUILD_ROOT $(pwd)/build -LLVM_SRC_ROOT $(pwd)/../../llvm-project -LLVM_DST_ROOT $(pwd)/../../llvm-project/build && \
RUN ./setup -LLFI_BUILD_ROOT $(pwd)/build -LLVM_SRC_ROOT $(pwd)/../llvm-project -LLVM_DST_ROOT $(pwd)/../llvm-project/build && \
export LLFI_BUILD_ROOT=$(pwd)/build && \
cd /home/LLTFI/LLTFI/tools && \
cd /home/LLTFI/tools && \
sh json-c-setup.sh

### Setting up the env variables
ENV LLFI_BUILD_ROOT=/home/LLTFI/build
ENV ONNX_MLIR_BUILD=/home/onnx-mlir/build
ENV ONNX_MLIR_SRC=/home/onnx-mlir
ENV LLVM_DST_ROOT=/home/llvm-project/build

### Setting environment variables for custom include and library paths for json-c library
ENV C_INCLUDE_PATH=/root/local/include:$C_INCLUDE_PATH
ENV CPLUS_INCLUDE_PATH=/root/local/include:$CPLUS_INCLUDE_PATH
ENV LIBRARY_PATH=/root/local/lib:$LIBRARY_PATH
ENV LD_LIBRARY_PATH=/root/local/lib:$LD_LIBRARY_PATH

WORKDIR /home/LLTFI
2 changes: 1 addition & 1 deletion tools/json-c-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mkdir build
cd build

echo "Building json-c library"
cmake -G Ninja ..
cmake -G Ninja .. -DCMAKE_INSTALL_PREFIX=~/local
ninja -j10 -k10

echo " \n\n\n Installing json-c library. \n\n"
Expand Down
Loading