Search code examples
linuxg++ubuntu-10.10include-pathicc

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

/usr/lib/openmpi/lib:

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


Solution

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