Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include mpi.h in Clion

Tags:

c++

c

cmake

clion

I am running linux (Debian) and I want to include the header mpi.h into my project. The mpi.h is located under /usr/include/mpi and running mpiCC and mpirun shows that it's installed. I couldn't find a clear tutorial.

like image 846
G90 Avatar asked Feb 21 '16 18:02

G90


2 Answers

You should add include_directories(/usr/include/mpi/) to your CMakeLists.txt and just include the header:

#include <mpi.h>
like image 72
kivi Avatar answered Sep 23 '22 00:09

kivi


You should include the header file mpi/mpi.h

Like this

    #include<mpi/mpi.h>
like image 24
Xiaofeng Zhang Avatar answered Sep 21 '22 00:09

Xiaofeng Zhang