Month ago I installed Open MPI 4.0.1 on macOS Mojave following this Stack Overflow answer.
Back then everything worked and I managed to compile and run hello.c and few other programs.
But when I tried today to compile any program using $HOME/opt/usr/local/bin/mpicc -o program_name ./program_name.c
I get error clang: error: no such file or directory: './program_name.c'
, even though these files are in that directory.
It doesn't even work for hello.c.
But when I try to run existing programs, for example hello, using $HOME/opt/usr/local/bin/mpirun -np 4 hello
, it works.
So I don't understand how can I get error no such file or directory
if mpi can find and run existing programs, but can't compile files that are in the same directory.
I also tried to position in that directory using cd $HOME/opt/usr/local/bin
and then execute mpicc -o hello ./hello.c
, but then I get error -bash: mpicc: command not found
.
Does anyone know where is the problem and how to solve it?