I was trying to install openpi on ubuntu. I have an Ubuntu 18.04.4 LTS (64 bit) desktop. I installed openmpi using
sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi2 libopenmpi-dev openssh-client openssh-server
Then, in the .bashrc, I have added the following two lines:
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
After that, I used dartmouth hello world mpi to write a small program, compile it and run it to check that the openmpi installation is OK by typing gfortran ubuntu.f90
which leads to the following error
ubuntu.f90:2: Error: Can't open included file 'mpif.h'
the code in ubuntu.f90 :
program hello
include 'mpif.h'
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print*, 'node', rank, ': Hello world'
call MPI_FINALIZE(ierror)
end
I have tried installing libblacs-mpi-dev as in the answer to this question. This question does not seem relevant.