Setting up G++ or ICC for mpi.h on Ubuntu

I have never done any major programing outside of VS08.

I am trying to compile a program called LAMMPS with either of the two relevant make files. One calls g++ and the other calls icc (Intel's compiler).

icc produces this error:

icc -O -DLAMMPS_GZIP -DMPICH_SKIP_MPICXX -DFFT_FFTW -M write_restart.cpp > write_restart.d write_restart.cpp(15): catastrophic error: cannot open source file "mpi.h" #include "mpi.h"

and g++ throws this error

g++ -g -O -DLAMMPS_GZIP -DMPICH_SKIP_MPICXX -DFFT_FFTW -M verlet.cpp > verlet.d pointers.h:25: fatal error: mpi.h: No such file or directory compilation terminated.

The mpi.h file is located in /usr/lib/openmpi/include

It is my understanding that I need to set that $PATH variable which reads

bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/opt/intel/bin:/usr/lib/openmpi/include:

and $LD_LIBRARY_PATH which currently reads


SO, how does one include the mpi.h file? So that either icc or g++ find it?


mpi.h is a header for MPI library. That would be included if you use mpic++ MPI compiler wrapper instead of g++ in your makefile. mpic++ will call the appropriate compiler. From what you describe you have openmpi package installed on your ubuntu machine.

For more info, you need to consult the manual, e.g. (for LAMMPS)

and perhaps you need to see openmpi manual as to how to set up additional compiler. Not sure if this can be done after openmpi itself has been built. By default I think in Ubuntu openmpi compiler wrappers would only call g++. CMIIW.

Okay, so I got it to work with g++ when setting up cc as "mpic++.mpich2" instead of "mpic++"

you can try compile using openmpi make file in /src/MAKE make openmpi

in my case, this option was successful

Need Your Help

i want to disallow all of the special characters except for normal letters( a- z) but not working

c# regex validation

i have textboxes like username firstname lastname password contact etc. i want to have these textboxes to only accept letters a-z and avoid all of the special characters. i have this line of code f...

Using HttpWebRequest to login to instagram

c# instagram

Hey guys so I'm trying to write a C# Application in which the user can login to their instagram account from a WPF. The problem I'm having is getting the authorization code. When I use this code I ...