![在 ubuntu 中为 openmpi 永久设置路径](https://linux22.com/image/1088931/%E5%9C%A8%20ubuntu%20%E4%B8%AD%E4%B8%BA%20openmpi%20%E6%B0%B8%E4%B9%85%E8%AE%BE%E7%BD%AE%E8%B7%AF%E5%BE%84.png)
每次使用终端时,我都会强制导出 openmpi 路径。我尝试使用以下方法永久设置路径:
echo export PATH="$PATH:/home/$USER/.openmpi/bin" >> /home/$USER/.bashrc
echo export
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/$USER/.openmpi/lib/">> home/$USER/.bashrc
但是,这不起作用。请提出解决方案。
谢谢
答案1
echo 'export PATH="$PATH:/home/$USER/.openmpi/bin"' | tee -a /home/$USER/.bashrc
和
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/$USER/.openmpi/lib/"' | tee -a /home/$USER/.bashrc