Skip to content

Commit

Permalink
Create e2eshark_build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
saienduri authored Mar 20, 2024
1 parent fe59f1e commit 968d18f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions build_tools/e2eshark_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -eu -o errtrace

this_dir="$(cd $(dirname $0) && pwd)"
repo_root="$(cd $this_dir/../.. && pwd)"
build_dir="$repo_root/build"
mkdir -p "$build_dir"
build_dir="$(cd $build_dir && pwd)"

python="$(which python)"
echo "Using python: $python"

export CMAKE_TOOLCHAIN_FILE="$this_dir/linux_default_toolchain.cmake"

cd $repo_root

echo "::group::CMake configure"
cmake -S "$repo_root/externals/llvm-project/llvm" -B "$build_dir" \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DPython3_FIND_VIRTUALENV=ONLY \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD" \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DLLVM_TARGETS_TO_BUILD=host
echo "::endgroup::"

echo "::group::Build"
cmake --build "$build_dir"
echo "::endgroup::"

echo "::group::BuildWheel"
CMAKE_GENERATOR=Ninja python setup.py bdist_wheel --dist-dir "$repo_root/torch-mlir-wheel" -v
echo "::endgroup::"

0 comments on commit 968d18f

Please sign in to comment.