每次使用终端时,我都会强制导出 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