1

I am having huge problems with my PATH and LD_LIBRARY_PATH since I have installed new libraries. Generally speaking: I can't export permanently my PATH variables defined in my ~/.bashrc file. As example: when I boot and I type which mpiexec, I would expect the one linked to my mpich library defined in my~/.bashrc file, however, I get another one which is:

/usr/bin/mpiexec // vs expected output: /home/mpich/bin/mpiexec

So every time I need to manually type: PATH=/home/mpich/bin:$PATH ; export PATH, and I can't live with this as I have multiple libraries.

What I did:

  1. Modify the bashrc with all my libraries using: sudo nano ~/.bashrc, Output:

    export PATH=$PATH:/usr/local/cuda-10.1/bin

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.1/lib64

    export CUDA_HOME=/usr/local/cuda-10.1

    export PATH=$PATH:/snap/bin

    export PATH=$PATH:/usr/bin

    epxort PATH=$PATH:/bin

    export PATH=$PATH:/home/mpich/bin

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/mpich/lib

    export PATH=$PATH:/home/opt/openmpi/bin

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/opt/openmpi/lib

  2. Edit the environment variables in /etc/environment Output:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mpich/bin:/home/opt/openmpi/bin"

  1. type $ source ~./bashrc
  2. reboot

However, none of the above allow me to retrieve my PATH variables when booting.

So my question is : Where is the error relying and how could I export permanently my path variables defined in ~/.bashrc ? I am running on Ubuntu 18.04.

Any help would be more than appreciated as I have been spending hours on this problem. Thanks in advance

Joachim Bsh
  • 145
  • 1
  • 1
  • 8

0 Answers0