I am trying to compile some code in Fedora 21 using 'mpif90'.
First I install openmpi with 'yum':
[root@localhost Inversion]# yum install openmpi
Loaded plugins: langpacks
Package openmpi-1.8.3-2.fc21.x86_64 already installed and latest version
Nothing to do
But then when I compile using 'make' it doesn't work:
[root@localhost Inversion]# make all
mpif90 -O3 -c src/dispersion.f90
make: mpif90: Command not found
Makefile:18: recipe for target 'obj' failed
make: *** [obj] Error 127
As you can see I've downloaded openmpi package but it wont compile.
You cannot compile because you haven't loaded the necessary module.
You need to load the environmental module, this is how Fedora is handling openmpi when you install it using:
dnf install openmpi
(in Fedora 25)
Just follow the following steps:
In your terminal, do:
module avail
You should see an output something like this:
--------------------- /usr/share/Modules/modulefiles ----------------------
dot module-git module-info modules null use.own
---------------------------- /etc/modulefiles -----------------------------
mpi/openmpi-x86_64
Notice there is the mpi/openmpi-x86_64
module available for you to 'load'.
In your terminal, you just do:
module load mpi/openmpi-x86_64
Now you have access to all the mpi compilers like mpif90
and mpic++
etc. You can see that the compiler binaries are stored in: /usr/lib64/openmpi/bin
:
$ which mpif90
and you see the output is:
/usr/lib64/openmpi/bin/mpif90
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With