Skip to content

Commit

Permalink
change et install directory to et-build from build, which now conflic…
Browse files Browse the repository at this point in the history
…ts with torchchat source code (#227)
  • Loading branch information
metascroy authored and malfet committed Jul 17, 2024
1 parent bc1a559 commit 19fbb27
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/install_et.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ install_pip_dependencies() {
}

install_executorch() {
echo "Cloning executorch to ${TORCHCHAT_ROOT}/build/src"
rm -rf ${TORCHCHAT_ROOT}/build
mkdir -p ${TORCHCHAT_ROOT}/build/src
pushd ${TORCHCHAT_ROOT}/build/src
echo "Cloning executorch to ${TORCHCHAT_ROOT}/et-build/src"
rm -rf ${TORCHCHAT_ROOT}/et-build
mkdir -p ${TORCHCHAT_ROOT}/et-build/src
pushd ${TORCHCHAT_ROOT}/et-build/src
git clone https://github.com/pytorch/executorch.git
cd executorch
echo "Install executorch: submodule update"
git submodule sync
git submodule update --init

echo "Applying fixes"
cp ${TORCHCHAT_ROOT}/scripts/fixes_et/module.cpp ${TORCHCHAT_ROOT}/build/src/executorch/extension/module/module.cpp # ET uses non-standard C++ that does not compile in GCC
cp ${TORCHCHAT_ROOT}/scripts/fixes_et/managed_tensor.h ${TORCHCHAT_ROOT}/build/src/executorch/extension/runner_util/managed_tensor.h # ET is missing headers for vector/memory. This causes downstream issues when building runner-et.
cp ${TORCHCHAT_ROOT}/scripts/fixes_et/module.cpp ${TORCHCHAT_ROOT}/et-build/src/executorch/extension/module/module.cpp # ET uses non-standard C++ that does not compile in GCC
cp ${TORCHCHAT_ROOT}/scripts/fixes_et/managed_tensor.h ${TORCHCHAT_ROOT}/et-build/src/executorch/extension/runner_util/managed_tensor.h # ET is missing headers for vector/memory. This causes downstream issues when building runner-et.

echo "Building and installing python libraries"
echo "Building and installing python libraries"
Expand All @@ -50,7 +50,7 @@ install_executorch() {
mkdir cmake-out
cmake -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_BUILD_OPTIMIZED=ON -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON -DEXECUTORCH_BUILD_XNNPACK=ON -S . -B cmake-out -G Ninja
cmake --build cmake-out
cmake --install cmake-out --prefix ${TORCHCHAT_ROOT}/build/install
cmake --install cmake-out --prefix ${TORCHCHAT_ROOT}/et-build/install
popd
}

Expand Down

0 comments on commit 19fbb27

Please sign in to comment.