Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Openmpi on Fedora 21

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.

like image 972
Trkmrc Avatar asked Feb 06 '23 15:02

Trkmrc


1 Answers

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:

  1. 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'.

  2. In your terminal, you just do:

    module load mpi/openmpi-x86_64
    
  3. 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
    
like image 184
Joshua T Avatar answered Mar 06 '23 13:03

Joshua T