Error building 'MPI`, libmpi could not be found

Thanks for your reply.

I have now figured it out and it worked.
I did not change any of other environmental variables but did the following

  1. go to a terminal
  2. type emacs ~/.julia/prefs/MPI.toml
  3. set path = “/usr/local/Cellar/open-mpi/4.1.1_2”

It seems that the way of setting the path is different from the ways in the two links in my original post (see Error building MPI---ERROR: LoadError: libmpi could not be found) which were in the files ~/.bash_profile or ~/.profile

Maybe it’s Julia version thing