From 3b4d9c3ac798ea4b5d7c8d08bc71ebdc4d9ec2aa Mon Sep 17 00:00:00 2001 From: Brian Kempa Date: Tue, 7 Nov 2023 10:28:51 -0800 Subject: [PATCH] Fix Torch install path check Path expansion was not working as expected --- scripts/setup/dependencies/build_install_torch.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/setup/dependencies/build_install_torch.sh b/scripts/setup/dependencies/build_install_torch.sh index b9d4c77d..b8d1dd37 100755 --- a/scripts/setup/dependencies/build_install_torch.sh +++ b/scripts/setup/dependencies/build_install_torch.sh @@ -31,10 +31,12 @@ sudo unzip -q libtorch-cxx11-abi-shared-with-deps-1.5.0+cpu.zip -d /usr/include # if zsh is in use. We'll just add a conditional extension to every shell # rc file we find (currently only looking at .bashrc and .zshrc) cmake_isaac_torch_path=/usr/include/libtorch/share/cmake/Torch -for shell_cfg in "~/.bashrc" "~/.zshrc"; do +for shell_cfg in "${HOME}/.bashrc" "${HOME}/.zshrc"; do if [[ -f ${shell_cfg} ]] && [ $(grep -cF ${cmake_isaac_torch_path} ${shell_cfg}) -eq 0 ]; then + echo "Adding Torch CMAKE Prefix path to ${shell_cfg}" echo -e '\n## ISAAC Dependency - Torch CMAKE Path\n' >> ${shell_cfg} echo 'if [[ ":$CMAKE_PREFIX_PATH:" != *":'${cmake_isaac_torch_path}':"* ]]; then CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH:+"$CMAKE_PREFIX_PATH:"}'${cmake_isaac_torch_path}'"; fi' >> ${shell_cfg} fi done + echo "Torch added to CMAKE_PREFIX_PATH in shell config file, source ~/.$(basename ${SHELL})rc before building"