1

I'm currently using Vim 7.4 on Ubuntu 16.04. I have the Syntastic plugin installed via pathogen.

I'm currently doing some coding in C using the mpi library. When I write my code using Vim, syntastic seems to believe that there is an error and tells me that "'mpi.h' file not found" (this is for #include <mpi.h>). I know that this program compiles as I'm able to run mpicc successfully.

When I run a locate mpi.h this is what I get back:

/usr/lib/openmpi/include/mpi.h
/usr/lib/openmpi/include/openmpi/ompi/mpi/fortran/mpif-h/prototypes_mpi.h
/usr/src/linux-headers-4.4.0-62/include/linux/mpi.h
/usr/src/linux-headers-4.4.0-66/include/linux/mpi.h

How can I get Vim to stop giving me these errors?

Wesley Bland
  • 8,816
  • 3
  • 44
  • 59
jules
  • 63
  • 3
  • 10
  • As far as I can tell, Syntastic is a *framework* for syntax-checking; operational and configuration details vary with the specific checker used, which you have not disclosed. Whichever one it is, the problem is surely that you need to add the appropriate include directory to the checker's search path; presumably the directory you want to add is `/usr/lib/openmpi/include`. – John Bollinger Mar 28 '17 at 13:41

1 Answers1

2

Create a file .syntastic_cpp_config in your project home folder. Have all your include folders listed in it. In your case,

-I/usr/lib/openmpi/include

Or the other folder with mpi.h, whichever you use in your build.

Elan
  • 443
  • 5
  • 14