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"