在Fedora 21上安装Openmpi

4

我正在尝试在Fedora 21使用'mpif90'编译一些代码。

首先,我使用'yum'安装了openmpi:

[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

但是当我使用“make”编译时,它无法工作:
[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

您可以看到,我已经下载了openmpi软件包,但它无法编译。

2个回答

5

由于您没有加载必要的模块,因此无法编译。

您需要加载环境模块。当您使用以下命令安装openmpi时,Fedora会处理它:

dnf install openmpi

(在Fedora 25中)只需按照以下步骤操作: 请跟随以下步骤:
  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
    

3
dnf whatprovides "*/mpif90"

它会告诉您提供此二进制文件的软件包。在Fedora中,您可以从openmpi-develmpich软件包中获取它。因此,运行以下命令:

yum install openmpi-devel

这应该能为您完成工作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接