Software Archive
Read-only legacy content
17061 Discussions

[Q] icc and mpicc

White_B_
Beginner
2,203 Views

Hi,

I'm new to Intel MIC and CentOS. I wrote an program including the header "mpi.h". When I use icc to compile the source code, it shows  (catastrophic error: cannot open source file "mpi.h"). And when I use mpicc and mpicc++ to compile, the terminal says "command not found".

What should I do to compile the code? Thanks!

ps, I know that there is a thread titled with (catastrophic error: cannot open source file "mpi.h"). However, I don't understand what they are talking about.

Thanks.

0 Kudos
3 Replies
TimP
Honored Contributor III
2,203 Views

If you have installed the Intel cluster studio, the default mpi wrappers for icc/icpc would be mpiicc and mpiicpc.  You would source the mpivars script in the MPI installation as well as the compilervars script in the icc installation to set up the path environment.  I think the beta test for cluster studio may be available a few more weeks.

The expectation on CentOS is that mpicc invokes gcc.  If your mpicc accepts something like mpicc -cc=icc that may be an alternate, but it looks like you didn't install any MPI.   CentOS repositories would likely include a version of OpenMPI which doesn't support MIC. 

If you know that you want an open source mpi, you must find one which supports MIC and build it yourself according to their instructions.

mpi.h is installed as part of an MPI installation, on an include path incorporated in the mpi wrapper.

0 Kudos
White_B_
Beginner
2,203 Views

Thanks for your reply.

I can use icc to compile ordinary cpp (without MPI stuff). This means I've already installed the Intel cluster studio, right?

Since I tried

sudo find $home -name *mpi*'

and got nothing.

Does it mean that I didn't install any MPI? If so, I need to install an MPI package/library that supports MIC, right?

Thanks.

0 Kudos
TimP
Honored Contributor III
2,203 Views

icc is normally sold without including any MPI. 

If you don't have any MPI on default path, I think it means you didn't install the one from CentOS (presumably openmpi for host only).   It would be better anyway to get current openmpi release and install in its own specific path, such as under /opt/openmpi-1.8/.  As far as I know, MIC is supported only in conjunction with host 64-bit mode.

Besides icc being available for purchase by itself, there are 2 groups of packages which include icc and additional development tools:

Parallel Studio (include VTune but no MPI)

Cluster Studio (includes Intel MPI, ifort, icc, VTune, ...)

For a 90 day trial you might be interested in the cluster studio beta.  The prices of buying compilers, mpi, etc. a la carte mount up quickly.  All available on 30 day trial.  No rights to build for sale on trials or betas.

The mpi.h provided with Intel MPI for linux at one time was identical to the one from MPICH but I don't know if that's still true.  You may be able to find versions of MPICH, OpenMPI, and mvapich (OSU mpich) which you can build with your icc to support MIC.

0 Kudos
Reply