致命错误:mpi.h:没有这样的文件或目录的#include< mpi.h> [英] fatal error: mpi.h: No such file or directory #include <mpi.h>

查看:11428
本文介绍了致命错误:mpi.h:没有这样的文件或目录的#include< mpi.h>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编译我的剧本只用

#include <mpi.h>

它告诉我,有没有这样的文件或目录。
但是,当我包括路径mpi.h为

it tells me that there is no such file or directory. But when i include the path to mpi.h as

#include "/usr/include/mpi/mpi.h"

(路径是正确的),它返回:

(the path is correct) it returns:

In file included from /usr/include/mpi/mpi.h:2087:0,
                 from lbm.cc:7:
/usr/include/mpi/openmpi/ompi/mpi/cxx/mpicxx.h:35:17: fatal error: mpi.h: No such file or directory
 #include "mpi.h"
                 ^
compilation terminated.

任何人都知道如何解决这个问题?

Anyone know how to fix this?

推荐答案

问题是几乎可以肯定你没有使用MPI编译器包装。每当你编译MPI程序,你应该使用MPI包装:

The problem is almost certainly that you're not using the MPI compiler wrappers. Whenever you're compiling an MPI program, you should use the MPI wrappers:


  • Ç - mpicc

  • C ++ - mpiCC mpicxx MPIC ++

  • FORTRAN - mpifort mpif77 mpif90

  • C - mpicc
  • C++ - mpiCC, mpicxx, mpic++
  • FORTRAN - mpifort, mpif77, mpif90

这些包装做所有的脏活为你确保所有适当的编译器标志,库,包括目录,图书馆目录等,都包含在编译程序的。

These wrappers do all of the dirty work for you of making sure that all of the appropriate compiler flags, libraries, include directories, library directories, etc. are included when you compile your program.

这篇关于致命错误:mpi.h:没有这样的文件或目录的#include&LT; mpi.h&GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆